OrocosComponentLibrary  2.7.0
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
CorbaDeploymentComponent Class Reference
Inheritance diagram for CorbaDeploymentComponent:
DeploymentComponent

List of all members.

Public Member Functions

 CorbaDeploymentComponent (const std::string &name, const std::string &siteFile="")
bool createServer (const std::string &tc, bool use_naming)
 Creates a ControlTask CORBA server for a given peer TaskContext.
RTT::TaskContext * myGetPeer (std::string name)
bool connectPeers (const std::string &one, const std::string &other)
 Make two components peers in both directions, such that both can use each other's services.
bool connectPorts (const std::string &one, const std::string &other)
 Establish a data flow connection between two tasks.
bool connectPorts (const std::string &one, const std::string &one_port, const std::string &other, const std::string &other_port)
 Connect two named ports of components.
bool connect (const std::string &one, const std::string &other, ConnPolicy policy)
 Connect two named ports of components.
bool stream (const std::string &port, ConnPolicy policy)
 Creates a stream from a given port of a component.
bool createStream (const std::string &component, const std::string &port, ConnPolicy policy)
bool connectServices (const std::string &one, const std::string &other)
 Connects the required services of one component to the provided services of another and vice versa.
bool connectOperations (const std::string &required, const std::string &provided)
 Connects a required operation to a provided operation.
bool addPeer (const std::string &from, const std::string &target)
 Make one component a peer of the other, in one direction, such that one can use the services of the other.
bool aliasPeer (const std::string &from, const std::string &target, const std::string &alias)
 Make one component a peer of the other, in one direction, with an alternative name, such that one can use the services of the other and knows it under the name of the alias.
bool import (const std::string &package)
 Import a component package or directory.
void path (const std::string &path)
 Add an additional path to search for component packages.
bool loadLibrary (const std::string &name)
 Use this command to load a plugin or component library into the memory of the current process.
bool reloadLibrary (const std::string &filepath)
 Use this command to reload a component library into the memory of the current process.
bool loadComponent (const std::string &name, const std::string &type)
 Load a new component in the current process.
bool loadService (const std::string &component, const std::string &service)
 Loads a service in the given component.
bool unloadComponent (const std::string &name)
 Unload a loaded component from the current process.
void displayComponentTypes () const
 This function prints out the component types this DeploymentComponent can create.
std::vector< std::string > getComponentTypes () const
 This function returns the component types this DeploymentComponent can create in a comma separated list.
bool setPeriodicActivity (const std::string &comp_name, double period, int priority, int scheduler)
 (Re-)set the activity of a component with a periodic activity.
bool setActivity (const std::string &comp_name, double period, int priority, int scheduler)
 (Re-)set the activity of a component with an activity.
bool setFileDescriptorActivity (const std::string &comp_name, double timeout, int priority, int scheduler)
 (Re-)set the activity of a component with a FileDescriptor activity.
bool setActivityOnCPU (const std::string &comp_name, double period, int priority, int scheduler, unsigned int cpu_nr)
 (Re-)set the activity of a component and run it on a given CPU.
bool setSequentialActivity (const std::string &comp_name)
 (Re-)set the activity of a component with a (threadless, reactive) sequential activity.
bool setSlaveActivity (const std::string &comp_name, double period)
 (Re-)set the activity of a component with a (stand alone) slave activity.
bool setMasterSlaveActivity (const std::string &comp_name, const std::string &master_name)
 (Re-)set the activity of a component with a slave activity with master.
bool setNamedActivity (const std::string &comp_name, const std::string &act_type, double period, int priority, int scheduler, const std::string &master_name="")
 (Re-)set the activity of a component.
bool setNamedActivity (const std::string &comp_name, const std::string &act_type, double period, int priority, int scheduler, unsigned cpu_affinity, const std::string &master_name="")
 (Re-)set the activity of a component.
bool loadComponents (const std::string &config_file)
 Load a (partial) application XML configuration from disk.
bool loadComponentsInGroup (const std::string &config_file, const int group)
 Load a (partial) application XML configuration from disk into a specific group.
bool configureComponents ()
 Configure the components with loaded configuration(s).
bool configureComponentsGroup (const int group)
 Configure the components in group group.
bool startComponents ()
 Start all components in the current configuration which have AutoStart set to true.
bool startComponentsGroup (const int group)
 Start all components in group group which have AutoStart set to true.
