IConnect.h
1
26
27#ifndef COSMO_CONNECT_INTERFACE_H
28#define COSMO_CONNECT_INTERFACE_H
29
30#include <Pt/Cosmo/Api.h>
31#include <Pt/Cosmo/IUnknown.h>
32
33namespace Pt {
34
35namespace Cosmo {
36
37class Component;
39
49class IConnect : public IUnknown
50{
51 public:
57 {
59 }
60
66 {
68 }
69
75 {
76 return onIsConnectable(p);
77 }
78
79 protected:
86 virtual bool onIsConnectable(IComponentPlugin& p) const = 0;
87
95 virtual void onComponentAdded(Component& c) = 0;
96
101 virtual void onComponentRemoved(Component& c) = 0;
102};
103
104} // namespace Cosmo
105
106} // namespace Pt
107
108#endif // include guard
Component base class.
Definition Component.h:52
Component plugin interface.
Definition IComponentPlugin.h:51
Interface for optional component connections.
Definition IConnect.h:50
void addComponent(Component &c)
Notifies that a connectable component was loaded.
Definition IConnect.h:56
virtual bool onIsConnectable(IComponentPlugin &p) const =0
Determines whether a plugin is connectable.
void removeComponent(Component &c)
Notifies that a connectable component is being removed.
Definition IConnect.h:65
virtual void onComponentRemoved(Component &c)=0
Called when a matching component is being removed.
bool isConnectable(IComponentPlugin &p) const
Returns true if the plugin is connectable.
Definition IConnect.h:74
virtual void onComponentAdded(Component &c)=0
Called when a matching component is loaded.
Interface base class.
Definition IUnknown.h:44
Cosmo Component Model.
Definition Api.h:53
Core module.
Definition Allocator.h:33