Changeset 116 in pacpusframework for trunk/include/Pacpus/kernel/ComponentBase.h


Ignore:
Timestamp:
06/25/13 13:44:25 (11 years ago)
Author:
Marek Kurdej
Message:

Added: PacpusException - base class for all exceptions. DbiteExceptions inherits from it.
Added: PacpusLibConfig.h - dllimport/dllexport clauses separated from pacpus.h.
Update: comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/Pacpus/kernel/ComponentBase.h

    r76 r116  
    2323
    2424#include <Pacpus/kernel/ComponentManager.h>
    25 #include <Pacpus/kernel/pacpus.h>
     25#include <Pacpus/kernel/PacpusLibConfig.h>
    2626#include <Pacpus/kernel/XmlComponentConfig.h>
    2727
     
    3333class ComponentManager;
    3434
    35 /** ComponentBase
    36  * @brief Base class of a Pacpus component.
    37  */
     35/// Base class of a Pacpus component.
    3836class PACPUSLIB_API ComponentBase
    3937{
    4038    friend class ComponentManager;
     39
    4140public:
    42     /**
    43      * Enumeration of the state that can take a component, the three last states suppose
    44      * that the component is started.
    45      */
     41    /// Enumeration of the state that can take a component, the three last states suppose
     42    /// that the component is started.
    4643    enum COMPONENT_STATE
    4744    {
    48       STOPPED,
    49       NOT_MONITORED,
    50       MONITOR_OK,
    51       MONITOR_NOK
     45        STOPPED,
     46        NOT_MONITORED,
     47        MONITOR_OK,
     48        MONITOR_NOK
    5249    };
    5350
    54     /** Resulting state of a component after its configuration. */
     51    /// Resulting state of a component after its configuration.
    5552    enum COMPONENT_CONFIGURATION
    5653    {
    57       CONFIGURED_OK,
    58       NOT_CONFIGURED,
    59       CONFIGURATION_DELAYED,
    60       CONFIGURED_FAILED
     54        CONFIGURED_OK,
     55        NOT_CONFIGURED,
     56        CONFIGURATION_DELAYED,
     57        CONFIGURED_FAILED
    6158    };
    6259
    63     /** Ctor of ComponentBase.
    64      * @param name Name of your component.
    65      */
    66     ComponentBase(const QString& name);
     60    /// Ctor of ComponentBase.
     61    /// @param name Name of your component.
     62    ComponentBase(const QString & name);
    6763
    68     /** Dtor of ComponentBase. */
     64    /// Dtor of ComponentBase.
    6965    virtual ~ComponentBase();
    7066
    71     /** Return the state of the component.
    72      * @return Value of the current state.
    73      */
     67    /// @returns Value of the current state.
    7468    COMPONENT_STATE getState();
    7569
    76     /** Check whether the component if configurer or not.
    77      * @return True if the component is configured, otherwise false.
    78      */
     70    /// Checks whether the component if configurer or not.
     71    /// @returns @b true if the component is configured, @b false otherwise.
    7972    bool isConfigured() const;
    8073
    8174protected:
    82     /** Change the state of the component.
    83      * @param state New component state.
    84      */
     75    /// Change the state of the component.
     76    /// @param state New component state.
    8577    void setState(COMPONENT_STATE state);
    8678
    87     /** Called when the component starts, you must override this function. */
     79    /// Called when the component starts, you must override this function.
    8880    virtual void startActivity() = 0;
    8981
    90     /** Called when the component stops, you must override this function. */
     82    /// Called when the component stops, you must override this function.
    9183    virtual void stopActivity() = 0;
    9284
    93     /** Called by the ComponentManager, it configure the component thanks a XML node.
    94      * @param config Component's XML node.
    95      * @return State of the configuration.
    96      * FIXME: 'config' should be const, but we can't change the prototype without breaking
    97      * old stuff.
    98      */
     85    /// Called by the ComponentManager, it configure the component thanks a XML node.
     86    /// @param config Component's XML node.
     87    /// @returns State of the configuration.
     88    /// @todo FIXME: 'config' should be const, but we can't change the prototype without breaking old stuff.
    9989    virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config) = 0;
    100    
     90
    10191protected:
    10292    /// The XML node that is got in the configureComponent method
     
    132122};
    133123
    134 } // pacpus
     124} // namespace pacpus
    135125
    136126#endif // DEF_PACPUS_COMPONENTBASE_H
Note: See TracChangeset for help on using the changeset viewer.