|
ActiveLib
|
#include <Event.h>


Public Types | |
| using | Unique = std::unique_ptr<Event> |
| Unique pointer. | |
| using | Shared = std::shared_ptr<Event> |
| Shared pointer. | |
| using | Option = std::optional<Event> |
| Optional. | |
Public Types inherited from active::utility::NameID | |
| using | Option = std::optional<NameID> |
| Optional. | |
Public Types inherited from active::setting::SettingList | |
| using | base = container::List<Setting> |
| Base storage class. | |
| using | iterator = typename base::iterator |
| Storage iterator. | |
| using | const_iterator = typename base::const_iterator |
| Storage iterator. | |
| using | Shared = std::shared_ptr<SettingList> |
| Shared pointer. | |
| using | Option = std::optional<SettingList> |
| Optional. | |
Public Types inherited from active::container::List< Setting > | |
| using | value_t |
| Stored type. | |
| using | base |
| Base container type. | |
| using | size_type |
| Container size (index) type. | |
| using | iterator |
| Container iterator type. | |
| using | const_iterator |
| Container const iterator type. | |
Public Member Functions | |
| Event () | |
| Event (const utility::NameID &nameID, PostBox *postBox=nullptr) | |
| Event (const NameID &nameID, setting::SettingList &&settings, PostBox *postBox=nullptr) | |
| virtual | ~Event () |
| virtual Event * | clonePtr () const |
| bool | operator== (const Event &ref) const |
| bool | operator== (const NameID &ref) const |
| bool | operator!= (const Event &ref) const |
| void | tellAuthor (Message &&message) const |
Public Member Functions inherited from active::utility::NameID | |
| NameID () | |
| NameID (const String &str, const Guid &guid=Guid{}) | |
| NameID (const char *str, const Guid &guid=Guid{}) | |
| NameID (const Guid &guid, const String &str=String{}) | |
| bool | operator== (const NameID &ref) const |
| bool | operator!= (const NameID &ref) const |
| bool | operator< (const NameID &ref) const |
| operator bool () const | |
| void | clear () |
Public Member Functions inherited from active::setting::SettingList | |
| SettingList () | |
| SettingList (const std::initializer_list< ValueSetting > &settings) | |
| SettingList (const SettingList &source) | |
| SettingList (SettingList &&source) | |
| virtual SettingList & | operator= (const SettingList &source) |
| virtual bool | operator== (const SettingList &ref) const |
| bool | contains (const utility::NameID &nameID) const |
| SettingList::const_iterator | find (const Setting &setting) const |
| const_iterator | find (const utility::NameID &nameID) const |
| ValueSetting * | findValue (const utility::NameID &nameID) const |
| iterator | find (const utility::NameID &nameID) |
| SettingList::iterator | find (const Setting &setting) |
Public Member Functions inherited from active::container::List< Setting > | |
| List () | |
| List (const std::initializer_list< Derived > &items) | |
| List (const List &source) | |
| List (List &&source) | |
| virtual | ~List ()=default |
| auto | operator= (const List &source) |
| auto | operator= (List &&source) |
| void | push_back (Setting *item) |
| void | push_back (Setting &item) |
| void | emplace_back (Setting &&item) |
| void | emplace_back (const Setting &item) |
| void | emplace_back (value_t &&item) |
| void | emplace_back (value_t &item) |
| void | push_front (Setting *item) |
| void | emplace_front (Setting &&item) |
| void | emplace_front (value_t &&item) |
| auto | release (iterator &pos) |
Public Member Functions inherited from active::utility::Cloner | |
| virtual | ~Cloner ()=default |
Additional Inherited Members | |
Public Attributes inherited from active::utility::NameID | |
| String | name |
| Guid | id |
A class representing an event
Events are issued through a Publisher object to interested Subscriber objects. Subscribers will notify a relevant Publisher of the type of events is is interested in receiving. An event has a two-fold purpose: 1) Notification that something has happened 2) Transporting data relevant to the event For example, a service might need to sign out of an online account when an app quits. It will ask for notification from the app signaling that (for whatever reason) the app is about to quit. The event might carry information about the reason for the quit.
|
inline |
Default constructor
|
inline |
Constructor
| nameID | The event identity |
| postBox | Optional postbox for the published event author to receive messages from subscribers |
|
inline |
Constructor
| nameID | The event identity |
| settings | Setting to attach to the event |
| postBox | Optional postbox for the published event author to receive messages from subscribers |
|
inlinevirtual |
Destructor
|
inlinevirtual |
|
inline |
Inequality operator
| ref | The object to compare with this |
|
inline |
Equality operator
| ref | The object to compare with this |

|
inline |
Equality operator
| ref | The object to compare with this |

|
inline |
Send a message to the published event author (NB: The author is free to ignore messages from subscribers)
| message | The message to send |