void clearConfiguration ()
 Clear all loaded configuration options.
bool stopComponents ()
 Stop all loaded and running components.
bool stopComponentsGroup (const int group)
 Stop all loaded and running components in group group.
bool cleanupComponents ()
 Cleanup all loaded and not running components.
bool cleanupComponentsGroup (const int group)
 Cleanup all loaded and not running components.
bool unloadComponents ()
 Unload all loaded and not running components.
bool unloadComponentsGroup (const int group)
 Unload all loaded and not running components in group group.
bool kickStart (const std::string &file_name)
 This function runs loadComponents, configureComponents and startComponents in a row, given no failures occur along the way.
bool kickOutComponent (const std::string &comp_name)
 Stop, cleanup and unload a single component which were loaded by this component.
void kickOut (const std::string &config_file)
 Identical to kickOutAll, but it reads the name of the Components to kickOut from an XML file.
bool kickOutAll ()
 Stop, cleanup and unload all components loaded by the DeploymentComponent.
bool kickOutGroup (const int group)
 Stop, cleanup and unload all components in group group.
bool runScript (const std::string &file_name)
 Scripting-alternative to kickStart: runs this script in the Orocos scripting service.
bool configure (const std::string &name)
 Configure a component by loading the property file 'name.cpf' for component with name name.
bool configureFromFile (const std::string &name, const std::string &filename)
 Configure a component by loading a property file.
bool loadConfiguration (const std::string &config_file)
 Load a (partial) application XML configuration from disk.
bool loadConfigurationString (const std::string &config_text)
 Identical to loadConfiguration, but reads the XML from a string instead of a file.
const RTT::FactoryMap & getFactories () const
 Returns the factory singleton which creates all types of components for the DeploymentComponent.
bool stopComponent (RTT::TaskContext *instance)
 Stop a single loaded and running component.
bool stopComponent (const std::string &comp_name)
 Stop a single loaded and running components.
bool cleanupComponent (RTT::TaskContext *instance)
 Cleanup a single loaded and not running component.
bool cleanupComponent (const std::string &comp_name)
 Cleanup a single loaded and not running component.
void shutdownDeployment ()
 Clean up and shutdown the entire deployment If an operation named "shutdownDeployment" is found in a peer component named "Application", then that operation is called otherwise nothing occurs.

Protected Types

typedef std::map< std::string,
ConnectionData
ConMap
 This maps connection names to associated ports.
typedef std::map< std::string,
ComponentData
CompList
 This vector holds the dynamically loaded components.

Protected Member Functions

virtual bool componentLoaded (RTT::TaskContext *c)
 Check if c is a proxy or a local object.
virtual void componentUnloaded (RTT::TaskContext *c)
 Removes the CORBA server for this component.
bool configureHook ()
 This function imports available plugins from the path formed by the expression.
bool unloadComponentImpl (CompList::iterator cit)
 This method removes all references to the component hold in cit, on the condition that it is not running.
Service::shared_ptr stringToService (std::string const &names)
 Converts a dot-separated path to a service to a Service object.
ServiceRequester::shared_ptr stringToServiceRequester (std::string const &names)
 Converts a dot-separated path to a service to a ServiceRequester object.
base::PortInterface * stringToPort (std::string const &names)
 Converts a dot-separated path to a service to a Port object.
bool waitForSignal (int signumber)
 Waits for any signal and then returns.
bool waitForInterrupt ()
 Waits for SIGINT and then returns.

Protected Attributes

RTT::PropertyBag root
 This bag stores the current configuration.
std::string compPath
RTT::Property< bool > autoUnload
RTT::Attribute< bool > validConfig
RTT::Constant< int > sched_RT
RTT::Constant< int > sched_OTHER
RTT::Constant< int > lowest_Priority
RTT::Constant< int > highest_Priority
RTT::Attribute< std::string > target
int nextGroup
 Next group number.
ConMap conmap
CompList comps

Detailed Description

Definition at line 37 of file CorbaDeploymentComponent.hpp.


Member Function Documentation

bool addPeer ( const std::string &  from,
const std::string &  target 
) [inherited]

Make one component a peer of the other, in one direction, such that one can use the services of the other.

Parameters:
fromThe component that must 'see' target and use its services.
targetThe component that is 'seen' and used by from.
Returns:
true if both components are peers of this deployment component and target became a peer of from.

Definition at line 330 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::configureComponentsGroup(), DeploymentComponent::DeploymentComponent(), and DeploymentComponent::loadComponent().

bool aliasPeer ( const std::string &  from,
const std::string &  target,
const std::string &  alias 
) [inherited]

Make one component a peer of the other, in one direction, with an alternative name, such that one can use the services of the other and knows it under the name of the alias.

Parameters:
fromThe component that must 'see' target and use its services.
targetThe component that is 'seen' and used by from.
aliasThe name of the target as it will be seen by from.
Returns:
true if both components are peers of this deployment component and target became a peer of from.

Definition at line 350 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::DeploymentComponent().

bool cleanupComponent ( RTT::TaskContext *  instance) [inherited]

Cleanup a single loaded and not running component.

Parameters:
instanceinstance pointer of the component.
Returns:
true if successfully cleaned up

Definition at line 2114 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::kickOutComponent().

bool cleanupComponent ( const std::string &  comp_name) [inline, inherited]

Cleanup a single loaded and not running component.

Parameters:
comp_namename of the component.
Returns:
true if successfully cleaned up

Definition at line 872 of file DeploymentComponent.hpp.

bool cleanupComponentsGroup ( const int  group) [inherited]

Cleanup all loaded and not running components.

Parameters:
groupThe group number to cleanup

Definition at line 1591 of file DeploymentComponent.cpp.

References DeploymentComponent::ComponentData::group, DeploymentComponent::ComponentData::instance, and DeploymentComponent::ComponentData::loadedProperties.

Referenced by DeploymentComponent::cleanupComponents(), and DeploymentComponent::kickOutGroup().

void clearConfiguration ( ) [inherited]

Clear all loaded configuration options.

This does not alter any component.

Definition at line 1672 of file DeploymentComponent.cpp.

References DeploymentComponent::root.

Referenced by DeploymentComponent::DeploymentComponent().

bool componentLoaded ( RTT::TaskContext *  c) [protected, virtual]

Check if c is a proxy or a local object.

If it is a local object, make it a server.

Reimplemented from DeploymentComponent.

Definition at line 110 of file CorbaDeploymentComponent.cpp.

void componentUnloaded ( RTT::TaskContext *  c) [protected, virtual]

Removes the CORBA server for this component.

Parameters:
ca valid TaskContext object.

Reimplemented from DeploymentComponent.

Definition at line 133 of file CorbaDeploymentComponent.cpp.

bool configure ( const std::string &  name) [inherited]

Configure a component by loading the property file 'name.cpf' for component with name name.

Parameters:
nameThe name of the component to configure. The file used will be 'name.cpf'.
Returns:
true if the component is a peer of this component and the file could be read.

Definition at line 2060 of file DeploymentComponent.cpp.

References DeploymentComponent::configureFromFile().

Referenced by DeploymentComponent::DeploymentComponent().

bool configureComponents ( ) [inherited]

Configure the components with loaded configuration(s).

This function connects components and data ports, reads properties for the components, attaches activities and loads program and state machine scripts. If a component XML entry has the AutoConf element, configure() will be called upon this component as well. If the configuration fails halfway, the system is configured as complete as possible. You can try to reconfigure by loading a new configuration (using loadConfiguration ) and call configureComponents again to resolve remaining issues.

This function tries to apply the configuration with a best effort. For example, if a program must be loaded in the component, and a program with that same name is already present, the present one is unloaded and the new one is attempted to be loaded. If that fails, the configuration process leaves the scripts as-is and proceeds with further configuration steps of the same component and other components.

The order of configuration depends on the order of components during loadConfiguration. The first encountered component is configured first. If additional loadConfiguration operations refer to the same component, the configuration order is not changed.

Returns:
true if all components could be succesfully configured.

Definition at line 1192 of file DeploymentComponent.cpp.

References DeploymentComponent::configureComponentsGroup(), and DeploymentComponent::nextGroup.

Referenced by DeploymentComponent::DeploymentComponent().

bool configureComponentsGroup ( const int  group) [inherited]
bool configureFromFile ( const std::string &  name,
const std::string &  filename 
) [inherited]

Configure a component by loading a property file.

Parameters:
nameThe name of the component to configure
filenameThe filename where the configuration is in.
Returns:
true if the component is a peer of this component and the file could be read.

Definition at line 2065 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::configure().

bool configureHook ( ) [protected, inherited]

