ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
active::event::Event Class Reference

#include <Event.h>

Inheritance diagram for active::event::Event:
Inheritance graph
[legend]
Collaboration diagram for active::event::Event:
Collaboration graph
[legend]

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 EventclonePtr () 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 SettingListoperator= (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
 
ValueSettingfindValue (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Event() [1/3]

active::event::Event::Event ( )
inline

Default constructor

◆ Event() [2/3]

active::event::Event::Event ( const utility::NameID & nameID,
PostBox * postBox = nullptr )
inline

Constructor

Parameters
nameIDThe event identity
postBoxOptional postbox for the published event author to receive messages from subscribers

◆ Event() [3/3]

active::event::Event::Event ( const NameID & nameID,
setting::SettingList && settings,
PostBox * postBox = nullptr )
inline

Constructor

Parameters
nameIDThe event identity
settingsSetting to attach to the event
postBoxOptional postbox for the published event author to receive messages from subscribers

◆ ~Event()

virtual active::event::Event::~Event ( )
inlinevirtual

Destructor

Member Function Documentation

◆ clonePtr()

virtual Event * active::event::Event::clonePtr ( ) const
inlinevirtual

Clone method

Returns
A clone of this object

Reimplemented from active::setting::SettingList.

◆ operator!=()

bool active::event::Event::operator!= ( const Event & ref) const
inline

Inequality operator

Parameters
refThe object to compare with this
Returns
True if ref is not equal to this

◆ operator==() [1/2]

bool active::event::Event::operator== ( const Event & ref) const
inline

Equality operator

Parameters
refThe object to compare with this
Returns
True if ref is equal to this
Here is the call graph for this function:

◆ operator==() [2/2]

bool active::event::Event::operator== ( const NameID & ref) const
inline

Equality operator

Parameters
refThe object to compare with this
Returns
True if ref is equal to this
Here is the call graph for this function:

◆ tellAuthor()

void active::event::Event::tellAuthor ( Message && message) const
inline

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

Parameters
messageThe message to send
Here is the call graph for this function:

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