Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::Event Class Referencefinal

Represents an event. More...

#include <event.h>

Inheritance diagram for sen::Event:

Public Member Functions

 ~Event () override=default
bool operator== (const Event &other) const noexcept
 Checks if other is equivalent to this.
bool operator!= (const Event &other) const noexcept
 Checks if other is not equivalent to this.
MemberHash getHash () const noexcept
 Returns a unique hash to identify the Event.
MemberHash getId () const noexcept
 Returns a name hash of the event.
std::string_view getName () const noexcept
 Callable name.
std::string_view getDescription () const noexcept
 Callable description.
TransportMode getTransportMode () const noexcept
 The transport mode of this callable.
Span< const ArggetArgs () const noexcept
 Gets the arguments.
const ArggetArgFromName (std::string_view name) const
 Get the field data given a name. Nullptr means not found.
size_t getArgIndexFromNameHash (MemberHash nameHash) const
 Get the index in the vector of Args given a name hash.
bool operator== (const Callable &other) const noexcept
bool operator!= (const Callable &other) const noexcept

Static Public Member Functions

static std::shared_ptr< Event > make (const EventSpec &spec)
 Factory function that validates the spec and creates a class type. Throws std::exception if the spec is not valid.
static void checkSpec (const CallableSpec &spec)
 Throws std::exception if the callable spec is invalid.

Protected Member Functions

const CallableSpecgetCallableSpec () const noexcept
 The spec of this callable.

Detailed Description

Represents an event.

Constructor & Destructor Documentation

◆ ~Event()

sen::Event::~Event ( )
overridedefault

Member Function Documentation

◆ make()

std::shared_ptr< Event > sen::Event::make ( const EventSpec & spec)
staticnodiscard

Factory function that validates the spec and creates a class type. Throws std::exception if the spec is not valid.

◆ operator==() [1/2]

bool sen::Event::operator== ( const Event & other) const
nodiscardnoexcept

Checks if other is equivalent to this.

◆ operator!=() [1/2]

bool sen::Event::operator!= ( const Event & other) const
nodiscardnoexcept

Checks if other is not equivalent to this.

◆ getHash()

MemberHash sen::Event::getHash ( ) const
nodiscardnoexcept

Returns a unique hash to identify the Event.

◆ getId()

MemberHash sen::Event::getId ( ) const
nodiscardnoexcept

Returns a name hash of the event.

◆ getName()

std::string_view sen::Callable::getName ( ) const
nodiscardnoexceptinherited

Callable name.

◆ getDescription()

std::string_view sen::Callable::getDescription ( ) const
nodiscardnoexceptinherited

Callable description.

◆ getTransportMode()

TransportMode sen::Callable::getTransportMode ( ) const
nodiscardnoexceptinherited

The transport mode of this callable.

◆ getArgs()

Span< const Arg > sen::Callable::getArgs ( ) const
nodiscardnoexceptinherited

Gets the arguments.

◆ getArgFromName()

const Arg * sen::Callable::getArgFromName ( std::string_view name) const
nodiscardinherited

Get the field data given a name. Nullptr means not found.

Parameters
namethe name of the field.

◆ getArgIndexFromNameHash()

size_t sen::Callable::getArgIndexFromNameHash ( MemberHash nameHash) const
nodiscardinherited

Get the index in the vector of Args given a name hash.

◆ operator==() [2/2]

bool sen::Callable::operator== ( const Callable & other) const
nodiscardnoexceptinherited

◆ operator!=() [2/2]

bool sen::Callable::operator!= ( const Callable & other) const
nodiscardnoexceptinherited

◆ checkSpec()

void sen::Callable::checkSpec ( const CallableSpec & spec)
staticinherited

Throws std::exception if the callable spec is invalid.

◆ getCallableSpec()

const CallableSpec & sen::Callable::getCallableSpec ( ) const
nodiscardprotectednoexceptinherited

The spec of this callable.


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