This function imports available plugins from the path formed by the expression.

 ComponentPath + "/rtt/"+ Target + "/plugins" 
Returns:
always true.

Definition at line 253 of file DeploymentComponent.cpp.

bool connect ( const std::string &  one,
const std::string &  other,
ConnPolicy  policy 
) [inherited]

Connect two named ports of components.

The direction of the connection is determined by the read/write port types.

Parameters:
oneA dot-separated path to a port in a service
otherA dot-separated path to a port in a service
policyThe connection policy of the new connetion.
Returns:
true if the ports are present and could be connected, false otherwise.

Definition at line 536 of file DeploymentComponent.cpp.

References DeploymentComponent::stringToPort().

Referenced by DeploymentComponent::DeploymentComponent().

bool connectOperations ( const std::string &  required,
const std::string &  provided 
) [inherited]

Connects a required operation to a provided operation.

Parameters:
requiredThe dot-separated name of a required operation
providedThe dot-separated name of a provided operation
Returns:
true if required is connected to provided

Definition at line 590 of file DeploymentComponent.cpp.

References DeploymentComponent::stringToService(), and DeploymentComponent::stringToServiceRequester().

Referenced by DeploymentComponent::DeploymentComponent().

bool connectPeers ( const std::string &  one,
const std::string &  other 
) [inherited]

Make two components peers in both directions, such that both can use each other's services.

Parameters:
oneThe component that must 'see' other.
otherThe component that must 'see' one.
Returns:
true if both components are peers of this deployment component and could be connected.

Definition at line 314 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::DeploymentComponent().

bool connectPorts ( const std::string &  one,
const std::string &  other 
) [inherited]

Establish a data flow connection between two tasks.

The direction of the connection is determined by the read/write port types.

Note:
Using this function is not advised, since it relies on equal port names on both components. Use the alternative form of connectPorts() which specify component/service and port name.
Deprecated:
by connect()
Parameters:
oneThe first component
otherThe second component
Returns:
true if both tasks are peers of this component and data ports could be connected.

Definition at line 465 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::configureComponentsGroup(), and DeploymentComponent::DeploymentComponent().

bool connectPorts ( const std::string &  one,
const std::string &  one_port,
const std::string &  other,
const std::string &  other_port 
) [inherited]

Connect two named ports of components.

The direction of the connection is determined by the read/write port types.

Parameters:
oneName of the first component or a dot-separated path to its service
one_portName of the port of the first component to connect to other_port
otherName of the second component or a dot-separated path to its service
other_portName of the port of the second component to connect to one_port
Deprecated:
by connect()
Returns:
true if the ports are present and could be connected, false otherwise.

Definition at line 483 of file DeploymentComponent.cpp.

References DeploymentComponent::stringToService().

bool connectServices ( const std::string &  one,
const std::string &  other 
) [inherited]

Connects the required services of one component to the provided services of another and vice versa.

Parameters:
oneThe name of a provided service or a dot-separated path to a Service
oneThe name of a required service or a dot-separated path to a ServiceRequester
Note:
One of the parameters must be a Service and the other a ServiceRequester, or vice versa.

Definition at line 572 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::DeploymentComponent().

bool createStream ( const std::string &  component,
const std::string &  port,
ConnPolicy  policy 
) [inherited]
void displayComponentTypes ( ) const [inherited]

This function prints out the component types this DeploymentComponent can create.

See also:
loadComponent()

Definition at line 1834 of file DeploymentComponent.cpp.

References DeploymentComponent::getFactories().

Referenced by DeploymentComponent::DeploymentComponent().

std::vector< std::string > getComponentTypes ( ) const [inherited]

This function returns the component types this DeploymentComponent can create in a comma separated list.

See also:
loadComponent()

Definition at line 1845 of file DeploymentComponent.cpp.

References DeploymentComponent::getFactories().

Referenced by DeploymentComponent::DeploymentComponent().

bool import ( const std::string &  package) [inherited]

Import a component package or directory.

The import statement searches through the component paths set with path() or set using the RTT_COMPONENT_PATH environment variable.

Parameters:
packageA (ros) package or directory name. All components, plugins and typekits in package will be loaded and become available to the application. As a special case, you may specify a path to a library directly, which will be loaded when found.
Returns:
true if the package could be found and loaded, false if no such package was found in the search path.

Definition at line 1679 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::DeploymentComponent().

