Public Types | Public Member Functions | Static Public Member Functions | List of all members
RTT::marsh::MarshallingService Class Reference

#include <MarshallingService.hpp>

Inheritance diagram for RTT::marsh::MarshallingService:
Inheritance graph
[legend]

Public Types

typedef boost::shared_ptr< MarshallingServiceshared_ptr
 
- Public Types inherited from RTT::Service
typedef OperationInterface Factory
 
typedef std::vector< std::string > ProviderNames
 
typedef boost::shared_ptr< const Serviceshared_constptr
 
typedef boost::shared_ptr< Serviceshared_ptr
 
- Public Types inherited from RTT::OperationInterface
typedef std::vector< base::DataSourceBase::shared_ptrArguments
 
typedef std::vector< ArgumentDescriptionDescriptions
 
- Public Types inherited from RTT::ConfigurationInterface
typedef std::vector< std::string > AttributeNames
 
typedef std::vector< base::AttributeBase * > AttributeObjects
 
- Public Types inherited from RTT::DataFlowInterface
typedef std::vector< std::string > PortNames
 
typedef std::vector< base::PortInterface * > Ports
 
typedef boost::function< void(base::PortInterface *)> SlotFunction
 

Public Member Functions

bool loadProperties (const std::string &filename) const
 
bool loadServiceProperties (const std::string &filename, const std::string &servicename) const
 
 MarshallingService (TaskContext *parent)
 
bool readProperties (const std::string &filename) const
 
bool readProperty (const std::string &name, const std::string &filename)
 
bool readServiceProperties (const std::string &filename, const std::string &servicename) const
 
bool readServiceProperty (const std::string &name, const std::string &filename, const std::string &servicename)
 
bool storeProperties (const std::string &filename) const
 
bool storeServiceProperties (const std::string &filename, const std::string &servicename) const
 
bool updateFile (const std::string &filename) const
 
bool updateProperties (const std::string &filename) const
 
bool updateServiceFile (const std::string &filename, const std::string &servicename) const
 
bool updateServiceProperties (const std::string &filename, const std::string &servicename) const
 
bool writeProperties (const std::string &filename) const
 
bool writeProperty (const std::string &name, const std::string &filename)
 
bool writeServiceProperties (const std::string &filename, const std::string &servicename) const
 
bool writeServiceProperty (const std::string &name, const std::string &filename, const std::string &servicename)
 
- Public Member Functions inherited from RTT::Service
bool addLocalOperation (base::OperationBase &op)
 
template<class Signature >
Operation< Signature > & addOperation (Operation< Signature > &op)
 
template<class Func , class Class >
Operation< typename internal::GetSignature< Func >::Signature > & addOperation (const std::string name, Func func, Class *obj, ExecutionThread et=ClientThread)
 
template<class Func >
Operation< Func > & addOperation (const std::string name, Func *func, ExecutionThread et=ClientThread)
 
template<class Func , class ObjT >
Operation< typename internal::GetSignatureDS< Func >::Signature > & addOperationDS (const std::string &name, Func func, internal::DataSource< boost::shared_ptr< ObjT > > *sp, ExecutionThread et=ClientThread)
 
template<class Signature , class ObjT >
Operation< Signature > & addOperationDS (internal::DataSource< boost::shared_ptr< ObjT > > *sp, Operation< Signature > &op)
 
virtual bool addService (shared_ptr obj)
 
template<class Signature >
Operation< Signature > & addSynchronousOperation (Operation< Signature > &op)
 
template<class Func , class Class >
Operation< typename internal::GetSignature< Func >::Signature > & addSynchronousOperation (const std::string name, Func func, Class *obj, ExecutionThread et=ClientThread)
 
void clear ()
 
internal::OperationCallerC create (std::string name, ExecutionEngine *caller)
 
const std::string & doc () const
 
void doc (const std::string &description)
 
boost::shared_ptr< base::DisposableInterfacegetLocalOperation (std::string name)
 
const std::string & getName () const
 
OperationInterfacePartgetOperation (std::string name)
 
