ActiveLib
Loading...
Searching...
No Matches
Participant.h
1
6#ifndef ACTIVE_EVENT_PARTICIPANT
7#define ACTIVE_EVENT_PARTICIPANT
8
9#include "Active/Utility/NameID.h"
10
11namespace active::event {
12
23 public:
28 Participant(const utility::NameID& identity = utility::NameID{}) : utility::NameID{identity} {}
32 virtual ~Participant() = default;
33
34 // MARK: - Operators
35
41 bool operator== (const Participant& ref) const { return (id && ref.id) ? (id == ref.id) : false; } //Only match on ID
47 bool operator!= (const Participant& ref) const { return !(*this == ref); }
48
49 protected:
54 virtual bool audit() { return true; }
59 virtual bool attach() { return true; }
64 virtual bool start() { return true; }
68 virtual void stop() {}
69 };
70
71}
72
73#endif //ACTIVE_EVENT_PARTICIPANT
Definition Participant.h:22
virtual void stop()
Definition Participant.h:68
virtual bool audit()
Definition Participant.h:54
bool operator==(const Participant &ref) const
Definition Participant.h:41
Participant(const utility::NameID &identity=utility::NameID{})
Definition Participant.h:28
bool operator!=(const Participant &ref) const
Definition Participant.h:47
virtual ~Participant()=default
virtual bool start()
Definition Participant.h:64
virtual bool attach()
Definition Participant.h:59
Definition NameID.h:21
NameID()
Definition NameID.h:34
Definition Event.h:13