Last change
on this file since 61 was 43, checked in by sgosseli, 12 years ago |
Minor: add some documentation, update the license header, update the coding style.
|
File size:
1.6 KB
|
Rev | Line | |
---|
[31] | 1 | /**
|
---|
| 2 | *
|
---|
[43] | 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 | *
|
---|
[31] | 11 | */
|
---|
[3] | 12 |
|
---|
[31] | 13 | #ifndef DEF_PACPUS_COMPONENTFACTORYBASE_H
|
---|
| 14 | #define DEF_PACPUS_COMPONENTFACTORYBASE_H
|
---|
[3] | 15 |
|
---|
[31] | 16 | #include <Pacpus/kernel/pacpus.h>
|
---|
[3] | 17 |
|
---|
| 18 | class QString;
|
---|
| 19 |
|
---|
| 20 | namespace pacpus {
|
---|
| 21 |
|
---|
| 22 | class ComponentManager;
|
---|
| 23 | class ComponentBase;
|
---|
| 24 |
|
---|
[31] | 25 | /** ComponentFactoryBase
|
---|
| 26 | * @brief Provide an abstract class to the template ComponentFactory.
|
---|
| 27 | */
|
---|
[3] | 28 | class PACPUSLIB_API ComponentFactoryBase
|
---|
| 29 | {
|
---|
| 30 | friend class ComponentManager;
|
---|
| 31 | public:
|
---|
[43] | 32 | /** Ctor of ComponentFactoryBase. */
|
---|
| 33 | ComponentFactoryBase();
|
---|
| 34 | /** Dtor of ComponentFactoryBase. */
|
---|
| 35 | virtual ~ComponentFactoryBase();
|
---|
[3] | 36 |
|
---|
| 37 | protected:
|
---|
[43] | 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);
|
---|
[3] | 54 |
|
---|
| 55 | private:
|
---|
[43] | 56 | ComponentManager* mgr_;
|
---|
[3] | 57 | };
|
---|
| 58 |
|
---|
| 59 | } // namespace pacpus
|
---|
| 60 |
|
---|
[31] | 61 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.