Samchon Framework for CPP  1.0.0
invoke.hpp
1 #pragma once
2 
3 #include <iostream>
4 #include <samchon/protocol/Invoke.hpp>
5 
6 namespace samchon
7 {
8 namespace examples
9 {
10 namespace invoke
11 {
12  void main()
13  {
14  using namespace std;
15  using namespace samchon::library;
16  using namespace samchon::protocol;
17 
18  string str = string("") +
19  "<memberList>\n" +
20  " <member id='jhnam88' pass='1231' />\n" +
21  " <member id='samchon' pass='1231'>Administrator</member>\n" +
22  " <group>3</group>\n" +
23  "</memberList>";
24 
25  shared_ptr<XML> xml(new XML(str));
26  cout << xml->toString() << endl;
27 
28  shared_ptr<Invoke> invoke(new Invoke("login", "jhnam88", "1231", 4, xml));
29 
30  cout << "Invoke to XML: " << endl;
31  cout << invoke->toXML()->toString() << endl << endl;
32 
33  cout << "-------------------------------------------------------------" << endl;
34  cout << " Parameters" << endl;
35  cout << "-------------------------------------------------------------" << endl;
36  cout << "1st param: " << invoke->at(0)->getValue<string>() << endl;
37  cout << "2nd param: " << invoke->at(1)->getValue<string>() << endl;
38  cout << "3rd param: " << invoke->at(2)->getValue<string>() << endl;
39  cout << "4th param: " << endl << invoke->at(3)->getValue<shared_ptr<XML>>()->toString() << endl;
40 
41  cout << shared_ptr<XML>(new XML(invoke->toXML()->toString()))->toString() << endl;
42  };
43 };
44 };
45 };
Standard message of network I/O.
Definition: Invoke.hpp:35