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_tcp_object.cpp
Go to the documentation of this file.
1 // =-=-=-=-=-=-=-
2 #include "irods_tcp_object.hpp"
4 
5 extern int ProcessType;
6 
7 namespace irods {
8 // =-=-=-=-=-=-=-
9 // public - ctor
11  network_object() {
12 
13  } // ctor
14 
15 // =-=-=-=-=-=-=-
16 // public - ctor
18  const rcComm_t& _comm ) :
19  network_object( _comm ) {
20 
21  } // ctor
22 
23 // =-=-=-=-=-=-=-
24 // public - ctor
26  const rsComm_t& _comm ) :
27  network_object( _comm ) {
28 
29  } // ctor
30 
31 // =-=-=-=-=-=-=-
32 // public - cctor
34  const tcp_object& _rhs ) :
35  network_object( _rhs ) {
36 
37  } // cctor
38 
39 // =-=-=-=-=-=-=-
40 // public - dtor
42 
43  } // dtor
44 
45 // =-=-=-=-=-=-=-
46 // public - assignment operator
48  const tcp_object& _rhs ) {
50 
51  return *this;
52 
53  } // operator=
54 
55 // =-=-=-=-=-=-=-
56 // public - assignment operator
58  const tcp_object& _rhs ) const {
59  return network_object::operator==( _rhs );
60 
61  } // operator=
62 
63 // =-=-=-=-=-=-=-
64 // public - resolver for tcp_manager
66  const std::string& _interface,
67  plugin_ptr& _ptr ) {
68  // =-=-=-=-=-=-=-
69  // check the interface type and error out if it
70  // isnt a network interface
71  if ( NETWORK_INTERFACE != _interface ) {
72  std::stringstream msg;
73  msg << "tcp_object does not support a [";
74  msg << _interface;
75  msg << "] plugin interface";
76  return ERROR( SYS_INVALID_INPUT_PARAM, msg.str() );
77 
78  }
79 
80  // =-=-=-=-=-=-=-
81  // ask the network manager for a tcp resource
82  network_ptr net_ptr;
83  error ret = netwk_mgr.resolve( TCP_NETWORK_PLUGIN, net_ptr );
84  if ( !ret.ok() ) {
85  // =-=-=-=-=-=-=-
86  // attempt to load the plugin, in this case the type,
87  // instance name, key etc are all tcp as there is only
88  // the need for one instance of a tcp object, etc.
89  std::string empty_context( "" );
95  empty_context,
96  net_ptr );
97  if ( !ret.ok() ) {
98  return PASS( ret );
99 
100  }
101  else {
102  // =-=-=-=-=-=-=-
103  // upcast for out variable
104  _ptr = boost::dynamic_pointer_cast< plugin_base >( net_ptr );
105  return SUCCESS();
106 
107  }
108 
109  } // if !ok
110 
111  // =-=-=-=-=-=-=-
112  // upcast for out variable
113  _ptr = boost::dynamic_pointer_cast< plugin_base >( net_ptr );
114  return SUCCESS();
115 
116  } // resolve
117 
118 // =-=-=-=-=-=-=-
119 // accessor for rule engine variables
121  rule_engine_vars_t& _kvp ) {
122  return network_object::get_re_vars( _kvp );
123 
124  } // get_re_vars
125 
126 }; // namespace irods
127 
128 
129 
irods::tcp_object
Definition: irods_tcp_object.hpp:14
irods::plugin_ptr
boost::shared_ptr< plugin_base > plugin_ptr
Definition: irods_first_class_object.hpp:18
rcComm_t
Definition: rcConnect.h:95
rsComm_t
Definition: rcConnect.h:145
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
irods::tcp_object::operator==
virtual bool operator==(const tcp_object &_rhs) const
Definition: irods_tcp_object.cpp:57
irods::NETWORK_INTERFACE
const std::string NETWORK_INTERFACE("irods_network_interface")
irods::netwk_mgr
network_manager netwk_mgr
Definition: irods_network_manager.cpp:8
irods::tcp_object::~tcp_object
virtual ~tcp_object()
Definition: irods_tcp_object.cpp:41
irods_network_manager.hpp
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
irods::network_manager::init_from_type
error init_from_type(const int &, const std::string &, const std::string &, const std::string &, const std::string &, network_ptr &)
Definition: irods_network_manager.cpp:83
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods
Definition: apiHandler.hpp:35
irods::network_ptr
boost::shared_ptr< network > network_ptr
Definition: irods_network_types.hpp:19
irods::network_object::operator=
virtual network_object & operator=(const network_object &)
Definition: irods_network_object.cpp:49
irods::tcp_object::operator=
virtual tcp_object & operator=(const tcp_object &)
Definition: irods_tcp_object.cpp:47
irods::tcp_object::get_re_vars
virtual error get_re_vars(rule_engine_vars_t &)
Definition: irods_tcp_object.cpp:120
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
irods::error
Definition: irods_error.hpp:23
irods::TCP_NETWORK_PLUGIN
const std::string TCP_NETWORK_PLUGIN("tcp")
irods::tcp_object::tcp_object
tcp_object()
Definition: irods_tcp_object.cpp:10
irods::network_object::operator==
virtual bool operator==(const network_object &_rhs) const
Definition: irods_network_object.cpp:58
irods::network_manager::resolve
error resolve(std::string, network_ptr &)
Definition: irods_network_manager.cpp:31
irods::tcp_object::resolve
virtual error resolve(const std::string &, plugin_ptr &)
Definition: irods_tcp_object.cpp:65
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
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
irods_tcp_object.hpp
irods::rule_engine_vars_t
std::map< std::string, std::string > rule_engine_vars_t
Definition: irods_first_class_object.hpp:20
ProcessType
int ProcessType
Definition: rcGlobal.cpp:16