MarshallingAccess Class Reference

#include <rtt/MarshallingAccess.hpp>

List of all members.


Detailed Description

Load and save properties of a TaskContext.

Definition at line 52 of file MarshallingAccess.hpp.


Public Member Functions

 MarshallingAccess (TaskContext *parent)
 This object is normally created by a TaskContext.
bool readProperties (const std::string &filename) const
 Read the property file and 'refresh' all the properties of the TaskContext.
bool updateProperties (const std::string &filename) const
 Read the property file and 'refresh' some properties of the TaskContext.
bool readProperty (const std::string &name, const std::string &filename)
 Read a single property from a file.
bool writeProperties (const std::string &filename) const
 Write the property file with the properties of a TaskContext.
bool updateFile (const std::string &filename) const
 Write the property file with the properties of a TaskContext, which are already present in filename.
bool writeProperty (const std::string &name, const std::string &filename)
 Write a single property to a file.

Member Function Documentation

bool 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 45 of file MarshallingAccess.cpp.

References PropertyLoader::configure().

Referenced by MarshallingAccess::MarshallingAccess().

bool 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 50 of file MarshallingAccess.cpp.

References PropertyLoader::configure().

Referenced by MarshallingAccess::MarshallingAccess().

bool 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 ::-separated 'path' to a property.
filename The name of the file in which to lookup name.

Definition at line 66 of file MarshallingAccess.cpp.

References PropertyLoader::configure().

Referenced by MarshallingAccess::MarshallingAccess().

bool 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 55 of file MarshallingAccess.cpp.

References PropertyLoader::save().

Referenced by MarshallingAccess::MarshallingAccess().

bool 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 60 of file MarshallingAccess.cpp.

References PropertyLoader::save().

Referenced by MarshallingAccess::MarshallingAccess().

bool 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 ::-separated 'path' to a property.
filename The name of the file in which to write name.

Definition at line 71 of file MarshallingAccess.cpp.

References PropertyLoader::save().

Referenced by MarshallingAccess::MarshallingAccess().


The documentation for this class was generated from the following files:
Generated on Tue Mar 25 17:41:56 2008 for OrocosReal-TimeToolkit by  doxygen 1.5.3