commore  1.0.6-SNAPSHOT
All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Sender.h
1 //
2 // Copyright (c) 2006-2014 Raphael David / CANTOR
3 //
4 
5 #ifndef CMR_SENDER_INCLUDED
6 #define CMR_SENDER_INCLUDED
7 
8 #include "Commore.h"
9 #include "AutoRef.h"
10 
11 namespace commore
12 {
16  const int ERR_CONNECTION_CLOSED = -400;
17  const int ERR_NO_CONNECTION = -401;
18  const int ERR_BAD_FORMAT = -402;
19  const int ERR_COMM_TIMEOUT = -403;
20 }
21 
22 
23 namespace commore
24 {
41  class CMREXD Sender : public RefObject
42  {
43  protected:
44  AString address_;
45  public:
46  Sender();
47  virtual ~Sender();
48 
52  const AString& get_address() const { return address_; }
53 
54  public:
60  virtual bool is_ok();
61 
65  virtual bool is_connected();
66 
67  //PF 20081210 done in ProxyService
68  // //
69  // // Check the connection (force a dummy request)
70  // //
71  // virtual bool check_connection();
72 
73 
77  virtual int call(const Tuple& in_req, Tuple& out_req);
78 
82  virtual void set_param(const Tuple& param);
83  virtual Tuple& get_param(Tuple& param);
84 
85  public:
86  static const AChar* factory_name()
87  {
88  return "commore::Sender";
89  }
90  };
91  typedef IAutoRef<Sender> PSender;
92 }
93 
94 #endif
Definition: Tuple.h:29
const int ERR_CONNECTION_CLOSED
Definition: Sender.h:16
Definition: AString.h:39
Definition: Sender.h:41
const AString & get_address() const
Definition: Sender.h:52
Definition: RefObject.h:89