Created
August 31, 2011 03:03
-
-
Save denysonique/1182726 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sum : public XmlRpcServerMethod | |
{ | |
public: | |
Sum(XmlRpcServer* s) : XmlRpcServerMethod("Sum", s) {} | |
void execute(XmlRpcValue& params, XmlRpcValue& result) | |
{ | |
int nArgs = params.size(); | |
double sum = 0.0; | |
for (int i=0; i<nArgs; ++i) | |
sum += double(params[i]); | |
result = sum; | |
} | |
} sum(&s); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment