libepp_nicbr
PollRsp.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: PollRsp.H 1086 2010-12-10 13:07:28Z eduardo $ */
7 #ifndef __POLL_RSP_H__
8 #define __POLL_RSP_H__
9 
10 #include <string>
11 #include <map>
12 #include <memory>
13 
14 #include "libepp_nicbr.H"
15 
16 #include "Response.H"
17 #include "CommonData.H"
18 
19 using std::string;
20 using std::map;
21 using std::auto_ptr;
22 
23 LIBEPP_NICBR_NS_BEGIN
24 
26 class PollRsp : public Response
27 {
28 public:
29  struct MsgContent {
30  string value;
31  map< string, string, less<string> > attributes;
32  };
33 
35  PollRsp(bool reset = true) : Response(false)
36  {
37  if (reset) {
38  this->reset();
39  }
40  }
41 
43 
46  void set_count(const string &count) { _count = count; }
47 
49 
52  void set_id(const string &id) { _id = id; }
53 
55 
59  void set_qDate(const string &qDate) { _qDate = qDate; }
60 
62 
65  void set_lang(const string &lang) { _lang = lang; }
66 
68 
71  void set_text(const string &text) { _text = text; }
72 
74 
77  void set_content(const map< string, MsgContent, less<string> > &content)
78  {
79  _content = content;
80  }
81 
83 
87  void set_response(Response *resp, const ActionType type) {
88  _type = type;
89  _response = auto_ptr<Response>(resp);
90  }
91 
93 
96  string get_count() const { return _count; }
97 
99 
102  string get_id() const { return _id; }
103 
105 
108  string get_qDate() const { return _qDate; }
109 
111 
114  string get_lang() const { return _lang; }
115 
117 
120  string get_text() const { return _text; }
121 
123 
126  map< string, MsgContent, less<string> > get_content() const
127  {
128  return _content;
129  }
130 
132 
135  ActionType get_response_type() const { return _type; }
136 
138 
141  Response* get_response() { return _response.get(); }
142 
144  void reset() {
145  Response::reset();
146  _count = "";
147  _id = "";
148  _lang = "en";
149  _text = "";
150  _content.clear();
151  _response = auto_ptr<Response>(new Response());
152  _type = UNSET_ACTION;
153  }
154 
155 protected:
157  string _count;
158 
160  string _id;
161 
163  string _qDate;
164 
166  string _lang;
167 
169  string _text;
170 
172  map< string, MsgContent, less<string> > _content;
173 
176 
178  auto_ptr<Response> _response;
179 
180 };
181 
182 LIBEPP_NICBR_NS_END
183 #endif //__POLL_RSP_H__
PollRsp(bool reset=true)
Default constructor.
Definition: PollRsp.H:35
EPP Response Class.
Definition: Response.H:24
string _qDate
Date when the message entered in the queue.
Definition: PollRsp.H:163
string _count
Counter.
Definition: PollRsp.H:157
Project defines.
EPP CommonData Class.
void set_response(Response *resp, const ActionType type)
Sets the specific response inside the poll response.
Definition: PollRsp.H:87
string get_count() const
Returns the message count.
Definition: PollRsp.H:96
map< string, MsgContent, less< string > > _content
Message content.
Definition: PollRsp.H:172
string _id
Contact id.
Definition: PollRsp.H:160
string _lang
Language msg.
Definition: PollRsp.H:166
EPP Response Class.
auto_ptr< Response > _response
Response (resData element)
Definition: PollRsp.H:178
Response(bool reset=true)
Default constructor.
Definition: Response.H:78
void set_lang(const string &lang)
Sets the language of the message.
Definition: PollRsp.H:65
string get_text() const
Returns the message text.
Definition: PollRsp.H:120
string get_id() const
Returns the message id.
Definition: PollRsp.H:102
Response * get_response()
Returns the specific response inside the poll response.
Definition: PollRsp.H:141
void set_count(const string &count)
Sets the message count.
Definition: PollRsp.H:46
map< string, MsgContent, less< string > > get_content() const
Returns the msg content.
Definition: PollRsp.H:126
ActionType _type
Response type.
Definition: PollRsp.H:175
void set_text(const string &text)
Sets the message text.
Definition: PollRsp.H:71
ActionType
Action Types.
Definition: CommonData.H:23
Definition: PollRsp.H:29
string get_qDate() const
Returns the message date.
Definition: PollRsp.H:108
void set_id(const string &id)
Sets the message id.
Definition: PollRsp.H:52
void reset()
reset attributes
Definition: PollRsp.H:144
string _text
Text msg.
Definition: PollRsp.H:169
void set_qDate(const string &qDate)
Sets the message date.
Definition: PollRsp.H:59
void set_content(const map< string, MsgContent, less< string > > &content)
Sets the msg content.
Definition: PollRsp.H:77
void reset()
reset attributes
Definition: Response.H:161
string get_lang() const
Returns the message language.
Definition: PollRsp.H:114
EPP PollRsp Class.
Definition: PollRsp.H:26
ActionType get_response_type() const
Returns the response type of the specific response.
Definition: PollRsp.H:135