Public Member Functions | Public Attributes | List of all members
RTT::Marshalling Class Reference

#include <Marshalling.hpp>

Inheritance diagram for RTT::Marshalling:
Inheritance graph
[legend]

Public Member Functions

 Marshalling (TaskContext *parent)
 
 ~Marshalling ()
 
- Public Member Functions inherited from RTT::ServiceRequester
bool addOperationCaller (base::OperationCallerBaseInvoker &mbi)
 
bool addServiceRequester (shared_ptr obj)
 
virtual void clear ()
 
virtual bool connectTo (Service::shared_ptr sp)
 
virtual void disconnect ()
 
base::OperationCallerBaseInvokergetOperationCaller (const std::string &name)
 
OperationCallerNames getOperationCallerNames () const
 
Service::shared_ptr getReferencedService ()
 
RequesterNames getRequesterNames () const
 
const std::string & getRequestName () const
 
TaskContextgetServiceOwner () const
 
virtual bool ready () const
 
ServiceRequester::shared_ptr requires ()
 
ServiceRequester::shared_ptr requires (const std::string &service_name)
 
bool requiresService (const std::string &service_name)
 
 ServiceRequester (const std::string &name, TaskContext *owner=0)
 
void setOwner (TaskContext *new_owner)
 
virtual ~ServiceRequester ()
 

Public Attributes

OperationCaller< bool(const std::string &filename)> loadProperties
 
OperationCaller< bool(const std::string &filename)> readProperties
 
OperationCaller< bool(const std::string &name, const std::string &filename)> readProperty
 
OperationCaller< bool(const std::string &filename)> storeProperties
 
OperationCaller< bool(const std::string &filename)> updateFile
 
OperationCaller< bool(const std::string &filename)> updateProperties
 
OperationCaller< bool(const std::string &filename)> writeProperties
 
OperationCaller< bool(const std::string &name, const std::string &filename)> writeProperty
 

Additional Inherited Members

- Public Types inherited from RTT::ServiceRequester
typedef std::vector< std::string > OperationCallerNames
 
typedef std::vector< std::string > RequesterNames
 
typedef boost::shared_ptr< const ServiceRequestershared_constptr
 
typedef boost::shared_ptr< ServiceRequestershared_ptr
 
- Protected Types inherited from RTT::ServiceRequester
typedef std::map< std::string, base::OperationCallerBaseInvoker * > OperationCallers
 Our methods. More...
 
typedef std::map< std::string, ServiceRequester::shared_ptrRequests
 
- Protected Attributes inherited from RTT::ServiceRequester
OperationCallers mmethods
 
Service::shared_ptr mprovider
 
Requests mrequests
 the services we implement. More...
 
std::string mrname
 
TaskContextmrowner
 

Detailed Description

Service requester to load and save properties of a TaskContext.

Definition at line 53 of file Marshalling.hpp.

Constructor & Destructor Documentation

RTT::Marshalling::Marshalling ( TaskContext parent)

This object is normally created by a TaskContext.

Definition at line 43 of file Marshalling.cpp.

RTT::Marshalling::~Marshalling ( )

Definition at line 64 of file Marshalling.cpp.

Member Data Documentation

OperationCaller<bool (const std::string& filename)> RTT::Marshalling::loadProperties

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 70 of file Marshalling.hpp.

OperationCaller<bool (const std::string& filename)> RTT::Marshalling::readProperties

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 90 of file Marshalling.hpp.

OperationCaller<bool (const std::string& name,const std::string& filename)> RTT::Marshalling::readProperty

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 111 of file Marshalling.hpp.

OperationCaller<bool (const std::string& filename)> RTT::Marshalling::storeProperties

Stores all properties of parent 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.
See also
loadProperties() for loading properties in a TaskContext.

Definition at line 80 of file Marshalling.hpp.

OperationCaller<bool (const std::string& filename)> RTT::Marshalling::updateFile

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 132 of file Marshalling.hpp.

OperationCaller<bool (const std::string& filename)> RTT::Marshalling::updateProperties

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 101 of file Marshalling.hpp.

OperationCaller<bool (const std::string& filename)> RTT::Marshalling::writeProperties

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 121 of file Marshalling.hpp.

OperationCaller<bool (const std::string& name, const std::string& filename)> RTT::Marshalling::writeProperty

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 142 of file Marshalling.hpp.


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


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