ug4
ug::MessageHub::CallbackId Class Reference

The callback-id allows to deregister previously registered callbacks. More...

#include <message_hub.h>

Public Member Functions

void set_auto_free (bool autoFree)
 
 ~CallbackId ()
 

Private Member Functions

 CallbackId (MessageHub *hub, size_t msgTypeId, CallbackEntryIterator callbackEntryIter, bool autoFree)
 

Private Attributes

bool m_autoFree
 
CallbackEntryIterator m_callbackEntryIter
 
MessageHubm_hub
 
size_t m_msgTypeId
 Make sure to only access the iterator while m_hub != NULL. More...
 

Friends

class MessageHub
 

Detailed Description

The callback-id allows to deregister previously registered callbacks.

Note that the class features an autoFree mechanism, which automatically frees the associated callback. Since this class is always wrapped in a smart-pointer, the the associated callback won't be freed, until the last copy of that smart-pointer is deleted. You can disable the auto-free mechanism through the set set_auto_free method or by setting the autoFree parameter of the MessageHub::register_callback methods to false.

Constructor & Destructor Documentation

◆ ~CallbackId()

ug::MessageHub::CallbackId::~CallbackId ( )

◆ CallbackId()

ug::MessageHub::CallbackId::CallbackId ( MessageHub hub,
size_t  msgTypeId,
CallbackEntryIterator  callbackEntryIter,
bool  autoFree 
)
private

Member Function Documentation

◆ set_auto_free()

void ug::MessageHub::CallbackId::set_auto_free ( bool  autoFree)
inline

References m_autoFree.

Friends And Related Function Documentation

◆ MessageHub

friend class MessageHub
friend

Member Data Documentation

◆ m_autoFree

bool ug::MessageHub::CallbackId::m_autoFree
private

Referenced by set_auto_free().

◆ m_callbackEntryIter

CallbackEntryIterator ug::MessageHub::CallbackId::m_callbackEntryIter
private

◆ m_hub

MessageHub* ug::MessageHub::CallbackId::m_hub
private

◆ m_msgTypeId

size_t ug::MessageHub::CallbackId::m_msgTypeId
private

Make sure to only access the iterator while m_hub != NULL.

Referenced by ug::MessageHub::unregister_callback_impl().


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