22 std::cerr <<
"ArrayOfStructsTest\n";
24 int n = arg1.
size(), sum = 0;
25 for (
int i=0; i<
n; ++i)
26 sum +=
int(arg1[i][
"curly"]);
30} arrayOfStructsTest(&
s);
46 std::cerr <<
"CountTheEntities\n";
47 std::string&
arg = params[0];
48 int ctLeftAngleBrackets = 0;
49 int ctRightAngleBrackets = 0;
51 int ctApostrophes = 0;
54 int n = int(
arg.length());
55 for (
int i=0; i<
n; ++i)
58 case '<': ++ctLeftAngleBrackets;
break;
59 case '>': ++ctRightAngleBrackets;
break;
60 case '&': ++ctAmpersands;
break;
61 case '\'': ++ctApostrophes;
break;
62 case '\"': ++ctQuotes;
break;
65 result[
"ctLeftAngleBrackets"] = ctLeftAngleBrackets;
66 result[
"ctRightAngleBrackets"] = ctRightAngleBrackets;
67 result[
"ctAmpersands"] = ctAmpersands;
68 result[
"ctApostrophes"] = ctApostrophes;
69 result[
"ctQuotes"] = ctQuotes;
71} countTheEntities(&
s);
86 std::cerr <<
"EasyStructTest\n";
88 int sum = int(arg1[
"moe"]) + int(arg1[
"larry"]) + int(arg1[
"curly"]);
103 std::cerr <<
"EchoStructTest\n";
119 std::cerr <<
"ManyTypesTest\n";
138 std::cerr <<
"ModerateSizeArrayCheck\n";
139 std::string
s = params[0][0];
140 s += params[0][params[0].
size()-1];
143} moderateSizeArrayCheck(&
s);
160 std::cerr <<
"NestedStructTest\n";
161 XmlRpcValue& dayStruct = params[0][
"2000"][
"04"][
"01"];
162 int sum = int(dayStruct[
"moe"]) + int(dayStruct[
"larry"]) + int(dayStruct[
"curly"]);
165} nestedStructTest(&
s);
179 std::cerr <<
"SimpleStructReturnTest\n";
181 result[
"times10"] =
n * 10;
182 result[
"times100"] =
n * 100;
183 result[
"times1000"] =
n * 1000;
185} simpleStructReturnTest(&
s);
189int main(
int argc,
char* argv[])
192 std::cerr <<
"Usage: Validator port\n";
195 int port = atoi(argv[1]);
double arg(const EvtComplex &c)
ArrayOfStructsTest(XmlRpcServer *s)
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
CountTheEntities(XmlRpcServer *s)
EasyStructTest(XmlRpcServer *s)
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
EchoStructTest(XmlRpcServer *s)
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
ManyTypesTest(XmlRpcServer *s)
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
ModerateSizeArrayCheck(XmlRpcServer *s)
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
NestedStructTest(XmlRpcServer *s)
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
SimpleStructReturnTest(XmlRpcServer *s)
Abstract class representing a single RPC method.
A class to handle XML RPC requests.
bool bindAndListen(int port, int backlog=5)
void work(double msTime)
Process client requests for the specified time.
RPC method arguments and results are represented by Values.
int size() const
Return the size for string, base64, array, and struct values.
void setVerbosity(int level)
Sets log message verbosity. This is short for XmlRpcLogHandler::setVerbosity(level)