base::DataSourceBase::shared_ptr getOperation (std::string name, const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const
 
std::vector< std::string > getOperationNames () const
 
TaskContextgetOwner () const
 
ExecutionEnginegetOwnerExecutionEngine () const
 
shared_ptr getParent () const
 
virtual ProviderNames getProviderNames () const
 
shared_ptr getService (const std::string &service_name)
 
bool hasOperation (const std::string &name) const
 
bool hasService (const std::string &service_name)
 
Service::shared_ptr provides ()
 
Service::shared_ptr provides (const std::string &service_name)
 
void removeOperation (const std::string &name)
 
virtual void removeService (std::string const &service_name)
 
bool resetOperation (std::string name, base::OperationBase *impl)
 
 Service (const std::string &name, TaskContext *owner=0)
 
void setName (const std::string &name)
 
bool setOperationThread (std::string const &name, ExecutionThread et)
 
void setOwner (TaskContext *new_owner)
 
void setParent (shared_ptr new_parent)
 
virtual ~Service ()
 
- Public Member Functions inherited from RTT::OperationInterface
void add (const std::string &name, OperationInterfacePart *part)
 
void clear ()
 
Descriptions getArgumentList (const std::string &name) const
 
int getArity (const std::string &name) const
 
int getCollectArity (const std::string &name) const
 
std::string getDescription (const std::string &name) const
 
std::vector< std::string > getNames () const
 
OperationInterfacePartgetPart (const std::string &name)
 
std::string getResultType (const std::string &name) const
 
bool hasMember (const std::string &name) const
 
bool isSynchronous (const std::string &name) const
 
base::DataSourceBase::shared_ptr produce (const std::string &name, const Arguments &args, ExecutionEngine *caller) const
 
base::DataSourceBase::shared_ptr produceCollect (const std::string &name, const Arguments &args, internal::DataSource< bool >::shared_ptr blocking) const
 
base::DataSourceBase::shared_ptr produceHandle (const std::string &name) const
 
base::DataSourceBase::shared_ptr produceSend (const std::string &name, const Arguments &args, ExecutionEngine *caller) const
 
void remove (const std::string &name)
 
- Public Member Functions inherited from RTT::ConfigurationInterface
template<class T >
bool addAttribute (const std::string &name, T &attr)
 
template<class T >
Attribute< T > & addAttribute (const std::string &name, Attribute< T > &attr)
 
bool addAttribute (base::AttributeBase &a)
 
template<class T >
bool addConstant (const std::string &name, const T &cnst)
 
template<class T >
Constant< T > & addConstant (const std::string &name, Constant< T > &cnst)
 
bool addConstant (base::AttributeBase &c)
 
template<class T >
Property< T > & addProperty (const std::string &name, T &prop)
 
template<class T >
Property< T > & addProperty (const std::string &name, Property< T > &prop)
 
bool addProperty (base::PropertyBase &pb)
 
void clear ()
 
 ConfigurationInterface ()
 
ConfigurationInterfacecopy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &repl, bool instantiate) const
 
base::AttributeBasegetAttribute (const std::string &name) const
 
AttributeNames getAttributeNames () const
 
base::AttributeBasegetConstant (const std::string &name) const
 
base::PropertyBasegetProperty (const std::string &name) const
 
base::AttributeBasegetValue (const std::string &name) const
 
AttributeObjects const & getValues () const
 
bool hasAttribute (const std::string &name) const
 
bool hasProperty (const std::string &name) const
 
void loadValues (AttributeObjects const &new_values)
 
PropertyBagproperties ()
 
void removeAttribute (const std::string &name)
 
bool removeProperty (base::PropertyBase &p)
 
bool removeValue (const std::string &name)
 
bool setValue (base::AttributeBase *ab)
 
 ~ConfigurationInterface ()
 
- Public Member Functions inherited from RTT::DataFlowInterface
base::InputPortInterfaceaddEventPort (const std::string &name, base::InputPortInterface &port, SlotFunction callback=SlotFunction())
 
base::InputPortInterfaceaddEventPort (base::InputPortInterface &port, SlotFunction callback=SlotFunction())
 
base::InputPortInterfaceaddLocalEventPort (base::InputPortInterface &port, SlotFunction callback=SlotFunction())
 
base::PortInterfaceaddLocalPort (base::PortInterface &port)
 
base::PortInterfaceaddPort (const std::string &name, base::PortInterface &port)
 
base::PortInterfaceaddPort (base::PortInterface &port)
 
void clear ()
 
 DataFlowInterface (Service *parent=0)
 
void dataOnPort (base::PortInterface *port)
 
TaskContextgetOwner () const
 
base::PortInterfacegetPort (const std::string &name) const
 
std::string getPortDescription (const std::string &name) const
 
PortNames getPortNames () const
 
Ports getPorts () const
 
template<class Type >
Type * getPortType (const std::string &name)
 
ServicegetService () const
 
void removeLocalPort (const std::string &name)
 
void removePort (const std::string &name)
 
bool setPortDescription (const std::string &name, const std::string description)
 
 ~DataFlowInterface ()
 

Static Public Member Functions

static shared_ptr Create (TaskContext *parent)
 
- Static Public Member Functions inherited from RTT::Service
static Service::shared_ptr Create (const std::string &name, TaskContext *owner=0)
 

