libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol > Class Template Reference

A class that wraps a link to an exchange. More...

#include <connection.hpp>

Public Types

using msg_details_t = MsgDetails
 A type containing the details of the messages that will be sent to and received from the exchange. More...
 
using conn_pol_t = ConnPol
 The connection policy that should be used to connect to the specified exchange. More...
 
using ctor_args = conn_pol_t
 
using skt_mgr_t = socket_type::skt_mgr_t
 
using socket_t = skt_mgr_t::socket_t
 
using socket_priority = skt_mgr_t::socket_priority
 

Public Member Functions

 connection (conn_pol_t const &conn_pol, skt_mgr_t::socket_priority priority, std::size_t incoming_cpu)
 Connect to the exchange using the connection policy specified. More...
 
template<class Msg >
std::enable_if< !std::is_same< typename boost::mpl::find< typename msg_details_t::client_to_exchange_messages_t, Msg >::type, typename boost::mpl::end< typename msg_details_t::client_to_exchange_messages_t >::type >::value, void >::type send (Msg const &msg)
 Send a message to the specified, connected, exchange. More...
 
template<class Msg >
std::enable_if< !std::is_same< typename boost::mpl::find< typename msg_details_t::exchange_to_client_messages_t, Msg >::type, typename boost::mpl::end< typename msg_details_t::exchange_to_client_messages_t >::type >::value, void >::type receive (Msg &msg)
 Receive a message from the specified, connected, exchange. More...
 
void stop ()
 
skt_mgr_t::socket_t & socket () noexcept(true)
 
std::string to_string () const noexcept(false)
 

Public Attributes

const conn_pol_t conn_pol_
 

Detailed Description

template<class MsgDetails, class ConnPol>
class isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >

A class that wraps a link to an exchange.

Definition at line 33 of file connection.hpp.

Member Typedef Documentation

◆ conn_pol_t

template<class MsgDetails , class ConnPol >
using isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::conn_pol_t = ConnPol

The connection policy that should be used to connect to the specified exchange.

Definition at line 38 of file connection.hpp.

◆ ctor_args

template<class MsgDetails , class ConnPol >
using isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::ctor_args = conn_pol_t

Definition at line 39 of file connection.hpp.

◆ msg_details_t

template<class MsgDetails , class ConnPol >
using isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::msg_details_t = MsgDetails

A type containing the details of the messages that will be sent to and received from the exchange.

Definition at line 36 of file connection.hpp.

◆ skt_mgr_t

template<class MsgDetails , class ConnPol >
using isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::skt_mgr_t = socket_type::skt_mgr_t

Definition at line 40 of file connection.hpp.

◆ socket_priority

template<class MsgDetails , class ConnPol >
using isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::socket_priority = skt_mgr_t::socket_priority

Definition at line 42 of file connection.hpp.

◆ socket_t

template<class MsgDetails , class ConnPol >
using isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::socket_t = skt_mgr_t::socket_t

Definition at line 41 of file connection.hpp.

Constructor & Destructor Documentation

◆ connection()

template<class MsgDetails , class ConnPol >
isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::connection ( conn_pol_t const &  conn_pol,
skt_mgr_t::socket_priority  priority,
std::size_t  incoming_cpu 
)
inline

Connect to the exchange using the connection policy specified.

Parameters
conn_polThe specified connection policy, that includes details of the exchange to which the link should be made.

Definition at line 22 of file connection_impl.hpp.

References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::conn_pol_, and isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::connection().

Referenced by isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::connection().

Member Function Documentation

◆ receive()

template<class MsgDetails , class ConnPol >
template<class Msg >
std::enable_if< !std::is_same< typename boost::mpl::find< typename MsgDetails::exchange_to_client_messages_t, Msg >::type, typename boost::mpl::end< typename MsgDetails::exchange_to_client_messages_t >::type >::value, void >::type isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::receive ( Msg &  msg)
inline

Receive a message from the specified, connected, exchange.

Parameters
msgThe particular type of client-side message to receive from the connected exchange. We must know the message that should be received, as specified by the protocol.

Definition at line 48 of file connection_impl.hpp.

◆ send()

template<class MsgDetails , class ConnPol >
template<class Msg >
std::enable_if< !std::is_same< typename boost::mpl::find< typename MsgDetails::client_to_exchange_messages_t, Msg >::type, typename boost::mpl::end< typename MsgDetails::client_to_exchange_messages_t >::type >::value, void >::type isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::send ( Msg const &  msg)
inline

Send a message to the specified, connected, exchange.

Parameters
msgThe client-side message to send to the connected exchange.

Definition at line 35 of file connection_impl.hpp.

◆ socket()

template<class MsgDetails , class ConnPol >
skt_mgr_t::socket_t& isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::socket ( )
inlinenoexcept

Definition at line 84 of file connection.hpp.

◆ stop()

template<class MsgDetails , class ConnPol >
void isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::stop
inline

Definition at line 53 of file connection_impl.hpp.

◆ to_string()

template<class MsgDetails , class ConnPol >
std::string isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::to_string
inlinenoexcept

Definition at line 58 of file connection_impl.hpp.

Member Data Documentation

◆ conn_pol_

template<class MsgDetails , class ConnPol >
const conn_pol_t isimud::ISIMUD_VER_NAMESPACE::exchanges::common::connection< MsgDetails, ConnPol >::conn_pol_

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