ulxr::MethodCall Class Reference
[XML-RPC handling]

Abstraction of a MethodCall on a remote server. More...

#include <ulxr_call.h>

List of all members.

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.
MethodCalladdParam (const Value &val)
 Adds another parameter to this call.
MethodCallsetParam (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< Valueparams


Detailed Description

Abstraction of a MethodCall on a remote server.

This call provides access to the name and all parameters.

Definition at line 43 of file ulxr_call.h.


Constructor & Destructor Documentation

ulxr::MethodCall::MethodCall ( const ulxr::Char name  ) 

Creates the method call.

Parameters:
name the name of the call

Definition at line 47 of file ulxr_call.cpp.

References methodname.

ulxr::MethodCall::MethodCall (  ) 

Creates an empty method call.

Definition at line 53 of file ulxr_call.cpp.

ulxr::MethodCall::MethodCall ( const CppString name  ) 

Creates the method call.

Parameters:
name the name of the call

Definition at line 63 of file ulxr_call.cpp.

References methodname.

ulxr::MethodCall::~MethodCall (  )  [virtual]

Destroys a method call.

Definition at line 58 of file ulxr_call.cpp.


Member Function Documentation

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}}
 

Parameters:
braces true: add methodname and surounding braces to signature string
Returns:
The signature

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.

Returns:
The wbxml content

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.

Parameters:
indent current indentation level
Returns:
The xml content

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.

Parameters:
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.

Parameters:
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.

Parameters:
ind index of this value
Returns:
the value of this parameter

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.

Returns:
the number of parameters

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.

Returns:
the 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  ) 

Sets the method name.

Parameters:
nm the method name

Definition at line 180 of file ulxr_call.cpp.


Member Data Documentation

CppString ulxr::MethodCall::methodname [private]

Definition at line 137 of file ulxr_call.h.

Referenced by MethodCall().

std::vector<Value> ulxr::MethodCall::params [private]

Definition at line 138 of file ulxr_call.h.

Referenced by addParam().


The documentation for this class was generated from the following files:
Generated on Sun Aug 19 20:09:01 2007 for ulxmlrpcpp by  doxygen 1.5.1