RTT::marsh::MarshallingService Class Reference

#include <MarshallingService.hpp>

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

List of all members.

Public Types

typedef boost::shared_ptr
< MarshallingService
shared_ptr
typedef boost::shared_ptr
< MarshallingService
shared_ptr

Public Member Functions

bool loadProperties (const std::string &filename) const
bool loadProperties (const std::string &filename) const
 MarshallingService (TaskContext *parent)
 MarshallingService (TaskContext *parent)
bool readProperties (const std::string &filename) const
bool readProperties (const std::string &filename) const
bool readProperty (const std::string &name, const std::string &filename)
bool readProperty (const std::string &name, const std::string &filename)
bool storeProperties (const std::string &filename) const
bool storeProperties (const std::string &filename) const
bool updateFile (const std::string &filename) const
bool updateFile (const std::string &filename) const
bool updateProperties (const std::string &filename) const
bool updateProperties (const std::string &filename) const
bool writeProperties (const std::string &filename) const
bool writeProperties (const std::string &filename) const
bool writeProperty (const std::string &name, const std::string &filename)
bool writeProperty (const std::string &name, const std::string &filename)

Static Public Member Functions

static shared_ptr Create (TaskContext *parent)
static shared_ptr Create (TaskContext *parent)

Detailed Description

Service which loads and saves properties of a TaskContext.

Definition at line 54 of file install/include/rtt/marsh/MarshallingService.hpp.


Member Typedef Documentation

Reimplemented from RTT::Service.

Definition at line 58 of file rtt/marsh/MarshallingService.hpp.

Reimplemented from RTT::Service.

Definition at line 58 of file install/include/rtt/marsh/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 58 of file MarshallingService.cpp.

RTT::marsh::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.


Member Function Documentation

static shared_ptr RTT::marsh::MarshallingService::Create ( TaskContext parent  )  [static]

Creates a MarshallingService object and registers the service to parent.

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

Creates a MarshallingService object and registers the service to parent.

Definition at line 52 of file MarshallingService.cpp.

bool RTT::marsh::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.

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 86 of file MarshallingService.cpp.

bool RTT::marsh::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:
filename The file to read from.
Returns:
true on success, false on error, consult Logger output for messages.
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:
filename The file to read from.
Returns:
true on success, false on error, consult Logger output for messages.

Definition at line 98 of file MarshallingService.cpp.

bool RTT::marsh::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:
name The 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'.
filename The name of the file in which to lookup name.
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:
name The 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'.
filename The name of the file in which to lookup name.

Definition at line 119 of file MarshallingService.cpp.

bool RTT::marsh::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:
filename The file to store to.
Returns:
true on success, false on error, consult Logger output for messages.
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:
filename The file to store to.
Returns:
true on success, false on error, consult Logger output for messages.

Definition at line 92 of file MarshallingService.cpp.

bool RTT::marsh::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:
filename The file to read from and write to.
Returns:
true on success, false on error, consult Logger output for messages.
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:
filename The file to read from and write to.
Returns:
true on success, false on error, consult Logger output for messages.

Definition at line 113 of file MarshallingService.cpp.

bool RTT::marsh::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:
filename The file to read all the properties from.
Returns:
true on success, false on error, consult Logger output for messages.
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:
filename The file to read all the properties from.
Returns:
true on success, false on error, consult Logger output for messages.

Definition at line 103 of file MarshallingService.cpp.

bool RTT::marsh::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:
filename The file to read from and write to (updating).
Returns:
true on success, false on error, consult Logger output for messages.
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:
filename The file to read from and write to (updating).
Returns:
true on success, false on error, consult Logger output for messages.

Definition at line 108 of file MarshallingService.cpp.

bool RTT::marsh::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:
name The 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'.
filename The name of the file in which to write name.
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:
name The 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'.
filename The name of the file in which to write name.

Definition at line 124 of file MarshallingService.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:50:07 2013