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

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

Documentation: file info.

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