libepp_nicbr
Poll.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: Poll.H 1086 2010-12-10 13:07:28Z eduardo $ */
7 #ifndef __POLL_H__
8 #define __POLL_H__
9 
10 #include <memory>
11 
12 #include "libepp_nicbr.H"
13 
14 #include "Action.H"
15 #include "PollCmd.H"
16 #include "PollRsp.H"
17 
18 using std::auto_ptr;
19 
20 LIBEPP_NICBR_NS_BEGIN
21 
23 class Poll : public Action
24 {
25 public:
26 
28  Poll(const ActionType type = POLL) : Action(type)
29  {
30  if (type == POLL) {
31  _command = auto_ptr<PollCmd>(new PollCmd());
32  _response = auto_ptr<PollRsp>(new PollRsp());
33  }
34  }
35 
37 
40  void set_xml_template(const string &xml_template);
41 
43 
47  void set_response(const string &xml_payload, DomParser *parser)
48  {
49  get_response()->reset();
50  parser->parse_poll_rsp(xml_payload, get_response());
51  }
52 
54 
57  PollCmd* get_command() { return (PollCmd*) _command.get(); }
58 
60 
63  PollRsp* get_response() { return (PollRsp*) _response.get(); }
64 
65 };
66 
67 LIBEPP_NICBR_NS_END
68 #endif //__POLL_H__
EPP PollCmd Class.
Definition: PollCmd.H:21
PollCmd * get_command()
Returns raw pointer to the command.
Definition: Poll.H:57
Project defines.
void set_response(const string &xml_payload, DomParser *parser)
Sets the response attribute.
Definition: Poll.H:47
void set_xml_template(const string &xml_template)
Sets XML template.
EPP PollRsp Class.
EPP PollCmd Class.
EPP Action Class.
void parse_poll_rsp(const string &xml_payload, PollRsp *rsp)
Parse the response to a poll command.
EPP DomParser Class.
Definition: DomParser.H:62
EPP Action Class.
Definition: Action.H:24
auto_ptr< Response > _response
Generic response.
Definition: Action.H:79
PollRsp * get_response()
Returns raw pointer to the response.
Definition: Poll.H:63
auto_ptr< Command > _command
Generic command.
Definition: Action.H:76
ActionType
Action Types.
Definition: CommonData.H:23
EPP Poll Class.
Definition: Poll.H:23
void reset()
reset attributes
Definition: PollRsp.H:144
Poll(const ActionType type=POLL)
Constructor.
Definition: Poll.H:28
EPP PollRsp Class.
Definition: PollRsp.H:26