libepp_nicbr
Logout.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: Logout.H 1086 2010-12-10 13:07:28Z eduardo $ */
7 #ifndef __LOGOUT_H__
8 #define __LOGOUT_H__
9 
10 #include <memory>
11 
12 #include "libepp_nicbr.H"
13 
14 #include "Action.H"
15 #include "Command.H"
16 #include "Response.H"
17 
18 using std::auto_ptr;
19 
20 LIBEPP_NICBR_NS_BEGIN
21 
23 class Logout : public Action
24 {
25 public:
26 
28  Logout(const ActionType type = LOGOUT) : Action(type)
29  {
30  if (type == LOGOUT) {
31  _response = auto_ptr<Response>(new Response());
32  _command = auto_ptr<Command>(new Command());
33  }
34  }
35 
37 
41  void set_response(const string &xml_payload, DomParser *parser)
42  {
43  get_response()->reset();
44  parser->parse_logout_rsp(xml_payload, _response.get());
45  }
46 
48 
51  void set_xml_template(const string &xml_template)
52  {
53  Action::set_xml_template_common(xml_template);
54  }
55 
56 };
57 
58 LIBEPP_NICBR_NS_END
59 #endif //__LOGOUT_H__
EPP Response Class.
Definition: Response.H:24
Logout(const ActionType type=LOGOUT)
Null constructor.
Definition: Logout.H:28
Project defines.
void set_xml_template(const string &xml_template)
Sets the xml template and parses the tags (pure virtual)
Definition: Logout.H:51
EPP Response Class.
EPP Action Class.
EPP DomParser Class.
Definition: DomParser.H:62
EPP Action Class.
Definition: Action.H:24
auto_ptr< Response > _response
Generic response.
Definition: Action.H:79
void parse_logout_rsp(const string &xml_payload, Response *rsp)
Parse the response to a logout command.
Response * get_response()
Returns raw pointer to the response.
Definition: Action.H:60
auto_ptr< Command > _command
Generic command.
Definition: Action.H:76
ActionType
Action Types.
Definition: CommonData.H:23
EPP Command Class.
Definition: Command.H:18
EPP Command Class.
void reset()
reset attributes
Definition: Response.H:161
void set_response(const string &xml_payload, DomParser *parser)
Pure virtual method to set response from a XML document.
Definition: Logout.H:41
EPP Logout Class.
Definition: Logout.H:23
void set_xml_template_common(const string &xml_template)
Sets the xml template and parses the tags (protected)
Definition: Action.H:97