Changeset 43 in pacpusframework for trunk


Ignore:
Timestamp:
Jan 8, 2013, 9:53:01 PM (12 years ago)
Author:
sgosseli
Message:

Minor: add some documentation, update the license header, update the coding style.

Location:
trunk
Files:
2 edited

Legend:

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

    r31 r43  
    11/**
    22 *
    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  *
     3 * This file is part of the PACPUS framework distributed under the
     4 * CECILL-C License, Version 1.0.
     5 *
     6 * @author  Gerald Dherbomez
     7 * @date    December, 2012
     8 * @version $Id$
     9 * @copyright Copyright (c) UTC/CNRS Heudiasyc 2005 - 2013. All rights reserved.
     10 *
    911 */
    1012
     
    2729{
    2830    friend class ComponentManager;
    29 
    3031public:
    31         ComponentFactoryBase();
    32         virtual ~ComponentFactoryBase();
     32    /** Ctor of ComponentFactoryBase. */
     33    ComponentFactoryBase();
     34    /** Dtor of ComponentFactoryBase. */
     35    virtual ~ComponentFactoryBase();
    3336
    3437protected:
    35     virtual ComponentBase * instantiateComponent(const QString & name) = 0;
    36     void addFactory(ComponentFactoryBase * addr, const QString & type);
    37     void addComponent(const QString & name);
     38    /** Create a new component having @em name as component name.
     39     * @param name Name of the instantiated component.
     40     * @return Pointer on the newly created component, you become the owner of its lifetime.
     41     */
     42    virtual ComponentBase * instantiateComponent(const QString& name) = 0;
     43   
     44    /** Register a new factory.
     45     * @param addr Address of the factory.
     46     * @param type Name of the type created by the factory.
     47     */
     48    void addFactory(ComponentFactoryBase* addr, const QString& type);
     49   
     50    /** Add a new component.
     51     * @param name Name of the new component.
     52     */
     53    void addComponent(const QString& name);
    3854
    3955private:
    40     ComponentManager * mgr_;
     56    ComponentManager* mgr_;
    4157};
    4258
  • trunk/src/PacpusLib/ComponentFactoryBase.cpp

    r31 r43  
    11/**
    22 *
    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  *
     3 * This file is part of the PACPUS framework distributed under the
     4 * CECILL-C License, Version 1.0.
     5 *
     6 * @author  Gerald Dherbomez
     7 * @date    December, 2012
     8 * @version $Id$
     9 * @copyright Copyright (c) UTC/CNRS Heudiasyc 2005 - 2013. All rights reserved.
     10 *
    911 */
    1012
     
    2224
    2325ComponentFactoryBase::ComponentFactoryBase()
     26    : mgr_(NULL)
    2427{
    2528    LOG_TRACE("constructor");
    26 
    2729    // get the adress of the ComponentManager instance
    2830    mgr_ = ComponentManager::getInstance();
     
    3436}
    3537
    36 void ComponentFactoryBase::addFactory(ComponentFactoryBase * addr, const QString & type)
     38void ComponentFactoryBase::addFactory(ComponentFactoryBase* addr, const QString& type)
    3739{
    3840    LOG_DEBUG("addFactory(type="<< type << ")");
     
    4850}
    4951
    50 void ComponentFactoryBase::addComponent(const QString & name)
     52void ComponentFactoryBase::addComponent(const QString& name)
    5153{
    5254    LOG_DEBUG("addComponent(" << name << ")");
Note: See TracChangeset for help on using the changeset viewer.