Changeset 116 in pacpusframework for trunk/include/Pacpus/kernel/ComponentBase.h
- Timestamp:
- 06/25/13 13:44:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/ComponentBase.h
r76 r116 23 23 24 24 #include <Pacpus/kernel/ComponentManager.h> 25 #include <Pacpus/kernel/ pacpus.h>25 #include <Pacpus/kernel/PacpusLibConfig.h> 26 26 #include <Pacpus/kernel/XmlComponentConfig.h> 27 27 … … 33 33 class ComponentManager; 34 34 35 /** ComponentBase 36 * @brief Base class of a Pacpus component. 37 */ 35 /// Base class of a Pacpus component. 38 36 class PACPUSLIB_API ComponentBase 39 37 { 40 38 friend class ComponentManager; 39 41 40 public: 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. 46 43 enum COMPONENT_STATE 47 44 { 48 STOPPED,49 NOT_MONITORED,50 MONITOR_OK,51 MONITOR_NOK45 STOPPED, 46 NOT_MONITORED, 47 MONITOR_OK, 48 MONITOR_NOK 52 49 }; 53 50 54 / ** Resulting state of a component after its configuration. */51 /// Resulting state of a component after its configuration. 55 52 enum COMPONENT_CONFIGURATION 56 53 { 57 CONFIGURED_OK,58 NOT_CONFIGURED,59 CONFIGURATION_DELAYED,60 CONFIGURED_FAILED54 CONFIGURED_OK, 55 NOT_CONFIGURED, 56 CONFIGURATION_DELAYED, 57 CONFIGURED_FAILED 61 58 }; 62 59 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); 67 63 68 / ** Dtor of ComponentBase. */64 /// Dtor of ComponentBase. 69 65 virtual ~ComponentBase(); 70 66 71 /** Return the state of the component. 72 * @return Value of the current state. 73 */ 67 /// @returns Value of the current state. 74 68 COMPONENT_STATE getState(); 75 69 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. 79 72 bool isConfigured() const; 80 73 81 74 protected: 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. 85 77 void setState(COMPONENT_STATE state); 86 78 87 / ** Called when the component starts, you must override this function. */79 /// Called when the component starts, you must override this function. 88 80 virtual void startActivity() = 0; 89 81 90 / ** Called when the component stops, you must override this function. */82 /// Called when the component stops, you must override this function. 91 83 virtual void stopActivity() = 0; 92 84 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. 99 89 virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config) = 0; 100 90 101 91 protected: 102 92 /// The XML node that is got in the configureComponent method … … 132 122 }; 133 123 134 } // pacpus124 } // namespace pacpus 135 125 136 126 #endif // DEF_PACPUS_COMPONENTBASE_H
Note:
See TracChangeset
for help on using the changeset viewer.