8#include "Arp/Base/Core/delegate.hxx"
9#include "Arp/Base/Core/Exception.hpp"
12namespace Arp {
namespace Base {
namespace Core
29template<
class M,
class ...Args>
34 using event_handlers = std::vector<delegate_type>;
37 using SyncGuard =
typename M::LockGuard;
52 size_t count(
void)
const;
55 event_handlers eventHandlers;
56 mutable SyncRoot syncRoot;
85 using event_handlers = std::vector<delegate_type>;
100 size_t count(
void)
const;
103 event_handlers eventHandlers;
113#include "Arp/Base/Core/Detail/synced_event.ipp"
This is the base class of all Arp exception classes.
Definition: Exception.hpp:21
Prototyping of delegate template.
Definition: delegate.hxx:14
synced_event(void)
Constructs a synced_event<void> instance.
M SyncRoot
The mutex type used for synchronization.
Definition: synced_event.hxx:81
typename M::LockGuard SyncGuard
The lock guard type used for RAII synchronization provided by Mutex type.
Definition: synced_event.hxx:82
Use this class to register and invoke several delegates (function pointer in OOP design) in synced ma...
Definition: synced_event.hxx:31
synced_event & operator+=(delegate_type &&rhs)
Adds a delegate to this event.
Definition: synced_event.ipp:28
void operator()(Args... args) const
Fires this event instance.
Definition: synced_event.ipp:99
synced_event & operator-=(const delegate_type &rhs)
Removes a delegate from this event.
Definition: synced_event.ipp:76
synced_event(void)
Constructs a synced_event instance.
size_t count(void) const
Gets the number of delegates to be invoked.
Definition: synced_event.ipp:129
bool is_empty(void) const
Checks if this event has any delegates to be invoked.
Definition: synced_event.ipp:117
Root namespace for the PLCnext API