IConnect.h
1 
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 
33 namespace Pt {
34 
35 namespace Cosmo {
36 
37 class Component;
38 class IComponentPlugin;
39 
49 class 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
Core module.
Definition: Allocator.h:33
bool isConnectable(IComponentPlugin &p) const
Returns true if the plugin is connectable.
Definition: IConnect.h:74
void addComponent(Component &c)
Notifies that a connectable component was loaded.
Definition: IConnect.h:56
Component base class.
Definition: Component.h:52
virtual void onComponentAdded(Component &c)=0
Called when a matching component is loaded.
Component plugin interface.
Definition: IComponentPlugin.h:51
Interface base class.
Definition: IUnknown.h:44
virtual void onComponentRemoved(Component &c)=0
Called when a matching component is being removed.
Interface for optional component connections.
Definition: IConnect.h:50
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