Additional Inherited Members

- Protected Types inherited from RTT::Service
typedef std::vector< base::OperationBase * > OperationList
 
typedef std::map< std::string, shared_ptrServices
 
typedef std::map< std::string, base::OperationBase * > SimpleOperations
 
- Protected Types inherited from RTT::OperationInterface
typedef std::map< std::string, OperationInterfacePart * > map_t
 
- Protected Types inherited from RTT::ConfigurationInterface
typedef std::vector< base::AttributeBase * > map_t
 
- Protected Member Functions inherited from RTT::Service
bool testOperation (base::OperationBase &op)
 
- Protected Member Functions inherited from RTT::ConfigurationInterface
bool chkPtr (const std::string &where, const std::string &name, const void *ptr)
 
- Protected Member Functions inherited from RTT::DataFlowInterface
bool chkPtr (const std::string &where, const std::string &name, const void *ptr)
 
ServicecreatePortObject (const std::string &name)
 
- Protected Attributes inherited from RTT::Service
std::string mdescription
 
std::string mname
 
TaskContextmowner
 
OperationList ownedoperations
 
shared_ptr parent
 
Services services
 the services we implement. More...
 
SimpleOperations simpleoperations
 
- Protected Attributes inherited from RTT::OperationInterface
map_t data
 
- Protected Attributes inherited from RTT::ConfigurationInterface
PropertyBag bag
 
map_t values
 
- Protected Attributes inherited from RTT::DataFlowInterface
Ports mports
 
Servicemservice
 

Detailed Description

Service which loads and saves properties of a TaskContext.

Definition at line 54 of file MarshallingService.hpp.

Member Typedef Documentation

Definition at line 58 of file MarshallingService.hpp.

Constructor & Destructor Documentation

RTT::MarshallingService::MarshallingService ( TaskContext parent)

Creates a MarshallingService object. You need to add the service to parent yourself, or use Create(). This object is normally created by a TaskContext.

Definition at line 62 of file MarshallingService.cpp.

Member Function Documentation

MarshallingService::shared_ptr RTT::MarshallingService::Create ( TaskContext parent)
static

Creates a MarshallingService object and registers the service to parent.

Definition at line 56 of file MarshallingService.cpp.

bool RTT::MarshallingService::loadProperties ( const std::string &  filename) const

Read a property file and update (or create any missing) properties in the TaskContext. This function allows to dynamically add properties to a component. This can be useful in combination with Orocos scripts when the script requires additional properties from the parent TaskContext.

Definition at line 132 of file MarshallingService.cpp.

bool RTT::MarshallingService::loadServiceProperties ( const std::string &  filename,
const std::string &  servicename 
) const

Read a property file and update (or create any missing) properties of a Service. This function allows to dynamically add properties to a component. This can be useful in combination with Orocos scripts when the script requires additional properties from the Service.

Definition at line 176 of file MarshallingService.cpp.

bool RTT::MarshallingService::readProperties ( const std::string &  filename) const

Read the property file and 'refresh' all the properties of the TaskContext. There may be more properties in the file than properties in the TaskContext, but all properties of the TaskContext must be present in filename. In case a type mismatch occurs, this method will fail and update no properties.

Parameters
filenameThe file to read from.
Returns
true on success, false on error, consult Logger output for messages.

Definition at line 144 of file MarshallingService.cpp.

bool RTT::MarshallingService::readProperty ( const std::string &  name,
const std::string &  filename 
)

Read a single property from a file. The name may be a 'path' like location of a Property in the hierarchy.

Parameters
nameThe name of the property in the file. For example "MyProp" for a top-level property or "Settings.XML.Editor" to specify a dot-separated 'path' to the property 'Editor'.
filenameThe name of the file in which to lookup name.

Definition at line 165 of file MarshallingService.cpp.

bool RTT::MarshallingService::readServiceProperties ( const std::string &  filename,
const std::string &  servicename 
) const

Read the property file and 'refresh' all the properties of a Service. There may be more properties in the file than properties in the Service, but all properties of the Service must be present in filename. In case a type mismatch occurs, this method will fail and update no properties.

Parameters
filenameThe file to read from.
servicenameService to use
Returns
true on success, false on error, consult Logger output for messages.

Definition at line 198 of file MarshallingService.cpp.

bool RTT::MarshallingService::readServiceProperty ( const std::string &  name,
const std::string &  filename,
const std::string &  servicename 
)

Read a single property from a file. The name may be a 'path' like location of a Property in the hierarchy.

Parameters
nameThe name of the property in the file. For example "MyProp" for a top-level property or "Settings.XML.Editor" to specify a dot-separated 'path' to the property 'Editor'.
filenameThe name of the file in which to lookup name.
servicenameService to use

