Changeset 116 in pacpusframework for trunk/include/Pacpus/kernel/ComponentManager.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/ComponentManager.h

    r76 r116  
    1818#define DEF_PACPUS_COMPONENTMANAGER_H
    1919
     20#include <Pacpus/kernel/ComponentFactoryBase.h>
    2021#include <Pacpus/kernel/pacpus.h>
    21 #include <Pacpus/kernel/ComponentFactoryBase.h>
     22#include <Pacpus/kernel/PacpusLibConfig.h>
    2223#include <Pacpus/kernel/PacpusPluginInterface.h>
    2324#include <Pacpus/kernel/XmlConfigFile.h>
     
    4142{
    4243    friend class ComponentBase;
     44
     45    // Allow 2 functions to access to private members of ComponentManager
     46    friend void ComponentFactoryBase::addFactory(ComponentFactoryBase * addr, const QString & type);
     47    friend void ComponentFactoryBase::addComponent(const QString & name);
    4348
    4449public:
     
    6873    };
    6974
    70     /** Load the components included in the XML config file.
    71      * @param file Name of the XML file.
    72      * @return Number of components loaded by the manager.
    73      */
     75    /// Loads the components included in the XML config file.
     76    /// @param file Name of the XML file.
     77    /// @returns Number of components loaded by the manager.
    7478    PACPUSLIB_API std::size_t loadComponents(const QString& file);
    7579
    76     /** Start all the components
    77      * @return True if all the component has been started, otherwise false.
    78      */
     80    /// Starts all the components
     81    /// @return @b true if all the component has been started, @b false otherwise.
    7982    PACPUSLIB_API bool start();
    8083
    81     /** Start only the component passed in parameter.
    82      * @param component Component to start.
    83      * @return True if the component exists and has been started, otherwise false.
    84      */
     84    /// Starts only the component passed in parameter.
     85    /// @param component Component to start.
     86    /// @returns @b true if the component exists and has been started, @b false otherwise.
    8587    PACPUSLIB_API bool start(const QString& component);
    8688
    87     /** Stop all the components
    88      * @return True if all the component has been stopped, otherwise false.
    89      */
     89    /// Stops all the components
     90    /// @returns @b true if all the component has been stopped, @b false otherwise.
    9091    PACPUSLIB_API bool stop();
    9192
    92     /** Stop only the component passed in parameter.
    93      * @param component Component to stop.
    94      * @return True if the component has been stopped, otherwise false.
    95      */
     93    /// Stops only the component passed in parameter.
     94    /// @param component Component to stop.
     95    /// @returns @b true if the component has been stopped, @b false otherwise.
    9696    PACPUSLIB_API bool stop(const QString& component);
    9797
    98     /** Get a pointer to the component referred by @em name.
    99      * @param name Name of the component.
    100      * @return Pointer to the component if it exists, otherwise @em NULL.
    101      */
     98    /// Gets a pointer to the component referred by @em name.
     99    ///
     100    /// @param name Name of the component.
     101    /// @returns Pointer to the component if it exists, @b NULL otherwise.
    102102    PACPUSLIB_API ComponentBase* getComponent(const QString& name);
    103103
    104     /** Get the list of all the names of the component known by the manager.
    105      * @return List of all the component's name.
    106      */
     104    /// Gets the list of all the names of the component known by the manager.
     105    /// @returns List of all the component's name.
    107106    PACPUSLIB_API QStringList getAllComponentsName() const;
    108107
    109     /** Load a new plugin from the file filename (it may be a .so/.dll file)
    110      * @param filename Name of the shared object or the dll.
    111      * @return True if the plugin has been loaded, otherwise false.
    112      */
     108    /// Loads a new plugin from the file filename (it may be a .so/.dll file)
     109    /// @param filename Name of the shared object or the dll.
     110    /// @returns @b true if the plugin has been loaded, @b false otherwise .
    113111    PACPUSLIB_API bool loadPlugin(const QString& filename);
    114112
     
    118116
    119117    bool registerComponent(ComponentBase* addr, const QString& name);
    120     bool registerComponentFactory(ComponentFactoryBase* addr, const QString& type);
     118    bool registerComponentFactory(ComponentFactoryBase * addr, const QString& type);
    121119
    122120    bool unRegisterComponent(const QString& name);
    123121    bool unRegisterComponentFactory(const QString& type);
    124 
    125     // Allow 2 functions to access to private members of ComponentManager
    126     friend void ComponentFactoryBase::addFactory(ComponentFactoryBase* addr, const QString & type);
    127     friend void ComponentFactoryBase::addComponent(const QString & name);
    128122
    129123    /// private constructor accessible only via static create() function
Note: See TracChangeset for help on using the changeset viewer.