Changeset 201 in pacpusframework for trunk/include


Ignore:
Timestamp:
10/28/13 15:24:14 (11 years ago)
Author:
Marek Kurdej
Message:

Major: rethrow PacpusException on parameter parsing, set configurationState to ComponentBase::CONFIGURED_FAILED.

File:
1 edited

Legend:

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

    r199 r201  
    5959using ::boost::program_options::value;
    6060
    61 /** ComponentBase
    62  * @brief Base class of a Pacpus component.
    63  */
     61/// @brief Base class of a Pacpus component.
    6462class PACPUSLIB_API ComponentBase
    6563{
     
    6765
    6866public:
    69     /**
    70      * Enumeration of the state that can take a component, the three last states suppose
    71      * that the component is started.
    72      */
    73     enum COMPONENT_STATE
    74     {
    75       STOPPED,
    76       NOT_MONITORED,
    77       MONITOR_OK,
    78       MONITOR_NOK
     67    /// Enumeration of the state that can take a component, the three last states suppose
     68    /// that the component is started.
     69    enum COMPONENT_STATE {
     70        STOPPED,
     71        NOT_MONITORED,
     72        MONITOR_OK,
     73        MONITOR_NOK
    7974    };
    8075
    81     /** Resulting state of a component after its configuration. */
    82     enum COMPONENT_CONFIGURATION
    83     {
    84       CONFIGURED_OK,
    85       NOT_CONFIGURED,
    86       CONFIGURATION_DELAYED,
    87       CONFIGURED_FAILED
     76    /// Resulting state of a component after its configuration.
     77    enum COMPONENT_CONFIGURATION {
     78        CONFIGURED_OK,
     79        NOT_CONFIGURED,
     80        CONFIGURATION_DELAYED,
     81        CONFIGURED_FAILED
    8882    };
    8983
    90     /** Ctor of ComponentBase.
    91      * @param name Name of your component.
    92      */
     84    /// Ctor of ComponentBase.
     85    /// @param name Name of your component.
    9386    ComponentBase(const QString& name);
    9487
    95     /** Dtor of ComponentBase. */
     88    /// Dtor of ComponentBase.
    9689    virtual ~ComponentBase();
    9790
    98     /** Return the state of the component.
    99      * @return Value of the current state.
    100      */
     91    /// Returns the state of the component.
     92    /// @return Value of the current state.
    10193    COMPONENT_STATE getState();
    10294
    103     /** Check whether the component if configurer or not.
    104      * @return True if the component is configured, otherwise false.
    105      */
     95    /// Checks whether the component if configurer or not.
     96    /// @return @b true if the component is configured, otherwise @b false.
    10697    bool isConfigured() const;
    10798
    108     /** Return the name of the component.
    109      * @return Name of the component.
    110      */
     99    /// Returns the name of the component.
     100    /// @return Name of the component.
    111101    QString getName() const;
    112102
     103    /// @todo DOC
    113104    InputInterfaceBase * getInput(QString name) const;
    114105
     106    /// @todo DOC
    115107    OutputInterfaceBase * getOutput(QString name) const;
    116108
    117109protected:
    118     /** Change the state of the component.
    119      * @param state New component state.
    120      */
     110    /// Changes the state of the component.
     111    /// @param state New component state.
    121112    void setState(COMPONENT_STATE state);
    122113
    123     /** Called when the component starts, you must override this function. */
     114    /// Called when the component starts, you must override this function.
    124115    virtual void startActivity() = 0;
    125116
    126     /** Called when the component stops, you must override this function. */
     117    /// Called when the component stops, you must override this function.
    127118    virtual void stopActivity() = 0;
    128119
    129     /** Called by the ComponentManager, it configure the component thanks a XML node.
    130      * @param config Component's XML node.
    131      * @return State of the configuration.
    132      * FIXME: 'config' should be const, but we can't change the prototype without breaking
    133      * old stuff.
    134      */
     120    /// Called by the ComponentManager, it configure the component thanks a XML node.
     121    /// @param config Component's XML node.
     122    /// @return State of the configuration.
     123    /// @todo FIXME: 'config' should be const, but it will be a breaking change
     124    /// old stuff.
    135125    virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config) = 0;
    136126
    137127    // virtual QString getType() = 0;
    138128
    139     // Not Pure virtual, no need to implement if not needed !!!
     129    /// @todo FIXME: should be pure virtual, but it will be a breaking change
    140130    virtual void addInputs() {}
    141131    virtual void addOutputs() {}
    142132
     133    /// Returns an object permitting to add component parameters.
    143134    ::boost::program_options::options_description_easy_init addParameters();
    144135   
Note: See TracChangeset for help on using the changeset viewer.