BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
CountTheEntities Class Reference
+ Inheritance diagram for CountTheEntities:

Public Member Functions

 CountTheEntities (XmlRpcServer *s)
 
void execute (XmlRpcValue &params, XmlRpcValue &result)
 Execute the method. Subclasses must provide a definition for this method.
 
- Public Member Functions inherited from XmlRpc::XmlRpcServerMethod
 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 ()
 

Additional Inherited Members

- Protected Attributes inherited from XmlRpc::XmlRpcServerMethod
std::string _name
 
XmlRpcServer_server
 

Detailed Description

Definition at line 39 of file Validator.cpp.

Constructor & Destructor Documentation

◆ CountTheEntities()

CountTheEntities::CountTheEntities ( XmlRpcServer s)
inline

Definition at line 42 of file Validator.cpp.

42: XmlRpcServerMethod("validator1.countTheEntities", s) {}
XmlRpcServer s
Definition: Validator.cpp:9
Abstract class representing a single RPC method.

Member Function Documentation

◆ execute()

void CountTheEntities::execute ( XmlRpcValue params,
XmlRpcValue result 
)
inlinevirtual

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

Implements XmlRpc::XmlRpcServerMethod.

Definition at line 44 of file Validator.cpp.

45 {
46 std::cerr << "CountTheEntities\n";
47 std::string& arg = params[0];
48 int ctLeftAngleBrackets = 0;
49 int ctRightAngleBrackets = 0;
50 int ctAmpersands = 0;
51 int ctApostrophes = 0;
52 int ctQuotes = 0;
53
54 int n = int(arg.length());
55 for (int i=0; i<n; ++i)
56 switch (arg[i])
57 {
58 case '<': ++ctLeftAngleBrackets; break;
59 case '>': ++ctRightAngleBrackets; break;
60 case '&': ++ctAmpersands; break;
61 case '\'': ++ctApostrophes; break;
62 case '\"': ++ctQuotes; break;
63 }
64
65 result["ctLeftAngleBrackets"] = ctLeftAngleBrackets;
66 result["ctRightAngleBrackets"] = ctRightAngleBrackets;
67 result["ctAmpersands"] = ctAmpersands;
68 result["ctApostrophes"] = ctApostrophes;
69 result["ctQuotes"] = ctQuotes;
70 }
const Int_t n
double arg(const EvtComplex &c)
Definition: EvtComplex.hh:227

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