Definition at line 239 of file MarshallingService.cpp.

bool RTT::MarshallingService::storeProperties ( const std::string &  filename) const

Stores all properties of a TaskContext in a new file or overwrite an existing one. The file given in filename will always be overwritten and any existing content will be lost.

Parameters
filenameThe file to store to.
Returns
true on success, false on error, consult Logger output for messages.

Definition at line 138 of file MarshallingService.cpp.

bool RTT::MarshallingService::storeServiceProperties ( const std::string &  filename,
const std::string &  servicename 
) const

Stores all properties of a Service in a new file or overwrite an existing one. The file given in filename will always be overwritten and any existing content will be lost.

Parameters
filenameThe file to store to.
servicenameService to use
Returns
true on success, false on error, consult Logger output for messages.

Definition at line 187 of file MarshallingService.cpp.

bool RTT::MarshallingService::updateFile ( const std::string &  filename) const

Write the property file with the properties of a TaskContext, which are already present in filename. No new entries are created in the file, only existing ones are updated. The file is first read in, the resulting tree is updated with the task's properties, and then written to disk again.

Parameters
filenameThe file to read from and write to.
Returns
true on success, false on error, consult Logger output for messages.

Definition at line 159 of file MarshallingService.cpp.

bool RTT::MarshallingService::updateProperties ( const std::string &  filename) const

Read the property file and 'refresh' some properties of the TaskContext. There may be more properties in the file than properties in the TaskContext, and some may be missing in the file. This method will update 'as much as possible' properties. In case a type mismatch occurs, this method will fail and update no properties.

Parameters
filenameThe file to read all the properties from.
Returns
true on success, false on error, consult Logger output for messages.

Definition at line 149 of file MarshallingService.cpp.

bool RTT::MarshallingService::updateServiceFile ( const std::string &  filename,
const std::string &  servicename 
) const

Write the property file with the properties of a Service, which are already present in filename. No new entries are created in the file, only existing ones are updated. The file is first read in, the resulting tree is updated with the task's properties, and then written to disk again.

Parameters
filenameThe file to read from and write to.
servicenameService to use
Returns
true on success, false on error, consult Logger output for messages.

Definition at line 228 of file MarshallingService.cpp.

bool RTT::MarshallingService::updateServiceProperties ( const std::string &  filename,
const std::string &  servicename 
) const

Read the property file and 'refresh' some properties of the Service. There may be more properties in the file than properties in the Service, and some may be missing in the file. This method will update 'as much as possible' properties. In case a type mismatch occurs, this method will fail and update no properties.

Parameters
filenameThe file to read all the properties from.
servicenameService to use
Returns
true on success, false on error, consult Logger output for messages.

Definition at line 208 of file MarshallingService.cpp.

bool RTT::MarshallingService::writeProperties ( const std::string &  filename) const

Write the property file with the properties of a TaskContext. The file is first read in, the resulting tree is updated with the task's properties and then written to disk again. This allows to share files between tasks.

Parameters
filenameThe file to read from and write to (updating).
Returns
true on success, false on error, consult Logger output for messages.

Definition at line 154 of file MarshallingService.cpp.

bool RTT::MarshallingService::writeProperty ( const std::string &  name,
const std::string &  filename 
)

Write a single property to a file. The name may be a 'path' like location of a Property in the hierarchy.

Parameters
nameThe name of the property in the file. For example "MyProp" for a top-level property or "Settings.XML.Editor" to specify a dot-separated 'path' to the property 'Editor'.
filenameThe name of the file in which to write name.

Definition at line 170 of file MarshallingService.cpp.

bool RTT::MarshallingService::writeServiceProperties ( const std::string &  filename,
const std::string &  servicename 
) const

Write the property file with the properties of a Service. The file is first read in, the resulting tree is updated with the task's properties and then written to disk again. This allows to share files between tasks.

Parameters
filenameThe file to read from and write to (updating).
servicenameService to use
Returns
true on success, false on error, consult Logger output for messages.

Definition at line 218 of file MarshallingService.cpp.

bool RTT::MarshallingService::writeServiceProperty ( const std::string &  name,
const std::string &  filename,
const std::string &  servicename 
)

Write a single property to a file. The name may be a 'path' like location of a Property in the hierarchy.

Parameters
nameThe name of the property in the file. For example "MyProp" for a top-level property or "Settings.XML.Editor" to specify a dot-separated 'path' to the property 'Editor'.
filenameThe name of the file in which to write name.
servicenameService to use

Definition at line 249 of file MarshallingService.cpp.


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


rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:47