void kickOut ( const std::string &  config_file) [inherited]

Identical to kickOutAll, but it reads the name of the Components to kickOut from an XML file.

Parameters:
config_filename of an XML file (probably the same used by loadComponents() or kickStart() ).

Definition at line 2087 of file DeploymentComponent.cpp.

References DeploymentComponent::kickOutComponent().

Referenced by DeploymentComponent::DeploymentComponent().

bool kickOutAll ( ) [inherited]

Stop, cleanup and unload all components loaded by the DeploymentComponent.

Postcondition:
0 == nextGroup

Definition at line 671 of file DeploymentComponent.cpp.

References DeploymentComponent::kickOutGroup(), and DeploymentComponent::nextGroup.

Referenced by DeploymentComponent::DeploymentComponent(), and DeploymentComponent::~DeploymentComponent().

bool kickOutComponent ( const std::string &  comp_name) [inherited]

Stop, cleanup and unload a single component which were loaded by this component.

Parameters:
comp_namename of the component.
Returns:
true if successfully stopped, cleaned and unloaded

Definition at line 2151 of file DeploymentComponent.cpp.

References DeploymentComponent::cleanupComponent(), DeploymentComponent::root, DeploymentComponent::stopComponent(), and DeploymentComponent::unloadComponent().

Referenced by DeploymentComponent::DeploymentComponent(), and DeploymentComponent::kickOut().

bool loadComponent ( const std::string &  name,
const std::string &  type 
) [inherited]

Load a new component in the current process.

It wil appear as a peer with name name of this component.

Parameters:
nameName the new component will receive.
typeThe type of the component. This is usually a library (.dll or .so) name.
Returns:
True if the component could be created, false if name is already in use or type was not an Orocos library.

Definition at line 1720 of file DeploymentComponent.cpp.

References DeploymentComponent::addPeer(), and DeploymentComponent::componentLoaded().

Referenced by DeploymentComponent::DeploymentComponent(), and DeploymentComponent::loadComponentsInGroup().

bool loadComponents ( const std::string &  config_file) [inherited]

Load a (partial) application XML configuration from disk.

The necessary components are located or loaded, but no component configuration is yet applied. One can load multiple configurations and call configureComponents() once to apply all settings. In case of duplicate information is the latest loaded configuration option used. The components are loaded into the next group number, and the next group number is incremented.

See also:
configureComponents to configure the components with the loaded configuration and startComponents to start them.
Parameters:
config_fileA file on local disk containing the XML configuration.
Returns:
true if the configuration could be read and was valid.

Definition at line 710 of file DeploymentComponent.cpp.

References DeploymentComponent::loadComponentsInGroup(), and DeploymentComponent::nextGroup.

Referenced by DeploymentComponent::DeploymentComponent(), and DeploymentComponent::loadConfiguration().

bool loadComponentsInGroup ( const std::string &  config_file,
const int  group 
) [inherited]

Load a (partial) application XML configuration from disk into a specific group.

If the group already exists, then adds to that group. Does not affect existing members of the group.

See also:
loadComponents for general details
Parameters:
config_fileA file on local disk containing the XML configuration.
groupThe group number to load into
Precondition:
0 <= group
Returns:
true if the configuration could be read and was valid.

Definition at line 717 of file DeploymentComponent.cpp.

References DeploymentComponent::loadComponent(), DeploymentComponent::loadLibrary(), DeploymentComponent::path(), DeploymentComponent::root, and DeploymentComponent::setNamedActivity().

Referenced by DeploymentComponent::kickStart(), and DeploymentComponent::loadComponents().

bool loadConfiguration ( const std::string &  config_file) [inherited]

Load a (partial) application XML configuration from disk.

The necessary components are located or loaded, but no component configuration is yet applied. One can load multiple configurations and call configureComponents() once to apply all settings. In case of duplicate information is the latest loaded configuration option used.

Deprecated:
by loadComponents.
See also:
configureComponents to configure the components with the loaded configuration.
Parameters:
config_fileA file on local disk containing the XML configuration.
Returns:
true if the configuration could be read and was valid.

Definition at line 705 of file DeploymentComponent.cpp.

References DeploymentComponent::loadComponents().

Referenced by DeploymentComponent::DeploymentComponent(), and DeploymentComponent::loadConfigurationString().

bool loadConfigurationString ( const std::string &  config_text) [inherited]

