hmbdc
simplify-high-performance-messaging-programming
Public Types | Public Member Functions | List of all members
hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash > Struct Template Reference
Inheritance diagram for hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash >:

Public Types

using SendMessageTuple = std::tuple<>
 Concrete Node needs to specify a list of Messages that would be sent out if this Node is active to help IPC and network delivering filtering. If not fully specified the message could be invisible outside of this process.
 

Public Member Functions

char const * hmbdcName () const
 the thread name used to identify the thread the Node is running on More...
 
size_t maxMessageSize () const
 unless JustBytes is used in Interests - this is automatic More...
 
void addJustBytesSubsFor (std::function< void(uint16_t)> addTag) const
 What tags are going to published when JustBytes is in the RecvMessageTuple. More...
 
void addJustBytesPubsFor (std::function< void(uint16_t)> addTag) const
 What tags are going to published when JustBytes is in the SendMessageTuple. More...
 
template<MessageC Message>
void addTypeTagRangeSubsFor (Message *, std::function< void(uint16_t)> addOffsetInRange) const
 The concrete node overrides this function for each inTagRange type of Message to indicate which type tags in the range this Node subscribes for - otherwise each one in range is subscribed. More...
 
template<MessageC Message>
void addTypeTagRangePubsFor (Message *, std::function< void(uint16_t)> addOffsetInRange) const
 The concrete node overrides this function for each inTagRange type of Message to indicate which type tags in the range this Node subscribes for - otherwise each one in range is expected to be published. More...
 
void updateSubscription ()
 Domain calls this first before handles the subscritions for this Node.
 
template<MessageC Message>
bool ifDeliver (Message const &message) const
 an overridable method in the concrete Node that determine if a message should be deliverred to this Node instance This is called at the sending part before the Node is unblocked due to this delivery More...
 
bool ifDeliver (uint16_t tag, uint8_t const *bytes) const
 an overridable method in the concrete Node that determine if a message should be deliverred to this Node instance's JustBytes Interests This is called at the sending part before the Node is unblocked due to this delivery More...
 
void invokedCb (size_t dispatched) override
 this callback is called all the time (frequently) - the exact timing is after a batch of messages are dispatched. After this call returns, the previously dispatched message's addresses are no longer valid, which means if you cache the event addresses in the previous handleMessageCb()s, you cannot use those after the return of the next invokeCb function. More...
 

Member Function Documentation

◆ addJustBytesPubsFor()

template<typename CcNode , MessageC ... RecvMessages, bool HasMessageStash>
void hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash >::addJustBytesPubsFor ( std::function< void(uint16_t)>  addTag) const
inline

What tags are going to published when JustBytes is in the SendMessageTuple.

Parameters
addTagfunctor used to addd a tag value (NOT tag offset)

◆ addJustBytesSubsFor()

template<typename CcNode , MessageC ... RecvMessages, bool HasMessageStash>
void hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash >::addJustBytesSubsFor ( std::function< void(uint16_t)>  addTag) const
inline

What tags are going to published when JustBytes is in the RecvMessageTuple.

Parameters
addTagfunctor used to addd a tag value (NOT tag offset)

◆ addTypeTagRangePubsFor()

template<typename CcNode , MessageC ... RecvMessages, bool HasMessageStash>
template<MessageC Message>
void hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash >::addTypeTagRangePubsFor ( Message *  ,
std::function< void(uint16_t)>  addOffsetInRange 
) const
inline

The concrete node overrides this function for each inTagRange type of Message to indicate which type tags in the range this Node subscribes for - otherwise each one in range is expected to be published.

Template Parameters
Messagethe inTagRange Message
Parameters
addOffsetInRangea functor that adds a type tag into the subscription Note - the functor does not take a type tag - instead it takes the tag offset within the range

◆ addTypeTagRangeSubsFor()

template<typename CcNode , MessageC ... RecvMessages, bool HasMessageStash>
template<MessageC Message>
void hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash >::addTypeTagRangeSubsFor ( Message *  ,
std::function< void(uint16_t)>  addOffsetInRange 
) const
inline

The concrete node overrides this function for each inTagRange type of Message to indicate which type tags in the range this Node subscribes for - otherwise each one in range is subscribed.

Template Parameters
Messagethe inTagRange Message
Parameters
addOffsetInRangea functor that adds a type tag into the subscription Note - the functor does not take a type tag - instead it takes the tag offset within the range

◆ hmbdcName()

template<typename CcNode , MessageC ... RecvMessages, bool HasMessageStash>
char const* hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash >::hmbdcName ( ) const
inline

the thread name used to identify the thread the Node is running on

  • only for display purpose
Returns
char const* a string - less than 8 char typically

◆ ifDeliver() [1/2]

template<typename CcNode , MessageC ... RecvMessages, bool HasMessageStash>
template<MessageC Message>
bool hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash >::ifDeliver ( Message const &  message) const
inline

an overridable method in the concrete Node that determine if a message should be deliverred to this Node instance This is called at the sending part before the Node is unblocked due to this delivery

Template Parameters
Messagedecision is for this Message type
Parameters
messageThe decision on this Message instance
Returns
true if proceed to deliever it
false if not

◆ ifDeliver() [2/2]

template<typename CcNode , MessageC ... RecvMessages, bool HasMessageStash>
bool hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash >::ifDeliver ( uint16_t  tag,
uint8_t const *  bytes 
) const
inline

an overridable method in the concrete Node that determine if a message should be deliverred to this Node instance's JustBytes Interests This is called at the sending part before the Node is unblocked due to this delivery

Template Parameters
Messagedecision is for this Message type
Parameters
tagmessage tag
bytesmessage address
Returns
true if proceed to deliever it
false if not

◆ invokedCb()

template<typename CcNode , MessageC ... RecvMessages, bool HasMessageStash>
void hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash >::invokedCb ( size_t  dispatched)
inlineoverride

this callback is called all the time (frequently) - the exact timing is after a batch of messages are dispatched. After this call returns, the previously dispatched message's addresses are no longer valid, which means if you cache the event addresses in the previous handleMessageCb()s, you cannot use those after the return of the next invokeCb function.

you can collectively process the messages received/cached so far here, or do something needs to be done all the time like powering another message loop

Parameters
dispatchedthe number of messages dispatched since last invokedCb called

◆ maxMessageSize()

template<typename CcNode , MessageC ... RecvMessages, bool HasMessageStash>
size_t hmbdc::tips::Node< CcNode, std::tuple< RecvMessages... >, HasMessageStash >::maxMessageSize ( ) const
inline

unless JustBytes is used in Interests - this is automatic

Returns
size_t what is the biggest message this Node is to receive

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