27 #ifndef COSMO_COMPONENT_TYPE_INTERFACE_H
28 #define COSMO_COMPONENT_TYPE_INTERFACE_H
30 #include <Pt/Cosmo/IUnknown.h>
31 #include <Pt/Cosmo/IEnumerable.h>
103 const std::type_info& ti)
const = 0;
110 #include <Pt/Cosmo/Component.h>
134 template <
typename I>
137 const std::type_info& ti =
typeid(I);
142 template <
typename I>
145 const std::type_info& ti =
typeid(I);
147 return static_cast<I*
>(unknown);
154 #endif // include guard
Core module.
Definition: Allocator.h:33
I * queryInterface(Component &c) const
Returns the interface or null if not implemented.
Definition: IComponentType.h:143
virtual ~IComponentType()
Destructor.
Definition: IComponentType.h:54
Component base class.
Definition: Component.h:52
virtual const char * onGetClassId() const =0
Returns the class ID of the component.
virtual const IEnumerable< const char * > & onGetFeatureIds() const =0
Returns the implemented feature IDs.
Component interface query.
Definition: IComponentType.h:50
virtual IUnknown * onQueryInterface(Component &c, const std::type_info &ti) const =0
Returns the interface or null if the interface is not implemented.
virtual bool onHasInterface(const std::type_info &ti) const =0
Returns true if the interface is implemented.
Interface base class.
Definition: IUnknown.h:44
bool hasFeatureId(const char *featureId) const
Returns true if the given feature ID is implemented.
Definition: IComponentType.h:116
const char * classId() const
Returns the class ID of the component.
Definition: IComponentType.h:128
const IEnumerable< const char * > & featureIds() const
Returns the implemented feature IDs.
Definition: IComponentType.h:122
bool hasInterface() const
Returns true if the interface is implemented.
Definition: IComponentType.h:135
virtual bool onHasFeatureId(const char *featureId) const =0
Returns true if the given feature ID is implemented.