Orocos Real-Time Toolkit
2.6.0
|
Service requester to load and save properties of a TaskContext. More...
#include <rtt/marsh/Marshalling.hpp>
Public Types | |
typedef std::vector< std::string > | RequesterNames |
typedef std::vector< std::string > | OperationCallerNames |
Public Member Functions | |
Marshalling (TaskContext *parent) | |
This object is normally created by a TaskContext. | |
const std::string & | getRequestName () const |
RequesterNames | getRequesterNames () const |
TaskContext * | getServiceOwner () const |
The owner is the top-level TaskContext owning this service (indirectly). | |
Service::shared_ptr | getReferencedService () |
Returns the service we're referencing. | |
bool | addOperationCaller (base::OperationCallerBaseInvoker &mbi) |
OperationCallerNames | getOperationCallerNames () const |
base::OperationCallerBaseInvoker * | getOperationCaller (const std::string &name) |
ServiceRequester * | requires () |
ServiceRequester * | requires (const std::string &service_name) |
bool | requiresService (const std::string &service_name) |
Query if this service requires certain sub-services. | |
bool | connectTo (Service::shared_ptr sp) |
Connects this service's methods to the operations provided by op. | |
bool | ready () const |
Returns true when all methods were resolved. | |
void | disconnect () |
Disconnects all methods from their implementation. | |
Public Attributes | |
OperationCaller< bool(const std::string &filename)> | loadProperties |
Read a property file and update (or create any missing) properties in the TaskContext. | |
OperationCaller< bool(const std::string &filename)> | storeProperties |
Stores all properties of parent TaskContext in a new file or overwrite an existing one. | |
OperationCaller< bool(const std::string &filename)> | readProperties |
Read the property file and 'refresh' all the properties of the TaskContext. | |
OperationCaller< bool(const std::string &filename)> | updateProperties |
Read the property file and 'refresh' some properties of the TaskContext. | |
OperationCaller< bool(const std::string &name, const std::string &filename)> | readProperty |
Read a single property from a file. | |
OperationCaller< bool(const std::string &filename)> | writeProperties |
Write the property file with the properties of a TaskContext. | |
OperationCaller< bool(const std::string &filename)> | updateFile |
Write the property file with the properties of a TaskContext, which are already present in filename. | |
OperationCaller< bool(const std::string &name, const std::string &filename)> | writeProperty |
Write a single property to a file. | |
Protected Types | |
typedef std::map< std::string, ServiceRequester * > | Requests |
typedef std::map< std::string, base::OperationCallerBaseInvoker * > | OperationCallers |
Our methods. | |
Protected Attributes | |
Requests | mrequests |
the services we implement. | |
OperationCallers | mmethods |
std::string | mrname |
TaskContext * | mrowner |
Service::shared_ptr | mprovider |
Service requester to load and save properties of a TaskContext.
Definition at line 53 of file Marshalling.hpp.
bool RTT::ServiceRequester::connectTo | ( | Service::shared_ptr | sp | ) | [inherited] |
Connects this service's methods to the operations provided by op.
This method tries to match as many as possible method-operation pairs.
You may call this function with different instances of sp to 'resolve' missing functions, only the non-connected methods will be further filled in.
sp | An interface-compatible Service. |
Definition at line 92 of file ServiceRequester.cpp.
References RTT::base::TaskCore::engine(), and RTT::ServiceRequester::ready().
Referenced by RTT::TaskContext::connectServices().
Service::shared_ptr RTT::ServiceRequester::getReferencedService | ( | ) | [inherited] |
Returns the service we're referencing.
In case you used connectTo to more than one service, this returns the service which was used when connectTo first returned true.
bool RTT::ServiceRequester::ready | ( | ) | const [inherited] |
Returns true when all methods were resolved.
Definition at line 132 of file ServiceRequester.cpp.
Referenced by RTT::TaskContext::connectServices(), and RTT::ServiceRequester::connectTo().
bool RTT::ServiceRequester::requiresService | ( | const std::string & | service_name | ) | [inline, inherited] |
Query if this service requires certain sub-services.
service_name |
Definition at line 112 of file ServiceRequester.hpp.
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 71 of file Marshalling.hpp.
Referenced by Marshalling().
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.
filename | The file to read from. |
Definition at line 91 of file Marshalling.hpp.
Referenced by Marshalling().
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.
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 112 of file Marshalling.hpp.
Referenced by Marshalling().
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.
filename | The file to store to. |
Definition at line 81 of file Marshalling.hpp.
Referenced by Marshalling().
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.
filename | The file to read from and write to. |
Definition at line 133 of file Marshalling.hpp.
Referenced by Marshalling().
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.
filename | The file to read all the properties from. |
Definition at line 102 of file Marshalling.hpp.
Referenced by Marshalling().
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.
filename | The file to read from and write to (updating). |
Definition at line 122 of file Marshalling.hpp.
Referenced by Marshalling().
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.
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 143 of file Marshalling.hpp.
Referenced by Marshalling().