mn::event_system< TSender, TArgs, TBaseEvent, TContainer > Class Template Reference

#include <mn_event.hpp>

+ Collaboration diagram for mn::event_system< TSender, TArgs, TBaseEvent, TContainer >:

Public Types

using self_type = event_system< TSender, TArgs, TBaseEvent, TContainer >
 
using sender_type = TSender
 
using args_type = TArgs
 
using container_type = TContainer
 
using value_type = TBaseEvent
 
using reference = TBaseEvent &
 
using const_reference = const TBaseEvent &
 
using pointer = TBaseEvent *
 
using const_pointer = const TBaseEvent *
 
using size_type = typename container_type::size_type
 
using allocator_type = typename container_type::allocator_type
 

Public Member Functions

 event_system (size_type initialSize=4, const allocator_type &allocator=allocator_type())
 
 event_system (const self_type &other)
 
void emit (const TSender &sender, const args_type args)
 
void bind (const_reference funcHandler)
 
void remove (const_reference funcHandler)
 
void operator+= (const_reference funcHandler)
 
void operator-= (const_reference funcHandler)
 
void operator() (const TSender &sender, const args_type args)
 

Private Attributes

container_type m_observers
 
mutex_t m_mutex
 

Member Typedef Documentation

◆ allocator_type

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::allocator_type = typename container_type::allocator_type

◆ args_type

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::args_type = TArgs

◆ const_pointer

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::const_pointer = const TBaseEvent*

◆ const_reference

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::const_reference = const TBaseEvent&

◆ container_type

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::container_type = TContainer

◆ pointer

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::pointer = TBaseEvent*

◆ reference

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::reference = TBaseEvent&

◆ self_type

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::self_type = event_system<TSender, TArgs, TBaseEvent, TContainer>

◆ sender_type

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::sender_type = TSender

◆ size_type

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::size_type = typename container_type::size_type

◆ value_type

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
using mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::value_type = TBaseEvent

Constructor & Destructor Documentation

◆ event_system() [1/2]

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::event_system ( size_type  initialSize = 4,
const allocator_type allocator = allocator_type() 
)
inline

◆ event_system() [2/2]

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::event_system ( const self_type other)
inline

Member Function Documentation

◆ bind()

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
void mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::bind ( const_reference  funcHandler)
inline

◆ emit()

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
void mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::emit ( const TSender &  sender,
const args_type  args 
)
inline

◆ operator()()

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
void mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::operator() ( const TSender &  sender,
const args_type  args 
)
inline

◆ operator+=()

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
void mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::operator+= ( const_reference  funcHandler)
inline

◆ operator-=()

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
void mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::operator-= ( const_reference  funcHandler)
inline

◆ remove()

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
void mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::remove ( const_reference  funcHandler)
inline

Member Data Documentation

◆ m_mutex

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
mutex_t mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::m_mutex
private

◆ m_observers

template<class TSender , typename TArgs , class TBaseEvent = base_event<TSender, TArgs>, class TContainer = mn::container::vector<TBaseEvent>>
container_type mn::event_system< TSender, TArgs, TBaseEvent, TContainer >::m_observers
private

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