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

Last change on this file since 64 was 64, checked in by Marek Kurdej, 11 years ago

Modified property: added svn:keywords=Id.

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1// This file is part of the PACPUS framework distributed under the
2// CECILL-C License, Version 1.0.
3//
4/// @author Gerald Dherbomez <firstname.surname@utc.fr>
5/// @date February, 2006
6/// @version $Id: ComponentFactoryBase.h 64 2013-01-09 16:41:12Z kurdejma $
7/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
8/// @brief Brief description.
9///
10/// Purpose: The ComponentFactoryBase class is used to provide an
11/// abstract class to the template ComponentFactory
12
13#ifndef DEF_PACPUS_COMPONENTFACTORYBASE_H
14#define DEF_PACPUS_COMPONENTFACTORYBASE_H
15
16#include <Pacpus/kernel/pacpus.h>
17
18class QString;
19
20namespace pacpus {
21
22class ComponentManager;
23class ComponentBase;
24
25/** ComponentFactoryBase
26 * @brief Provide an abstract class to the template ComponentFactory.
27 */
28class PACPUSLIB_API ComponentFactoryBase
29{
30 friend class ComponentManager;
31public:
32 /** Ctor of ComponentFactoryBase. */
33 ComponentFactoryBase();
34 /** Dtor of ComponentFactoryBase. */
35 virtual ~ComponentFactoryBase();
36
37protected:
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);
54
55private:
56 ComponentManager* mgr_;
57};
58
59} // namespace pacpus
60
61#endif
Note: See TracBrowser for help on using the repository browser.