libjmmcg  build_2783
A C++ library containing an eclectic mix of useful, advanced components.
isimud::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
 

Public Member Functions

 connection (conn_pol_t const &conn_pol, socket_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_tsocket () 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::exchanges::common::connection< MsgDetails, ConnPol >

A class that wraps a link to an exchange.

Definition at line 85 of file connection.hpp.

Member Typedef Documentation

◆ conn_pol_t

template<class MsgDetails, class ConnPol>
using isimud::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 107 of file connection.hpp.

◆ ctor_args

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

Definition at line 108 of file connection.hpp.

◆ msg_details_t

template<class MsgDetails, class ConnPol>
using isimud::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 105 of file connection.hpp.

◆ skt_mgr_t

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

Definition at line 109 of file connection.hpp.

◆ socket_t

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

Definition at line 110 of file connection.hpp.

Constructor & Destructor Documentation

◆ connection()

template<class MsgDetails , class ConnPol >
isimud::exchanges::common::connection< MsgDetails, ConnPol >::connection ( conn_pol_t const &  conn_pol,
socket_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 74 of file connection_impl.hpp.

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::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 100 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::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 87 of file connection_impl.hpp.

◆ socket()

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

Definition at line 152 of file connection.hpp.

◆ stop()

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

Definition at line 105 of file connection_impl.hpp.

◆ to_string()

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

Definition at line 110 of file connection_impl.hpp.

Member Data Documentation

◆ conn_pol_

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

Definition at line 112 of file connection.hpp.


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