|
Public Member Functions |
| TemplateService () |
| Sets the service's name to "Unknown", the real name is set at startService.
|
virtual | ~TemplateService () |
| Calls stopService to destroy all ability and need objects.
|
virtual char * | getStatus () |
| Returns the current status.
|
void | startService (DWARF::ActiveServiceDescription_ptr serviceDesc) |
| Called by Service Manager on startup.
|
void | stopService (DWARF::ActiveServiceDescription_ptr serviceDesc) |
| Called by Service Manager on shutdown.
|
std::vector< std::string > * | getAbilities () |
| returns a list with all abilities' names
|
std::vector< std::string > * | getNeeds () |
| returns a list with all needs' names
|
void | addAbility (CORBA::String_var name, CORBA::Object_ptr object) |
| add a CORBA object registered for ability <name>
|
CORBA::Object_var | getAbility (std::string name) |
| returns the CORBA object registered for ability <name>
|
void | addNeed (CORBA::String_var name, CORBA::Object_ptr object) |
| add a CORBA object registered for need <name>
|
CORBA::Object_var | getNeed (std::string name) |
| returns the CORBA object registered for need <name>
|
DWARF::ActiveServiceDescription_ptr | getServiceDesc () |
| returns this service's description object
|
void | blockUntilRunning () |
| Blocks the execution until the service is running.
|
void | blockUntilStopped () |
| Blocks the execution until the service has stopped.
|
Protected Member Functions |
void | parseAbilities (DWARF::ActiveServiceDescription_ptr serviceDesc) |
| Parse all abilities and set up corresponding objects.
|
virtual CORBA::Object_ptr | createAbilityObject (DWARF::AbilityDescription_ptr abilityDescr) |
| Create an Ability object for a given description.
|
virtual bool | checkAbilityObject (CORBA::Object_ptr ability, DWARF::AbilityDescription_ptr abilityDescr) |
| Check whether a given Ability implements all connector protocols.
|
void | parseNeeds (DWARF::ActiveServiceDescription_ptr serviceDesc) |
| Parse all needs and set up corresponding objects.
|
virtual CORBA::Object_ptr | createNeedObject (DWARF::NeedDescription_ptr needDescr) |
| Create a Need object for a given description.
|
virtual bool | checkNeedObject (CORBA::Object_ptr need, DWARF::NeedDescription_ptr needDescr) |
| Check whether a given Need implements all connector protocols.
|
void | checkContextSwitch (DWARF::ActiveServiceDescription_ptr serviceDesc) |
| Sets up ContextSwitch need.
|
virtual CORBA::Object_ptr | createContextSwitchObject (DWARF::NeedDescription_ptr needDescr, DWARF::ActiveServiceDescription_ptr serviceDesc) |
| Method to provide a ContextSwitch object.
|
virtual void | run () |
| The ccre method of the service. Started in a separate thread Once this method returns, this thread is terminated.
|
bool | shouldRun () |
| Returns whether the service is running.
|
const ObjectMap & | getAbilityMap () const |
| Return a reference to the ability map.
|
const ObjectMap & | getNeedMap () const |
| Return a reference to the need map.
|
Static Protected Member Functions |
static void * | controlThreadStarter (void *data) |
| Calls the run() method of the given controller object.
|
Protected Attributes |
std::string | m_name |
| The service's name, set on startService.
|
volatile bool | m_shouldRun |
| State variable containing whether the service should run.
|
DWARF::ActiveServiceDescription_ptr | m_serviceDesc |
| This service's description object.
|
Private Attributes |
ObjectMap | m_abilityMap |
| A map containing all abilities.
|
ObjectMap | m_needMap |
| A map containing all needs.
|
omni_mutex | m_mutexShouldRun |
| Mutex for access to m_shouldRun.
|
omni_condition | m_signalShouldRun |
| Condition variable to signal the start of the run() method.
|
This class is derived from the DWARF::BasicService interface and handles service startup and shutdown.