XmlRpc::XmlRpcServerMethod Class Reference

Abstract class representing a single RPC method. More...

#include <XmlRpcServerMethod.h>

Inheritance diagram for XmlRpc::XmlRpcServerMethod:
DumpDht Get JoinOverlay ListMethods LocalLookup Lookup MethodHelp P2pnsRegister P2pnsResolve Put

List of all members.

Public Member Functions

 XmlRpcServerMethod (std::string const &name, XmlRpcServer *server=0)
 Constructor.
virtual ~XmlRpcServerMethod ()
 Destructor.
std::string & getName ()
 Returns the name of the method.
virtual void execute (XmlRpcValue &params, XmlRpcValue &result)=0
 Execute the method. Subclasses must provide a definition for this method.
virtual std::string help ()
 Returns a help string for the method.

Protected Attributes

std::string _name
XmlRpcServer_server

Detailed Description

Abstract class representing a single RPC method.

Definition at line 30 of file XmlRpcServerMethod.h.


Constructor & Destructor Documentation

XmlRpc::XmlRpcServerMethod::XmlRpcServerMethod ( std::string const &  name,
XmlRpcServer server = 0 
)

Constructor.

Definition at line 13 of file XmlRpcServerMethod.cc.

00014   {
00015     _name = name;
00016     _server = server;
00017     if (_server) _server->addMethod(this);
00018   }

XmlRpc::XmlRpcServerMethod::~XmlRpcServerMethod (  )  [virtual]

Destructor.

Definition at line 20 of file XmlRpcServerMethod.cc.

00021   {
00022     if (_server) _server->removeMethod(this);
00023   }


Member Function Documentation

virtual void XmlRpc::XmlRpcServerMethod::execute ( XmlRpcValue params,
XmlRpcValue result 
) [pure virtual]

Execute the method. Subclasses must provide a definition for this method.

Implemented in ListMethods, MethodHelp, P2pnsRegister, P2pnsResolve, LocalLookup, Lookup, Put, Get, DumpDht, and JoinOverlay.

Referenced by XmlRpc::XmlRpcServer::executeMethod().

std::string& XmlRpc::XmlRpcServerMethod::getName (  )  [inline]

Returns the name of the method.

Definition at line 38 of file XmlRpcServerMethod.h.

Referenced by XmlRpc::XmlRpcServer::addMethod(), and XmlRpc::XmlRpcServer::removeMethod().

00038 { return _name; }

virtual std::string XmlRpc::XmlRpcServerMethod::help (  )  [inline, virtual]

Returns a help string for the method.

Subclasses should define this method if introspection is being used.

Reimplemented in ListMethods, MethodHelp, P2pnsRegister, P2pnsResolve, LocalLookup, Lookup, Put, Get, DumpDht, and JoinOverlay.

Definition at line 45 of file XmlRpcServerMethod.h.

Referenced by MethodHelp::execute().

00045 { return std::string(); }


Member Data Documentation

std::string XmlRpc::XmlRpcServerMethod::_name [protected]

Definition at line 48 of file XmlRpcServerMethod.h.

Referenced by getName(), and XmlRpcServerMethod().


The documentation for this class was generated from the following files:
Generated on Wed May 26 16:21:20 2010 for OverSim by  doxygen 1.6.3