irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_network_object.cpp
Go to the documentation of this file.
1 // =-=-=-=-=-=-=-
4 
5 #include "rodsKeyWdDef.h"
6 #include "rcMisc.h"
7 
8 namespace irods {
9 
10 // =-=-=-=-=-=-=-
11 // public - ctor
13  socket_handle_( 0 ) {
14 
15  } // ctor
16 
17 // =-=-=-=-=-=-=-
18 // public - ctor
20  const rcComm_t& _comm ) :
21  socket_handle_( _comm.sock ) {
22 
23  } // ctor
24 
25 // =-=-=-=-=-=-=-
26 // public - ctor
28  const rsComm_t& _comm ) :
29  socket_handle_( _comm.sock ) {
30 
31  } // ctor
32 
33 // =-=-=-=-=-=-=-
34 // public - cctor
36  const network_object& _rhs ) :
37  first_class_object( _rhs ) {
39 
40  } // cctor
41 
42 // =-=-=-=-=-=-=-
43 // public - dtor
45  } // dtor
46 
47 // =-=-=-=-=-=-=-
48 // public - assignment operator
50  const network_object& _rhs ) {
52  return *this;
53 
54  } // operator=
55 
56 // =-=-=-=-=-=-=-
57 // public - equivalence operator
59  const network_object& _rhs ) const {
60  return socket_handle_ == _rhs.socket_handle_;
61 
62  } // operator==
63 
64 // =-=-=-=-=-=-=-
65 // public - get rule engine kvp
67  rule_engine_vars_t& _kvp ) {
68 
69  std::stringstream ss;
70  ss << socket_handle_;
71  _kvp[SOCKET_HANDLE_KW] = ss.str().c_str();
72 
73  return SUCCESS();
74  } // get_re_vars
75 
76 // =-=-=-=-=-=-=-
77 // convertion to client comm ptr
79  if ( !_comm ) {
80  return ERROR( SYS_INVALID_INPUT_PARAM, "null comm ptr" );
81  }
82 
83  _comm->sock = socket_handle_;
84 
85  return SUCCESS();
86 
87  } // to_client
88 
89 // =-=-=-=-=-=-=-
90 // convertion to client comm ptr
92  if ( !_comm ) {
93  return ERROR( SYS_INVALID_INPUT_PARAM, "null comm ptr" );
94  }
95 
96  _comm->sock = socket_handle_;
97 
98  return SUCCESS();
99 
100  } // to_server
101 
102 
103 }; // namespace irods
104 
105 
106 
rodsKeyWdDef.h
rcComm_t
Definition: rcConnect.h:95
rsComm_t
Definition: rcConnect.h:145
irods::network_object::socket_handle_
int socket_handle_
Definition: irods_network_object.hpp:72
irods_network_object.hpp
rcMisc.h
irods_network_manager.hpp
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods::network_object::network_object
network_object()
Definition: irods_network_object.cpp:12
irods
Definition: apiHandler.hpp:35
irods::network_object::operator=
virtual network_object & operator=(const network_object &)
Definition: irods_network_object.cpp:49
irods::network_object::~network_object
virtual ~network_object()
Definition: irods_network_object.cpp:44
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
irods::error
Definition: irods_error.hpp:23
irods::network_object::to_server
virtual error to_server(rsComm_t *)
Definition: irods_network_object.cpp:91
irods::first_class_object
Definition: irods_first_class_object.hpp:23
irods::network_object::operator==
virtual bool operator==(const network_object &_rhs) const
Definition: irods_network_object.cpp:58
irods::network_object
Definition: irods_network_object.hpp:18
irods::network_object::get_re_vars
virtual error get_re_vars(rule_engine_vars_t &)
Definition: irods_network_object.cpp:66
SOCKET_HANDLE_KW
#define SOCKET_HANDLE_KW
Definition: rodsKeyWdDef.h:234
rsComm_t::sock
int sock
Definition: rcConnect.h:147
irods::rule_engine_vars_t
std::map< std::string, std::string > rule_engine_vars_t
Definition: irods_first_class_object.hpp:20
rcComm_t::sock
int sock
Definition: rcConnect.h:98
irods::network_object::to_client
virtual error to_client(rcComm_t *)
Definition: irods_network_object.cpp:78