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::connection_pool Class Reference

#include <connection_pool.hpp>

Collaboration diagram for irods::connection_pool:
[legend]

Classes

struct  connection_context
 
class  connection_proxy
 

Public Member Functions

 connection_pool (int _size, const std::string &_host, const int _port, const std::string &_username, const std::string &_zone, const int _refresh_time)
 
 connection_pool (const connection_pool &)=delete
 
connection_pooloperator= (const connection_pool &)=delete
 
connection_proxy get_connection ()
 

Private Types

using connection_pointer = std::unique_ptr< rcComm_t, int(*)(rcComm_t *)>
 

Private Member Functions

void create_connection (int _index, std::function< void()> _on_connect_error, std::function< void()> _on_login_error)
 
rcComm_trefresh_connection (int _index)
 
bool verify_connection (int _index)
 
void return_connection (int _index)
 
void release_connection (int _index)
 

Private Attributes

const std::string host_
 
const int port_
 
const std::string username_
 
const std::string zone_
 
const int refresh_time_
 
std::vector< connection_contextconn_ctxs_
 

Detailed Description

Definition at line 15 of file connection_pool.hpp.

Member Typedef Documentation

◆ connection_pointer

using irods::connection_pool::connection_pointer = std::unique_ptr<rcComm_t, int(*)(rcComm_t*)>
private

Definition at line 61 of file connection_pool.hpp.

Constructor & Destructor Documentation

◆ connection_pool() [1/2]

irods::connection_pool::connection_pool ( int  _size,
const std::string &  _host,
const int  _port,
const std::string &  _username,
const std::string &  _zone,
const int  _refresh_time 
)

Definition at line 77 of file connection_pool.cpp.

◆ connection_pool() [2/2]

irods::connection_pool::connection_pool ( const connection_pool )
delete

Member Function Documentation

◆ create_connection()

void irods::connection_pool::create_connection ( int  _index,
std::function< void()>  _on_connect_error,
std::function< void()>  _on_login_error 
)
private

Definition at line 136 of file connection_pool.cpp.

References clientLogin(), conn_ctxs_, host_, NO_RECONN, port_, rcConnect(), username_, and zone_.

Referenced by refresh_connection().

Here is the call graph for this function:

◆ get_connection()

connection_pool::connection_proxy irods::connection_pool::get_connection ( )

Definition at line 199 of file connection_pool.cpp.

References conn_ctxs_, irods.pypyodbc::lock, and refresh_connection().

Here is the call graph for this function:

◆ operator=()

connection_pool& irods::connection_pool::operator= ( const connection_pool )
delete

◆ refresh_connection()

rcComm_t * irods::connection_pool::refresh_connection ( int  _index)
private

Definition at line 180 of file connection_pool.cpp.

References conn_ctxs_, create_connection(), and verify_connection().

Referenced by get_connection().

Here is the call graph for this function:

◆ release_connection()

void irods::connection_pool::release_connection ( int  _index)
private

Definition at line 218 of file connection_pool.cpp.

References conn_ctxs_.

◆ return_connection()

void irods::connection_pool::return_connection ( int  _index)
private

◆ verify_connection()

bool irods::connection_pool::verify_connection ( int  _index)
private

Definition at line 159 of file connection_pool.cpp.

References conn_ctxs_, and refresh_time_.

Referenced by refresh_connection().

Member Data Documentation

◆ conn_ctxs_

std::vector<connection_context> irods::connection_pool::conn_ctxs_
private

◆ host_

const std::string irods::connection_pool::host_
private

Definition at line 85 of file connection_pool.hpp.

Referenced by create_connection().

◆ port_

const int irods::connection_pool::port_
private

Definition at line 86 of file connection_pool.hpp.

Referenced by create_connection().

◆ refresh_time_

const int irods::connection_pool::refresh_time_
private

Definition at line 89 of file connection_pool.hpp.

Referenced by verify_connection().

◆ username_

const std::string irods::connection_pool::username_
private

Definition at line 87 of file connection_pool.hpp.

Referenced by create_connection().

◆ zone_

const std::string irods::connection_pool::zone_
private

Definition at line 88 of file connection_pool.hpp.

Referenced by create_connection().


The documentation for this class was generated from the following files: