hmbdc
simplify-high-performance-messaging-programming
Public Member Functions | List of all members
hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties > Class Template Reference

covers the inter-thread and ipc communication fascade More...

#include <Context.hpp>

Inheritance diagram for hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >:
hmbdc::app::context_detail::context_property_aggregator< ContextProperties... >

Public Member Functions

template<typename M0 , typename M1 , typename ... Messages>
std::enable_if<!std::is_integral< M1 >::value, void >::type send (M0 &&m0, M1 &&m1, Messages &&... msgs)
 try send a batch of messages to the Context or attached ipc Contexts More...
 
template<typename M0 , typename M1 , typename ... Messages>
std::enable_if<!std::is_integral< M1 >::value, bool >::type trySend (M0 &&m0, M1 &&m1, Messages &&... msgs)
 try to send a batch of message to the Context or attached ipc Contexts More...
 
template<typename ForwardIt >
void send (ForwardIt begin, size_t n)
 send a range of messages to the Context or attached ipc Contexts More...
 
template<typename ForwardIt >
bool trySend (ForwardIt begin, size_t n)
 try send a range of messages to the Context or attached ipc Contexts More...
 
template<typename Message >
void send (Message &&m)
 send a message to the Context or attached ipc Contexts More...
 
template<typename Message >
bool trySend (Message &&m)
 try to send a message to the Context or attached ipc Contexts if it wouldn't block More...
 
template<typename Message , typename ... Args>
void sendInPlace (Args &&... args)
 send a message to all Clients in the Context or attached ipc Contexts More...
 
template<typename Message , typename ... Args>
bool trySendInPlace (Args &&... args)
 try send a message to all Clients in the Context or attached ipc Contexts if it wouldn't block More...
 
Buffer & buffer ()
 accessor - mostly used internally More...
 

Detailed Description

template<size_t MaxMessageSize, typename... ContextProperties>
class hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >

covers the inter-thread and ipc communication fascade

this type's interface is exposed thru Context and the type itself is not directly used by users

Template Parameters
MaxMessageSizeWhat is the max message size, need at compile time if the value can only be determined at runtime, set this to 0. Things can still work but will lost some compile time checking advantages, see maxMessageSizeRuntime below
ContextPropertiessee types in context_property namespace

Member Function Documentation

◆ buffer()

template<size_t MaxMessageSize, typename... ContextProperties>
Buffer& hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >::buffer ( )
inline

accessor - mostly used internally

Returns
underlying buffer used in the Context

◆ send() [1/3]

template<size_t MaxMessageSize, typename... ContextProperties>
template<typename M0 , typename M1 , typename ... Messages>
std::enable_if<!std::is_integral<M1>::value, void>::type hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >::send ( M0 &&  m0,
M1 &&  m1,
Messages &&...  msgs 
)
inline

try send a batch of messages to the Context or attached ipc Contexts

only the Clients that handles the Message will get it of course This function is threadsafe, which means you can call it anywhere in the code

Parameters
msgsmessages
Template Parameters
Messagesmessage types

◆ send() [2/3]

template<size_t MaxMessageSize, typename... ContextProperties>
template<typename ForwardIt >
void hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >::send ( ForwardIt  begin,
size_t  n 
)
inline

send a range of messages to the Context or attached ipc Contexts

only the Clients that handles the Message will get it of course This function is threadsafe, which means you can call it anywhere in the code

Parameters
begina forward iterator point at the start of the range
nlength of the range

◆ send() [3/3]

template<size_t MaxMessageSize, typename... ContextProperties>
template<typename Message >
void hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >::send ( Message &&  m)
inline

send a message to the Context or attached ipc Contexts

only the Clients that handles the Message will get it of course This function is threadsafe, which means you can call it anywhere in the code

Parameters
mmessage
Template Parameters
Messagetype

◆ sendInPlace()

template<size_t MaxMessageSize, typename... ContextProperties>
template<typename Message , typename ... Args>
void hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >::sendInPlace ( Args &&...  args)
inline

send a message to all Clients in the Context or attached ipc Contexts

construct the Message in buffer directly This function is threadsafe, which means you can call it anywhere in the code

Parameters
argsctor args
Template Parameters
Messagetype
typename... Args args

◆ trySend() [1/3]

template<size_t MaxMessageSize, typename... ContextProperties>
template<typename M0 , typename M1 , typename ... Messages>
std::enable_if<!std::is_integral<M1>::value, bool>::type hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >::trySend ( M0 &&  m0,
M1 &&  m1,
Messages &&...  msgs 
)
inline

try to send a batch of message to the Context or attached ipc Contexts

this call does not block and it is transactional - send all or none This function is threadsafe, which means you can call it anywhere in the code

Parameters
msgsmessages
Template Parameters
Messagesmessage types
Returns
true if send successfully

◆ trySend() [2/3]

template<size_t MaxMessageSize, typename... ContextProperties>
template<typename ForwardIt >
bool hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >::trySend ( ForwardIt  begin,
size_t  n 
)
inline

try send a range of messages to the Context or attached ipc Contexts

this call does not block and it is transactional - send all or none This function is threadsafe, which means you can call it anywhere in the code

Parameters
begina forward iterator point at the start of the range
nlength of the range

◆ trySend() [3/3]

template<size_t MaxMessageSize, typename... ContextProperties>
template<typename Message >
bool hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >::trySend ( Message &&  m)
inline

try to send a message to the Context or attached ipc Contexts if it wouldn't block

this call does not block - return false when buffer is full This function is threadsafe, which means you can call it anywhere in the code

Parameters
mmessage
Template Parameters
Messagetype
Returns
true if send successfully

◆ trySendInPlace()

template<size_t MaxMessageSize, typename... ContextProperties>
template<typename Message , typename ... Args>
bool hmbdc::app::context_detail::ThreadCommBase< MaxMessageSize, ContextProperties >::trySendInPlace ( Args &&...  args)
inline

try send a message to all Clients in the Context or attached ipc Contexts if it wouldn't block

this call does not block - return false when buffer is full constructed the Message in buffer directly if returns true This function is threadsafe, which means you can call it anywhere in the code

Parameters
argsctor args
Template Parameters
Messagetype
typename... Args args
Returns
true if send successfully

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