#include <MarshallingService.hpp>
Public Types | |
typedef boost::shared_ptr < MarshallingService > | shared_ptr |
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) |
Static Public Member Functions | |
static shared_ptr | Create (TaskContext *parent) |
Service which loads and saves properties of a TaskContext.
Definition at line 54 of file MarshallingService.hpp.
typedef boost::shared_ptr<MarshallingService> RTT::marsh::MarshallingService::shared_ptr |
Reimplemented from RTT::Service.
Definition at line 58 of file MarshallingService.hpp.
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.
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.
filename | The file to read from. |
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.
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 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.
filename | The file to read from. |
servicename | Service to use |
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.
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. |
servicename | Service 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.
filename | The file to store to. |
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.
filename | The file to store to. |
servicename | Service to use |
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.
filename | The file to read from and write to. |
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.
filename | The file to read all the properties from. |
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.
filename | The file to read from and write to. |
servicename | Service to use |
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.
filename | The file to read all the properties from. |
servicename | Service to use |
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.
filename | The file to read from and write to (updating). |
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.
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 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.
filename | The file to read from and write to (updating). |
servicename | Service to use |
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.
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. |
servicename | Service to use |
Definition at line 249 of file MarshallingService.cpp.