RTT::marsh::PropertyLoader Class Reference

#include <PropertyLoader.hpp>

List of all members.

Public Member Functions

bool configure (const std::string &filename, TaskContext *target, const std::string &name) const
bool configure (const std::string &filename, TaskContext *target, bool all=true) const
bool configure (const std::string &filename, TaskContext *target, const std::string &name) const
bool configure (const std::string &filename, TaskContext *target, bool all=true) const
bool load (const std::string &filename, TaskContext *target) const
bool load (const std::string &filename, TaskContext *target) const
bool save (const std::string &filename, TaskContext *target, const std::string &name) const
bool save (const std::string &filename, TaskContext *target, bool all=true) const
bool save (const std::string &filename, TaskContext *target, const std::string &name) const
bool save (const std::string &filename, TaskContext *target, bool all=true) const
bool store (const std::string &filename, TaskContext *target) const
bool store (const std::string &filename, TaskContext *target) const

Detailed Description

Load and save property files to a TaskContext's PropertyBag. The default file format is 'cpf' from the CPFMarshaller class.

Definition at line 53 of file install/include/rtt/marsh/PropertyLoader.hpp.


Member Function Documentation

bool RTT::marsh::PropertyLoader::configure ( const std::string &  filename,
TaskContext target,
const std::string &  name 
) const

Read a single property from a file.

Parameters:
filename The file to read from.
target The TaskContext to configure.
name The path to or name of a property in target. Separate path components with dots. For example, to safe property x: bag_1.bag_2.x
Returns:
true on success, false on error, consult Logger output for messages.
bool RTT::marsh::PropertyLoader::configure ( const std::string &  filename,
TaskContext target,
bool  all = true 
) const

Read the XML cpf file and 'refresh' the matching properties of the given TaskContext. There may be more properties in the file than properties in the target.

Parameters:
filename The file to read from.
target The TaskContext to configure.
all Configure all properties of target. Return an error if not all properties were found in filename.
Returns:
true on success, false on error, consult Logger output for messages.
See also:
save() to create this file.
bool RTT::marsh::PropertyLoader::configure ( const std::string &  filename,
TaskContext target,
const std::string &  name 
) const

Read a single property from a file.

Parameters:
filename The file to read from.
target The TaskContext to configure.
name The path to or name of a property in target. Separate path components with dots. For example, to safe property x: bag_1.bag_2.x
Returns:
true on success, false on error, consult Logger output for messages.
bool RTT::marsh::PropertyLoader::configure ( const std::string &  filename,
TaskContext target,
bool  all = true 
) const

Read the XML cpf file and 'refresh' the matching properties of the given TaskContext. There may be more properties in the file than properties in the target.

Parameters:
filename The file to read from.
target The TaskContext to configure.
all Configure all properties of target. Return an error if not all properties were found in filename.
Returns:
true on success, false on error, consult Logger output for messages.
See also:
save() to create this file.
bool RTT::marsh::PropertyLoader::load ( const std::string &  filename,
TaskContext target 
) const

Read the XML cpf file and create (or refresh the matching properties) of the given TaskContext. Any property in the file which is not in the target, is created in the target.

Parameters:
filename The file to read from.
target The TaskContext to load the new properties into.
Returns:
true on success, false on error, consult Logger output for messages.
See also:
store() for dumping properties in a file.
bool RTT::marsh::PropertyLoader::load ( const std::string &  filename,
TaskContext target 
) const

Read the XML cpf file and create (or refresh the matching properties) of the given TaskContext. Any property in the file which is not in the target, is created in the target.

Parameters:
filename The file to read from.
target The TaskContext to load the new properties into.
Returns:
true on success, false on error, consult Logger output for messages.
See also:
store() for dumping properties in a file.
bool RTT::marsh::PropertyLoader::save ( const std::string &  filename,
TaskContext target,
const std::string &  name 
) const

Write a single property to a file, or update an existing file.

Parameters:
filename The file to update or write to.
target The TaskContext to configure.
name The path to or name of a property in target. Separate path components with dots. For example, to safe property x: bag_1.bag_2.x
Returns:
true on success, false on error, consult Logger output for messages.
bool RTT::marsh::PropertyLoader::save ( const std::string &  filename,
TaskContext target,
bool  all = true 
) const

Write the XML cpf file with the properties of the given TaskContext. The file is first read into memory, 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).
target The TaskContext to configure.
all Write out all properties of target to filename, add missing ones if necessary.
Returns:
true on success, false on error, consult Logger output for messages.
See also:
configure() to re-read this file and update matching properties.
bool RTT::marsh::PropertyLoader::save ( const std::string &  filename,
TaskContext target,
const std::string &  name 
) const

Write a single property to a file, or update an existing file.

Parameters:
filename The file to update or write to.
target The TaskContext to configure.
name The path to or name of a property in target. Separate path components with dots. For example, to safe property x: bag_1.bag_2.x
Returns:
true on success, false on error, consult Logger output for messages.
bool RTT::marsh::PropertyLoader::save ( const std::string &  filename,
TaskContext target,
bool  all = true 
) const

Write the XML cpf file with the properties of the given TaskContext. The file is first read into memory, 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).
target The TaskContext to configure.
all Write out all properties of target to filename, add missing ones if necessary.
Returns:
true on success, false on error, consult Logger output for messages.
See also:
configure() to re-read this file and update matching properties.
bool RTT::marsh::PropertyLoader::store ( const std::string &  filename,
TaskContext target 
) 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.
target The TaskContext to read the properties from.
Returns:
true on success, false on error, consult Logger output for messages.
See also:
load() for loading properties in a TaskContext.
bool RTT::marsh::PropertyLoader::store ( const std::string &  filename,
TaskContext target 
) 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.
target The TaskContext to read the properties from.
Returns:
true on success, false on error, consult Logger output for messages.
See also:
load() for loading properties in a TaskContext.

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