hmbdc
simplify-high-performance-messaging-programming
hmbdc::app::context_property::broadcast< max_parallel_consumer > Class Template Reference

Context template parameter inidcating each message is sent to all clients within the Context. This is the default property of a Context. More...

#include <Context.hpp>

Detailed Description

template<uint16_t max_parallel_consumer = DEFAULT_HMBDC_CAPACITY>
class hmbdc::app::context_property::broadcast< max_parallel_consumer >

Context template parameter inidcating each message is sent to all clients within the Context. This is the default property of a Context.

each message is still subjected to Client's message type filtering. In the case of ipc Context it is also sent to all clients in the attached ipc Contexts. When this Context is specialized using this type, the context normally works with heterogeneous Clients and all Clients can talk to each other thru the Context. Load balance among Clients can be achieved by participating Clients coordinatedly select message to process In addtion to the direct mode Clients, a Client running pool is supported with the Context - see pool related functions in Context.

Implicit usage in hello-world.cpp:

/// declare Context in the default broadcast type
/// - a message is broadcasted to every Client in this Context
/// - the maximum message size this context can handle is sizeof(WinterComing)
/// would not compile if size is too small.
/// Use 0 if the max message size is not known at compile time
using MyContext = Context<sizeof(WinterComing)>;
MyContext ctx; /// this the communication media object - message dispatcher

Explicit usage in hmbdc.cpp

///
/// declare Context type - 32 bytes is the maximum message size this context can handle
/// would not compile if size is too small; 32 happens to be big enough for all the messages
/// defined above
///
using MyContext = Context<32, context_property::broadcast<>>;

There is no hard coded limit on how many Clients can be added into a pool Also, there is no limit on when you can add a Client into a pool.

Template Parameters
max_parallel_consumer,normally,thereisn't a need to specify it. max thread counts that processes messages that incudes pool threads plus the count of direct mode Clients that registers messages within the Context supported values: 4(default) 2,8,16,32,64 requires hmbdc licensed

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