Identical to loadConfiguration, but reads the XML from a string instead of a file.

Parameters:
config_textA string containing the XML configuration.
Returns:
true if the configuration string could be read and was valid.

Definition at line 636 of file DeploymentComponent.cpp.

References DeploymentComponent::loadConfiguration().

Referenced by DeploymentComponent::DeploymentComponent().

bool loadLibrary ( const std::string &  name) [inherited]

Use this command to load a plugin or component library into the memory of the current process.

This is a low-level function which you should only use if you could not use import().

Parameters:
namean absolute or relative path to a loadable library.
Returns:
True if it could be loaded, false otherwise.

Definition at line 1692 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::DeploymentComponent(), and DeploymentComponent::loadComponentsInGroup().

bool loadService ( const std::string &  component,
const std::string &  service 
) [inherited]

Loads a service in the given component.

If a service with the name of service is already loaded, does nothing and returns true.

Note:
If the loaded service uses another name to expose itself or does not register itself with an RTT::Service object, this function will load the service anyway in case it has been loaded before.
Parameters:
componentA peer of this component.
serviceA service discovered by the PluginLoader which will be loaded into component.
Returns:
false if component is not a peer or service is not known. true otherwise.

Definition at line 1704 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::DeploymentComponent().

void path ( const std::string &  path) [inherited]

Add an additional path to search for component packages.

Parameters:
acolon or semi-colon separated list of directories to search for. Typically, paths have the form prefix1/lib/orocos:prefix2/lib/orocos etc.

Definition at line 1685 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::DeploymentComponent(), and DeploymentComponent::loadComponentsInGroup().

bool reloadLibrary ( const std::string &  filepath) [inherited]

Use this command to reload a component library into the memory of the current process.

This is a low-level function which you should only use for testing/development

Parameters:
filepathan absolute path to a loaded library.
Returns:
True if it could be reloaded, false otherwise.

Definition at line 1698 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::DeploymentComponent().

bool setActivity ( const std::string &  comp_name,
double  period,
int  priority,
int  scheduler 
) [inherited]

(Re-)set the activity of a component with an activity.

Parameters:
comp_nameThe name of the component to change.
periodThe period of the activity (or 0.0 if non periodic).
priorityThe scheduler priority (OS dependent).
schedulerThe scheduler type ORO_SCHED_RT or ORO_SCHED_OTHER.
Returns:
false if one of the parameters does not match or if the component is running.

Definition at line 1855 of file DeploymentComponent.cpp.

References DeploymentComponent::setNamedActivity().

Referenced by DeploymentComponent::DeploymentComponent().

bool setActivityOnCPU ( const std::string &  comp_name,
double  period,
int  priority,
int  scheduler,
unsigned int  cpu_nr 
) [inherited]

(Re-)set the activity of a component and run it on a given CPU.

Parameters:
comp_nameThe name of the component to change.
periodThe period of the activity (or 0.0 if non periodic).
priorityThe scheduler priority (OS dependent).
schedulerThe scheduler type ORO_SCHED_RT or ORO_SCHED_OTHER.
cpu_nrThe CPU to run the thread on. Numbering starts from zero.
Returns:
false if one of the parameters does not match or if the component is running.

Definition at line 1883 of file DeploymentComponent.cpp.

References DeploymentComponent::setNamedActivity().

Referenced by DeploymentComponent::DeploymentComponent().

bool setFileDescriptorActivity ( const std::string &  comp_name,
double  timeout,
int  priority,
int  scheduler 
) [inherited]

(Re-)set the activity of a component with a FileDescriptor activity.

Parameters:
comp_nameThe name of the component to change.
timeoutThe timeout of the activity (or 0.0 if no timeout).
priorityThe scheduler priority (OS dependent).
schedulerThe scheduler type ORO_SCHED_RT or ORO_SCHED_OTHER.
Returns:
false if one of the parameters does not match or if the component is running.

Definition at line 1869 of file DeploymentComponent.cpp.

References DeploymentComponent::setNamedActivity().

Referenced by DeploymentComponent::DeploymentComponent().

bool setMasterSlaveActivity ( const std::string &  comp_name,
const std::string &  master_name 
) [inherited]

(Re-)set the activity of a component with a slave activity with master.

Parameters:
comp_nameThe name of the component to change.
master_nameThe name of the master component.
Returns:
false if one of the components is not found or comp_name is running.

