ComponentInfo.h
1
26
27#ifndef COSMO_COMPONENT_INFO_H
28#define COSMO_COMPONENT_INFO_H
29
30#include <Pt/Cosmo/Api.h>
31#include <Pt/Cosmo/IComponentPlugin.h>
32#include <Pt/Cosmo/IComponentDeclaration.h>
33#include <Pt/Cosmo/IComponentStatus.h>
34#include <Pt/Cosmo/IEnumerable.h>
35
36#include <string>
37
38namespace Pt {
39
40namespace Cosmo {
41
42class IDependencyInfo;
43
53{
54 public:
64 : _plugin(plugin)
65 , _decl(decl)
66 , _status(status)
67 { }
68
71 ComponentInfo(const ComponentInfo&) = delete;
72
76 { }
77
81
91 {
92 _plugin = plugin;
93 _decl = decl;
94 _status = status;
95 }
96
99 const IComponentPlugin* plugin() const
100 {
101 return _plugin;
102 }
103
107 {
108 return _decl;
109 }
110
114 {
115 return _status;
116 }
117
120 template<typename I>
121 bool hasInterface() const
122 {
123 return _plugin->hasInterface<I>();
124 }
125
129 {
130 return _plugin->mode();
131 }
132
135 bool hasFeatureId(const char* featureId) const
136 {
137 return _plugin->hasFeatureId(featureId);
138 }
139
143 {
144 return _plugin->featureIds();
145 }
146
149 const char* classId() const
150 {
151 return _plugin->classId();
152 }
153
156 const char* info() const
157 {
158 return _plugin->info();
159 }
160
163 const char* instanceId() const
164 {
165 return _decl->instanceId();
166 }
167
171 {
172 return _status->dependencies();
173 }
174
175 private:
176 IComponentPlugin* _plugin;
178 IComponentStatus* _status;
179};
180
181} // namespace Cosmo
182
183} // namespace Pt
184
185#endif // include guard
ComponentInfo(IComponentPlugin *plugin, IComponentDeclaration *decl, IComponentStatus *status)
Constructor.
Definition ComponentInfo.h:61
const IEnumerable< IDependencyInfo > & dependencies() const
Returns info about the dependencies.
Definition ComponentInfo.h:170
const char * instanceId() const
Returns the instance ID.
Definition ComponentInfo.h:163
ComponentInfo(const ComponentInfo &)=delete
No copy constructor.
bool hasFeatureId(const char *featureId) const
Returns true if feature ID is implemented.
Definition ComponentInfo.h:135
const IComponentStatus * status() const
Returns the component status.
Definition ComponentInfo.h:113
bool hasInterface() const
Returns true if interface is available.
Definition ComponentInfo.h:121
const IComponentDeclaration * declaration() const
Returns the instance declaration.
Definition ComponentInfo.h:106
const IEnumerable< const char * > & featureIds() const
Returns the implemented feature IDs.
Definition ComponentInfo.h:142
ComponentMode mode() const
Returns the component mode.
Definition ComponentInfo.h:128
const char * classId() const
Returns the class ID.
Definition ComponentInfo.h:149
void assign(IComponentPlugin *plugin, IComponentDeclaration *decl, IComponentStatus *status)
Reassigns the component information.
Definition ComponentInfo.h:88
ComponentInfo & operator=(const ComponentInfo &)=delete
No copy assignment.
const char * info() const
Returns the info text.
Definition ComponentInfo.h:156
const IComponentPlugin * plugin() const
Returns the plugin.
Definition ComponentInfo.h:99
virtual ~ComponentInfo()
Destructor.
Definition ComponentInfo.h:75
Component flags.
Definition ComponentMode.h:45
Component instance declaration.
Definition IComponentDeclaration.h:45
Component plugin interface.
Definition IComponentPlugin.h:51
Component status interface.
Definition IComponentStatus.h:47
Dependency information.
Definition IDependencyInfo.h:47
Enumerable interface.
Definition IEnumerable.h:58
Cosmo Component Model.
Definition Api.h:53
Core module.
Definition Allocator.h:33