Line data Source code
1 : #pragma once
2 :
3 : #include <string>
4 : #include <set>
5 : #include <map>
6 : #include <memory>
7 : #include <functional>
8 :
9 : namespace demo{
10 :
11 : namespace request
12 : {
13 0 : struct multiget
14 : {
15 : std::set<std::string> keys;
16 : typedef std::unique_ptr<multiget> ptr;
17 :
18 0 : static multiget create_schema()
19 : {
20 0 : multiget sch;
21 0 : sch.keys.insert("key1");
22 0 : sch.keys.insert("key2");
23 0 : sch.keys.insert("key3");
24 0 : return sch;
25 : }
26 : };
27 : }
28 :
29 : namespace response
30 : {
31 0 : struct multiget
32 : {
33 : typedef std::map<std::string, std::shared_ptr<std::string> > map_type;
34 : map_type values;
35 : typedef std::unique_ptr<multiget> ptr;
36 : typedef std::function< void(ptr)> handler;
37 :
38 0 : static multiget create_schema()
39 : {
40 0 : multiget sch;
41 0 : sch.values["key1"]=std::make_shared<std::string>("value1");
42 0 : sch.values["key2"]=std::make_shared<std::string>("value2");
43 0 : sch.values["key3"]=std::make_shared<std::string>("value3");
44 0 : return sch;
45 : }
46 : };
47 : }
48 :
49 : }
|