Definition at line 1937 of file DeploymentComponent.cpp.

References DeploymentComponent::setNamedActivity().

Referenced by DeploymentComponent::DeploymentComponent().

bool setNamedActivity ( const std::string &  comp_name,
const std::string &  act_type,
double  period,
int  priority,
int  scheduler,
const std::string &  master_name = "" 
) [inherited]

(Re-)set the activity of a component.

CPU affinity defaults to all available CPUs

Parameters:
comp_nameThe name of the component to change.
act_typeThe RTT::Activity type: 'Activity', 'PeriodicActivity', 'SequentialActivity' or 'SlaveActivity'.
priorityThe scheduler priority (OS dependent).
periodThe period of the activity.
schedulerThe scheduler type ORO_SCHED_RT or ORO_SCHED_OTHER.
master_nameThe name of the master component in case of a extras::SlaveActivity with a master.
Returns:
false if one of the parameters does not match or if the component is running.

Definition at line 1951 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::loadComponentsInGroup(), DeploymentComponent::setActivity(), DeploymentComponent::setActivityOnCPU(), DeploymentComponent::setFileDescriptorActivity(), DeploymentComponent::setMasterSlaveActivity(), DeploymentComponent::setPeriodicActivity(), DeploymentComponent::setSequentialActivity(), and DeploymentComponent::setSlaveActivity().

bool setNamedActivity ( const std::string &  comp_name,
const std::string &  act_type,
double  period,
int  priority,
int  scheduler,
unsigned  cpu_affinity,
const std::string &  master_name = "" 
) [inherited]

(Re-)set the activity of a component.

Parameters:
comp_nameThe name of the component to change.
act_typeThe RTT::Activity type: 'Activity', 'PeriodicActivity', 'SequentialActivity' or 'SlaveActivity'.
priorityThe scheduler priority (OS dependent).
periodThe period of the activity.
schedulerThe scheduler type ORO_SCHED_RT or ORO_SCHED_OTHER.
cpu_affinityThe prefered cpu to run on (a mask)
master_nameThe name of the master component in case of a extras::SlaveActivity with a master.
Returns:
false if one of the parameters does not match or if the component is running.

Definition at line 1965 of file DeploymentComponent.cpp.

bool setPeriodicActivity ( const std::string &  comp_name,
double  period,
int  priority,
int  scheduler 
) [inherited]

(Re-)set the activity of a component with a periodic activity.

Parameters:
comp_nameThe name of the component to change.
periodThe period of the activity.
priorityThe scheduler priority (OS dependent).
schedulerThe scheduler type ORO_SCHED_RT or ORO_SCHED_OTHER.
Returns:
false if one of the parameters does not match or if the component is running.

Definition at line 1898 of file DeploymentComponent.cpp.

References DeploymentComponent::setNamedActivity().

Referenced by DeploymentComponent::DeploymentComponent().

bool setSequentialActivity ( const std::string &  comp_name) [inherited]

(Re-)set the activity of a component with a (threadless, reactive) sequential activity.

Parameters:
comp_nameThe name of the component to change.
Returns:
false if one of the parameters does not match or if the component is running.

Definition at line 1925 of file DeploymentComponent.cpp.

References DeploymentComponent::setNamedActivity().

Referenced by DeploymentComponent::DeploymentComponent().

bool setSlaveActivity ( const std::string &  comp_name,
double  period 
) [inherited]

(Re-)set the activity of a component with a (stand alone) slave activity.

Parameters:
comp_nameThe name of the component to change.
periodThe period of the activity.
Returns:
false if one of the parameters does not match or if the component is running.

Definition at line 1912 of file DeploymentComponent.cpp.

References DeploymentComponent::setNamedActivity().

Referenced by DeploymentComponent::DeploymentComponent().

bool startComponents ( ) [inherited]

Start all components in the current configuration which have AutoStart set to true.

Returns:
true if all components could be succesfully started.

Definition at line 1486 of file DeploymentComponent.cpp.

References DeploymentComponent::nextGroup, and DeploymentComponent::startComponentsGroup().

Referenced by DeploymentComponent::DeploymentComponent().

bool startComponentsGroup ( const int  group) [inherited]

Start all components in group group which have AutoStart set to true.

Returns:
true if all the group's components could be succesfully started.

Definition at line 1496 of file DeploymentComponent.cpp.

