#include <ulxr_call.h>
Public Member Functions | |
MethodCall (const ulxr::Char *name) | |
Creates the method call. | |
MethodCall () | |
Creates an empty method call. | |
MethodCall (const CppString &name) | |
Creates the method call. | |
virtual | ~MethodCall () |
Destroys a method call. | |
virtual CppString | getSignature (bool braces=true) const |
Returns the signature of this call. | |
virtual std::string | getWbXml () const |
Returns the call as binary xml string. | |
virtual CppString | getXml (int indent=0) const |
Returns the call as xml string. | |
MethodCall & | addParam (const Value &val) |
Adds another parameter to this call. | |
MethodCall & | setParam (const Value &val) |
Sets the parameter to this call. | |
Value | getParam (unsigned ind) const |
Returns one of the parameters of this call. | |
unsigned | numParams () const |
Returns the number of parameters in the call. | |
void | clear () |
Removes all parameters from this call. | |
CppString | getMethodName () const |
Returns the method name. | |
void | setMethodName (const CppString &nm) |
Sets the method name. | |
Private Attributes | |
CppString | methodname |
std::vector< Value > | params |
This call provides access to the name and all parameters.
Definition at line 43 of file ulxr_call.h.
ulxr::MethodCall::MethodCall | ( | const ulxr::Char * | name | ) |
Creates the method call.
name | the name of the call |
Definition at line 47 of file ulxr_call.cpp.
References methodname.
ulxr::MethodCall::MethodCall | ( | ) |
ulxr::MethodCall::MethodCall | ( | const CppString & | name | ) |
Creates the method call.
name | the name of the call |
Definition at line 63 of file ulxr_call.cpp.
References methodname.
ulxr::MethodCall::~MethodCall | ( | ) | [virtual] |
CppString ulxr::MethodCall::getSignature | ( | bool | braces = true |
) | const [virtual] |
Returns the signature of this call.
The signature consists of all type names in this call delimited by commas. Elements of arrays are surrounded by braces. Structure elements and element pairs of structs are grouped by curly braces.
Example:
Array [int,double,string] Struct {{first,int},{second,double}}
braces | true: add methodname and surounding braces to signature string |
Definition at line 83 of file ulxr_call.cpp.
References ULXR_PCHAR.
Referenced by ulxr::Dispatcher::MethodCallDescriptor::MethodCallDescriptor().
std::string ulxr::MethodCall::getWbXml | ( | ) | const [virtual] |
Returns the call as binary xml string.
The method call is converted to a wbxml sequence. It is prepended with the necessary xml procession instruction with version and encoding set to UTF-8.
Definition at line 127 of file ulxr_call.cpp.
References ulxr::getWbXmlString(), ulxr::MethodCallParserWb::wbToken_MethodCall, ulxr::MethodCallParserWb::wbToken_MethodName, ulxr::MethodCallParserWb::wbToken_Param, ulxr::MethodCallParserWb::wbToken_Params, ulxr::WbXmlParser::wbxml_END, ulxr::WbXmlParser::wbxml_START_SEQ_LEN, and ulxr::WbXmlParser::wbxml_START_SEQ_STR.
CppString ulxr::MethodCall::getXml | ( | int | indent = 0 |
) | const [virtual] |
Returns the call as xml string.
The method call is converted to an xml text. It is prepended with the necessary xml procession instruction with version and encoding set to UTF-8. The structure of the text is indented to facilitate easy reading.
indent | current indentation level |
Definition at line 102 of file ulxr_call.cpp.
References ulxr::getXmlIndent(), ulxr::getXmlLinefeed(), and ULXR_PCHAR.
Referenced by ulxr::Dispatcher::waitForCall().
MethodCall & ulxr::MethodCall::addParam | ( | const Value & | val | ) |
Adds another parameter to this call.
val | the "value" of this parameter |
Definition at line 69 of file ulxr_call.cpp.
References params.
Referenced by setParam().
MethodCall & ulxr::MethodCall::setParam | ( | const Value & | val | ) |
Sets the parameter to this call.
The previous parameraters are removed.
val | the "value" of this parameter |
Definition at line 76 of file ulxr_call.cpp.
References addParam(), and clear().
Value ulxr::MethodCall::getParam | ( | unsigned | ind | ) | const |
Returns one of the parameters of this call.
ind | index of this value |
Definition at line 152 of file ulxr_call.cpp.
References ulxr::InvalidMethodParameterError, ulxr_i18n, and ULXR_PCHAR.
unsigned ulxr::MethodCall::numParams | ( | ) | const |
Returns the number of parameters in the call.
Definition at line 162 of file ulxr_call.cpp.
void ulxr::MethodCall::clear | ( | ) |
Removes all parameters from this call.
Definition at line 168 of file ulxr_call.cpp.
Referenced by setParam().
CppString ulxr::MethodCall::getMethodName | ( | ) | const |
Returns the method name.
Definition at line 174 of file ulxr_call.cpp.
Referenced by ulxr::Dispatcher::MethodCallDescriptor::MethodCallDescriptor(), ulxr::Requester::send_call(), and funtik::MultiProcessRpcServer::storeFuncResult().
void ulxr::MethodCall::setMethodName | ( | const CppString & | nm | ) |
CppString ulxr::MethodCall::methodname [private] |
std::vector<Value> ulxr::MethodCall::params [private] |