libepp_nicbr
Login.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: Login.H 1086 2010-12-10 13:07:28Z eduardo $ */
7 #ifndef __LOGIN_H__
8 #define __LOGIN_H__
9 
10 #include <memory>
11 
12 #include "libepp_nicbr.H"
13 
14 #include "Action.H"
15 #include "LoginCmd.H"
16 #include "Response.H"
17 
18 using std::auto_ptr;
19 
20 LIBEPP_NICBR_NS_BEGIN
21 
23 class Login : public Action
24 {
25 public:
26 
28  Login(const ActionType type = LOGIN) : Action(type)
29  {
30  if (type == LOGIN) {
31  _command = auto_ptr<LoginCmd>(new LoginCmd());
32  _response = auto_ptr<Response>(new Response());
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_login_rsp(xml_payload, _response.get());
51  }
52 
54 
57  LoginCmd* get_command() { return (LoginCmd*) _command.get(); }
58 
59 };
60 
61 LIBEPP_NICBR_NS_END
62 #endif //__LOGIN_H__
LoginCmd * get_command()
Returns raw pointer to the command.
Definition: Login.H:57
void parse_login_rsp(const string &xml_payload, Response *rsp)
Parse the response to a login command.
EPP Response Class.
Definition: Response.H:24
Project defines.
Login(const ActionType type=LOGIN)
Constructor.
Definition: Login.H:28
EPP LoginCmd Class.
Definition: LoginCmd.H:17
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
Response * get_response()
Returns raw pointer to the response.
Definition: Action.H:60
void set_response(const string &xml_payload, DomParser *parser)
Sets the response attribute.
Definition: Login.H:47
EPP Login Class.
Definition: Login.H:23
auto_ptr< Command > _command
Generic command.
Definition: Action.H:76
ActionType
Action Types.
Definition: CommonData.H:23
void set_xml_template(const string &xml_template)
Sets the xml template and parses the tags.
EPP LoginCmd Class.
void reset()
reset attributes
Definition: Response.H:161