References DeploymentComponent::ComponentData::group, DeploymentComponent::ComponentData::instance, and DeploymentComponent::root.

Referenced by DeploymentComponent::kickStart(), and DeploymentComponent::startComponents().

bool stopComponent ( RTT::TaskContext *  instance) [inherited]

Stop a single loaded and running component.

Parameters:
instanceinstance pointer of the component.
Returns:
true if successfully stopped.

Definition at line 2132 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::kickOutComponent().

bool stopComponent ( const std::string &  comp_name) [inline, inherited]

Stop a single loaded and running components.

Parameters:
comp_namename of the component.
Returns:
true if successfully stopped

Definition at line 855 of file DeploymentComponent.hpp.

bool stopComponentsGroup ( const int  group) [inherited]

Stop all loaded and running components in group group.

Parameters:
groupThe group number to stop

Definition at line 1559 of file DeploymentComponent.cpp.

References DeploymentComponent::ComponentData::group, and DeploymentComponent::ComponentData::instance.

Referenced by DeploymentComponent::kickOutGroup(), and DeploymentComponent::stopComponents().

bool stream ( const std::string &  port,
ConnPolicy  policy 
) [inherited]

Creates a stream from a given port of a component.

Parameters:
portThe dot-separated path to an input or output port of component or service.
policyThe connection policy that instructs how to set up the stream. The policy.transport field is mandatory, the policy.name_id field is highly recommended.
Returns:
true if the stream could be setup.

Definition at line 563 of file DeploymentComponent.cpp.

References DeploymentComponent::stringToPort().

Referenced by DeploymentComponent::DeploymentComponent().

base::PortInterface * stringToPort ( std::string const &  names) [protected, inherited]

Converts a dot-separated path to a service to a Port object.

Parameters:
namea dot-separated path name to a port. The first part of the name must be the component name. Example: "Controller.arm.input".
Returns:
null if the port could not be found, the port otherwise

Definition at line 427 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::connect(), and DeploymentComponent::stream().

Service::shared_ptr stringToService ( std::string const &  names) [protected, inherited]

Converts a dot-separated path to a service to a Service object.

Parameters:
namea dot-separated path name to a service. The first part of the name must be the component name. For example 'Controller.arm'.
Returns:
null if the service could not be found, the service otherwise

Definition at line 366 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::connectOperations(), DeploymentComponent::connectPorts(), and DeploymentComponent::createStream().

ServiceRequester::shared_ptr stringToServiceRequester ( std::string const &  names) [protected, inherited]

Converts a dot-separated path to a service to a ServiceRequester object.

Parameters:
namea dot-separated path name to a service. The first part of the name must be the component name. For example 'Controller.arm'.
Returns:
null if the service could not be found, the service otherwise

Definition at line 398 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::connectOperations().

bool unloadComponent ( const std::string &  name) [inherited]

Unload a loaded component from the current process.

It may not be running.

Parameters:
nameThe name of a component loaded with loadComponent().
Returns:
true if name was not running and could be unloaded.

Definition at line 1815 of file DeploymentComponent.cpp.

References DeploymentComponent::unloadComponentImpl().

Referenced by DeploymentComponent::DeploymentComponent(), and DeploymentComponent::kickOutComponent().

bool unloadComponentsGroup ( const int  group) [inherited]

Unload all loaded and not running components in group group.

Parameters:
groupThe group number to unload

Definition at line 1646 of file DeploymentComponent.cpp.

References DeploymentComponent::ComponentData::group, and DeploymentComponent::unloadComponentImpl().

Referenced by DeploymentComponent::kickOutGroup(), and DeploymentComponent::unloadComponents().

bool waitForInterrupt ( ) [protected, inherited]

Waits for SIGINT and then returns.

Returns:
false if this function could not install a signal handler.

Definition at line 282 of file DeploymentComponent.cpp.

References DeploymentComponent::waitForSignal().

Referenced by DeploymentComponent::DeploymentComponent().

bool waitForSignal ( int  signumber) [protected, inherited]

Waits for any signal and then returns.

Returns:
false if this function could not install a signal handler.

Definition at line 289 of file DeploymentComponent.cpp.

Referenced by DeploymentComponent::DeploymentComponent(), and DeploymentComponent::waitForInterrupt().


Member Data Documentation

RTT::PropertyBag root [protected, inherited]

The documentation for this class was generated from the following files: