7 #include "xmlrpc-c/oldcppwrapper.hpp"
9 #include "DataType.hpp"
10 #include "XmlRpcFunction.hpp"
11 #include "XmlRpcClass.hpp"
14 //=========================================================================
16 //=========================================================================
17 // This class stores information about a proxy class, and knows how to
20 XmlRpcClass::XmlRpcClass (string class_name)
21 : mClassName(class_name)
25 XmlRpcClass::XmlRpcClass (const XmlRpcClass& c)
26 : mClassName(c.mClassName),
27 mFunctions(c.mFunctions)
31 XmlRpcClass& XmlRpcClass::operator= (const XmlRpcClass& c)
35 mClassName = c.mClassName;
36 mFunctions = c.mFunctions;
40 void XmlRpcClass::addFunction (const XmlRpcFunction& function)
42 mFunctions.push_back(function);
45 void XmlRpcClass::printDeclaration (ostream&)
47 cout << "class " << mClassName << " {" << endl;
48 cout << " XmlRpcClient mClient;" << endl;
50 cout << "public:" << endl;
51 cout << " " << mClassName << " (const XmlRpcClient& client)" << endl;
52 cout << " : mClient(client) {}" << endl;
53 cout << " " << mClassName << " (const string& server_url)" << endl;
54 cout << " : mClient(XmlRpcClient(server_url)) {}" << endl;
55 cout << " " << mClassName << " (const " << mClassName << "& o)" << endl;
56 cout << " : mClient(o.mClient) {}" << endl;
58 cout << " " << mClassName << "& operator= (const "
59 << mClassName << "& o) {" << endl;
60 cout << " if (this != &o) mClient = o.mClient;" << endl;
61 cout << " return *this;" << endl;
64 vector<XmlRpcFunction>::iterator f;
65 for (f = mFunctions.begin(); f < mFunctions.end(); ++f) {
66 f->printDeclarations(cout);
72 void XmlRpcClass::printDefinition (ostream&)
74 vector<XmlRpcFunction>::iterator f;
75 for (f = mFunctions.begin(); f < mFunctions.end(); ++f) {
76 f->printDefinitions(cout, mClassName);