Changeset 13 in pacpusframework for trunk


Ignore:
Timestamp:
Jan 8, 2013, 1:15:23 AM (12 years ago)
Author:
sgosseli
Message:

Add some documentation.

File:
1 edited

Legend:

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

    r12 r13  
    1 /*********************************************************************
    2 // created:     2006/02/07 - 11:20
    3 // filename:    componentManager.h
    4 //
    5 // author:      Gerald Dherbomez
    6 //
    7 // purpose:     This class records the components and manages them
    8 //              This class is a singleton
    9 //              Use the static ComponentManager::create() function
    10 //              to get a pointer on this object.
    11 *********************************************************************/
     1/**
     2 *
     3 * Distributed under the UTC Heudiascy Pacpus License, Version 1.0.
     4 * Copyright (c) UTC Heudiasyc 2010 - 2013. All rights reserved.
     5 *
     6 * See the LICENSE file for more information or a copy at:
     7 *   http://www.hds.utc.fr/~kurdejma/LICENSE_1_0.txt
     8 *
     9 */
    1210
    1311#ifndef COMPONENTMANAGER_H
     
    1513
    1614#include <cstddef>
     15
    1716#include <QMap>
    1817#include <QList>
     
    2726
    2827class ComponentBase;
    29 //class ComponentFactoryBase;
    3028
    3129typedef QMap<QString, ComponentBase *> ComponentMap;
    3230typedef QMap<QString, ComponentFactoryBase *> FactoryMap;
    3331
     32/** ComponentManager
     33 * @brief Singleton recording the components and managing them.
     34 */
    3435class ComponentManager
    3536{
     
    4142    PACPUS_DEPRECATED_MSG( static PACPUSLIB_API ComponentManager * create(), "use 'getInstance()'" );
    4243
    43     /// @returns a pointer to the ComponentManager object
    44     static PACPUSLIB_API ComponentManager * getInstance();
     44    /** Get the singleton of the ComponentManager class.
     45     * @return Pointer to the ComponentManager singleton.
     46     */
     47    static PACPUSLIB_API ComponentManager* getInstance();
    4548
    46     /// Destroys the ComponentManager object
     49    /** Destroy the ComponentManager singleton.
     50     * After this call, every pointer to the ComponentManager becomes invalid.
     51     */
    4752    static PACPUSLIB_API void destroy();
    4853
     
    5762    };
    5863
    59     /// Call this function to load the components included in the XML config file
    60     /// Usually, this is done in the main() !
     64    /** Load the components included in the XML config file.
     65     * @param file Name of the XML file.
     66     * @return Number of components loaded by the manager.
     67     */
    6168    std::size_t PACPUSLIB_API loadComponents(QString file);
    6269
    63     /// Start all the components
     70    /** Start all the components
     71     * @return True if all the component has been started, otherwise false.
     72     */
    6473    int PACPUSLIB_API start();
    6574
    66     /// Start only the component passed in parameter
     75    /** Start only the component passed in parameter.
     76     * @param component Component to start.
     77     * @return True if the component exists and has been started, otherwise false.
     78     */
    6779    int PACPUSLIB_API start(QString component);
    6880
    69     /// Stop all the components
     81    /** Stop all the components
     82     * @return True if all the component has been stopped, otherwise false.
     83     */
    7084    int PACPUSLIB_API stop();
    7185
    72     /// Stop only the component passed in parameter
     86    /** Stop only the component passed in parameter.
     87     * @param component Component to stop.
     88     * @return True if the component has been stopped, otherwise false.
     89     */
    7390    int PACPUSLIB_API stop(QString component);
    7491
    75     /// Get a pointer to the component referred by 'name' parameter
     92    /** Get a pointer to the component referred by @em name.
     93     * @param name Name of the component.
     94     * @return Pointer to the component if it exists, otherwise @em NULL.
     95     */
    7696    PACPUSLIB_API ComponentBase* getComponent(QString name);
    7797
    78     /// Get the list of all the names of the component known by the manager
     98    /** Get the list of all the names of the component known by the manager.
     99     * @return List of all the component's name.
     100     */
    79101    PACPUSLIB_API QStringList getAllComponentsName();
    80102
    81     /// Load a new plugin from the file filename (it may be a .so/.dll file)
     103    /** Load a new plugin from the file filename (it may be a .so/.dll file)
     104     * @param filename Name of the shared object or the dll.
     105     * @return True if the plugin has been loaded, otherwise false.
     106     */
    82107    bool PACPUSLIB_API loadPlugin(QString filename);
    83108
Note: See TracChangeset for help on using the changeset viewer.