source: pacpusframework/trunk/include/Pacpus/kernel/ComponentFactoryBase.h@ 179

Last change on this file since 179 was 89, checked in by morasjul, 12 years ago

PACPUS 2.0 Beta deployed in new branch

Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1// %pacpus:license{
2// This file is part of the PACPUS framework distributed under the
3// CECILL-C License, Version 1.0.
4// %pacpus:license}
5/// @file
6/// @author Gerald Dherbomez <firstname.surname@utc.fr>
7/// @date February, 2006
8/// @version $Id: ComponentFactoryBase.h 76 2013-01-10 17:05:10Z kurdejma $
9/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
10/// @brief Brief description.
11///
12/// Purpose: The ComponentFactoryBase class is used to provide an
13/// abstract class to the template ComponentFactory
14
15#ifndef DEF_PACPUS_COMPONENTFACTORYBASE_H
16#define DEF_PACPUS_COMPONENTFACTORYBASE_H
17
18#include <Pacpus/kernel/pacpus.h>
19
20class QString;
21
22namespace pacpus {
23
24class ComponentManager;
25class ComponentBase;
26
27/** ComponentFactoryBase
28 * @brief Provide an abstract class to the template ComponentFactory.
29 */
30class PACPUSLIB_API ComponentFactoryBase
31{
32 friend class ComponentManager;
33public:
34 /** Ctor of ComponentFactoryBase. */
35 ComponentFactoryBase();
36 /** Dtor of ComponentFactoryBase. */
37 virtual ~ComponentFactoryBase();
38
39protected:
40 /** Create a new component having @em name as component name.
41 * @param name Name of the instantiated component.
42 * @return Pointer on the newly created component, you become the owner of its lifetime.
43 */
44 virtual ComponentBase * instantiateComponent(const QString& name) = 0;
45
46 /** Register a new factory.
47 * @param addr Address of the factory.
48 * @param type Name of the type created by the factory.
49 */
50 void addFactory(ComponentFactoryBase* addr, const QString& type);
51
52 /** Add a new component.
53 * @param name Name of the new component.
54 */
55 void addComponent(const QString& name);
56
57private:
58 ComponentManager* mgr_;
59};
60
61} // namespace pacpus
62
63#endif
Note: See TracBrowser for help on using the repository browser.