BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
XmlRpc::XmlRpcServerMethod Class Referenceabstract

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

#include <XmlRpcServerMethod.h>

+ Inheritance diagram for XmlRpc::XmlRpcServerMethod:

Public Member Functions

 XmlRpcServerMethod (std::string const &name, XmlRpcServer *server=0)
 Constructor.
 
virtual ~XmlRpcServerMethod ()
 Destructor.
 
std::string & name ()
 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 ()
 

Protected Attributes

std::string _name
 
XmlRpcServer_server
 

Detailed Description

Abstract class representing a single RPC method.

Definition at line 24 of file XmlRpcServerMethod.h.

Constructor & Destructor Documentation

◆ XmlRpcServerMethod()

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

Constructor.

Definition at line 8 of file XmlRpcServerMethod.cpp.

9 {
10 _name = name;
11 _server = server;
12 if (_server) _server->addMethod(this);
13 }
std::string & name()
Returns the name of the method.
void addMethod(XmlRpcServerMethod *method)
Add a command to the RPC server.

◆ ~XmlRpcServerMethod()

XmlRpc::XmlRpcServerMethod::~XmlRpcServerMethod ( )
virtual

Destructor.

Definition at line 15 of file XmlRpcServerMethod.cpp.

16 {
17 if (_server) _server->removeMethod(this);
18 }
void removeMethod(XmlRpcServerMethod *method)
Remove a command from the RPC server.

Member Function Documentation

◆ execute()

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

◆ help()

virtual std::string XmlRpc::XmlRpcServerMethod::help ( )
inlinevirtual

Returns a help string for the method. Subclasses should define this method if introspection is being used.

Reimplemented in ListMethods, MethodHelp, and Hello.

Definition at line 39 of file XmlRpcServerMethod.h.

39{ return std::string(); }

Referenced by MethodHelp::execute().

◆ name()

std::string & XmlRpc::XmlRpcServerMethod::name ( )
inline

Returns the name of the method.

Definition at line 32 of file XmlRpcServerMethod.h.

32{ return _name; }

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

Member Data Documentation

◆ _name

std::string XmlRpc::XmlRpcServerMethod::_name
protected

Definition at line 42 of file XmlRpcServerMethod.h.

Referenced by name(), and XmlRpcServerMethod().

◆ _server

XmlRpcServer* XmlRpc::XmlRpcServerMethod::_server
protected

Definition at line 43 of file XmlRpcServerMethod.h.

Referenced by XmlRpcServerMethod(), and ~XmlRpcServerMethod().


The documentation for this class was generated from the following files: