IConnect Class Referenceabstract

#include <Pt/Cosmo/IConnect.h>

Interface for optional component connections. More...

Inherits IUnknown.

Public Member Functions

void addComponent (Component &c)
 Notifies that a connectable component was loaded. More...
 
void removeComponent (Component &c)
 Notifies that a connectable component is being removed. More...
 
bool isConnectable (IComponentPlugin &p) const
 Returns true if the plugin is connectable. More...
 

Protected Member Functions

virtual bool onIsConnectable (IComponentPlugin &p) const =0
 Determines whether a plugin is connectable. More...
 
virtual void onComponentAdded (Component &c)=0
 Called when a matching component is loaded. More...
 
virtual void onComponentRemoved (Component &c)=0
 Called when a matching component is being removed. More...
 

Detailed Description

Implement this interface to react to other components becoming available or unavailable at runtime without requiring them as activation dependencies. Filter candidates in onIsConnectable() using hasFeatureId() or hasInterface() checks.

Member Function Documentation

◆ addComponent()

void addComponent ( Component c)
Parameters
cThe component that was added.

◆ removeComponent()

void removeComponent ( Component c)
Parameters
cThe component that is being removed.

◆ isConnectable()

bool isConnectable ( IComponentPlugin p) const
Parameters
pThe plugin to check.

◆ onIsConnectable()

virtual bool onIsConnectable ( IComponentPlugin p) const
protectedpure virtual

Use hasFeatureId() or hasInterface() to filter candidates.

Parameters
pThe plugin to check.

◆ onComponentAdded()

virtual void onComponentAdded ( Component c)
protectedpure virtual

Use queryInterface() on the component to retrieve the optional interface.

Parameters
cThe component that was added.

◆ onComponentRemoved()

virtual void onComponentRemoved ( Component c)
protectedpure virtual
Parameters
cThe component that is being removed.