NEOCCA bindings Specification
0.2.8
|
The handle through which the component communicates with its containing framework. More...
#include <Services.hh>
Public Member Functions | |
virtual | ~Services () |
Obligatory virtual destructor. | |
virtual Port * | getPort (const ::std::string &name)=0 throw (Exception ) |
Fetch a port from the framework. | |
virtual Port * | getPortNonBlocking (const ::std::string &name)=0 throw (Exception ) |
As getPort, but the framework is not permitted to block execution and do possibly complex internal things to satisfy the request. | |
virtual void | releasePort (const ::std::string &name)=0 throw (Exception ) |
Free's the connection indicated by the name for modification by the component's containing framework. | |
virtual void | registerUsesPort (const ::std::string &name, const ::std::string &type)=0 throw (Exception ) |
Notifies the framework that a port of specified name and type may be used by this component. | |
virtual void | registerUsesPort (const ::std::string &name, const ::std::string &type, TypeMap_shared properties)=0 throw (Exception ) |
Convenience function. | |
virtual void | unregisterUsesPort (const ::std::string &name)=0 throw (Exception ) |
Notify the framework that use of a Port, previously registered by this component, is no longer needed. | |
virtual void | addProvidesPort (Port *inPort, const ::std::string &name, const ::std::string &type)=0 throw (Exception ) |
Exports a Port implemented by this component to the framework. | |
virtual void | addProvidesPort (Port *inPort, const ::std::string &name, const ::std::string &type, TypeMap_shared properties)=0 throw (Exception ) |
Convenience function. | |
virtual void | removeProvidesPort (const ::std::string &name)=0 throw (Exception ) |
Notifies the framework that a previously exported Port is no longer available for use. | |
virtual ComponentID_shared | getComponentID ()=0 |
Get a reference to the component which this Services object belongs. | |
virtual TypeMap_shared | createTypeMap ()=0 throw (Exception ) |
Construct and return a shared_ptr<> to a TypeMap. | |
virtual TypeMap_shared | getPortProperties (const ::std::string &portName)=0 throw (Exception ) |
Fetch the framework's idea of the properties for a port already defined in the component that this Services belongs to. | |
virtual ::std::string | genUniquePortName (const ::std::string &base)=0 |
Construct a unique port name derived from the base name given. | |
virtual void | registerForRelease (ComponentRelease *callBack)=0 throw (Exception) |
Obtain a callback for component destruction. |
The handle through which the component communicates with its containing framework.
Memory lifecycle: The framework creates and destroys the Services implementation object outside the component's lifetime. The component may store or pass its Services pointer to any other code safely so long as the receiving function does not store the pointer beyond the component's lifetime.
virtual neo::cca::Services::~Services | ( | ) | [inline, virtual] |
Obligatory virtual destructor.
{}
virtual Port* neo::cca::Services::getPort | ( | const ::std::string & | name | ) | throw (Exception ) [pure virtual] |
Fetch a port from the framework.
Normally this means a uses port. If no uses port is connected and a provided port of the name requested is available, the component will be handed back that port. The framework will not invalidate the connection between eetPort and the matching releasePort. Returns NULL if no provided port or uses port connection matches name.
Exception | if something unexpected by the framework happens, such as the name given being of no known port. |
virtual Port* neo::cca::Services::getPortNonBlocking | ( | const ::std::string & | name | ) | throw (Exception ) [pure virtual] |
As getPort, but the framework is not permitted to block execution and do possibly complex internal things to satisfy the request.
virtual void neo::cca::Services::releasePort | ( | const ::std::string & | name | ) | throw (Exception ) [pure virtual] |
Free's the connection indicated by the name for modification by the component's containing framework.
After this call any port pointer previously assigned from a call to getPort(name) will not be valid for use until getPort(name) is called again.
Exception | if something unexpected by the framework happens, such as the name given being of no known port. |
virtual void neo::cca::Services::registerUsesPort | ( | const ::std::string & | name, |
const ::std::string & | type | ||
) | throw (Exception ) [pure virtual] |
Notifies the framework that a port of specified name and type may be used by this component.
Exception | if something unexpected by the framework happens, such as the same name being registered with different types. |
virtual void neo::cca::Services::registerUsesPort | ( | const ::std::string & | name, |
const ::std::string & | type, | ||
TypeMap_shared | properties | ||
) | throw (Exception ) [pure virtual] |
Convenience function.
As registerUsesPort, but properties argument is included. The properties object should be obtained from Services->createTypeMap(); MIN_CONNECTIONS (int >= 0, default 0) MAX_CONNECTIONS (int >= 1, default 1) ABLE_TO_PROXY (true,false; default false)
virtual void neo::cca::Services::unregisterUsesPort | ( | const ::std::string & | name | ) | throw (Exception ) [pure virtual] |
virtual void neo::cca::Services::addProvidesPort | ( | Port * | inPort, |
const ::std::string & | name, | ||
const ::std::string & | type | ||
) | throw (Exception ) [pure virtual] |
virtual void neo::cca::Services::addProvidesPort | ( | Port * | inPort, |
const ::std::string & | name, | ||
const ::std::string & | type, | ||
TypeMap_shared | properties | ||
) | throw (Exception ) [pure virtual] |
Convenience function.
As addProvidesPort(inport,n,t), but properties argument is included. The properties object should be obtained from Services->createTypeMap(); MIN_CONNECTIONS (int >= 0, default 0) MAX_CONNECTIONS (int >= 1, default 1) ABLE_TO_PROXY (true,false; default false)
virtual void neo::cca::Services::removeProvidesPort | ( | const ::std::string & | name | ) | throw (Exception ) [pure virtual] |
virtual ComponentID_shared neo::cca::Services::getComponentID | ( | ) | [pure virtual] |
Get a reference to the component which this Services object belongs.
virtual TypeMap_shared neo::cca::Services::createTypeMap | ( | ) | throw (Exception ) [pure virtual] |
Construct and return a shared_ptr<> to a TypeMap.
virtual TypeMap_shared neo::cca::Services::getPortProperties | ( | const ::std::string & | portName | ) | throw (Exception ) [pure virtual] |
Fetch the framework's idea of the properties for a port already defined in the component that this Services belongs to.
Modifications to the returned object will not affect the framework.
virtual ::std::string neo::cca::Services::genUniquePortName | ( | const ::std::string & | base | ) | [pure virtual] |
Construct a unique port name derived from the base name given.
virtual void neo::cca::Services::registerForRelease | ( | ComponentRelease * | callBack | ) | throw (Exception) [pure virtual] |
Obtain a callback for component destruction.
callBack | an object that implements the ComponentRelease interface that will be called when the component is to be destroyed. |
Register a callback to be executed when the component is going to be destroyed. During this callback, the Services object passed through setServices will still be valid, but after all such callbacks are made for a specific component, subsequent usage of the Services object is not allowed/is undefined.