SNode.C
Loading...
Searching...
No Matches
core::Event Class Reference

#include <Event.h>

Collaboration diagram for core::Event:

Public Member Functions

 Event (EventReceiver *eventReceiver, const std::string &name)
 
 ~Event ()
 
void span ()
 
void relax ()
 
const std::string & getName () const
 
void dispatch (const utils::Timeval &currentTime)
 
EventReceivergetEventReceiver () const
 

Private Attributes

std::string name
 
EventReceivereventReceiver
 
EventMultiplexereventMultiplexer
 
bool published = false
 

Detailed Description

Definition at line 40 of file Event.h.

Constructor & Destructor Documentation

◆ Event()

core::Event::Event ( EventReceiver * eventReceiver,
const std::string & name )
explicit

Definition at line 32 of file Event.cpp.

33 : name(name)
35 , eventMultiplexer(core::EventLoop::instance().getEventMultiplexer()) {
36 }
static EventLoop & instance()
Definition EventLoop.cpp:57
EventMultiplexer & eventMultiplexer
Definition Event.h:59
EventReceiver * eventReceiver
Definition Event.h:58
std::string name
Definition Event.h:56

References Event(), eventMultiplexer, eventReceiver, core::EventLoop::getEventMultiplexer(), and core::EventLoop::instance().

Referenced by Event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~Event()

core::Event::~Event ( )

Definition at line 38 of file Event.cpp.

38 {
39 relax();
40 }
void relax()
Definition Event.cpp:49

References relax().

Here is the call graph for this function:

Member Function Documentation

◆ dispatch()

void core::Event::dispatch ( const utils::Timeval & currentTime)

Definition at line 60 of file Event.cpp.

60 {
61 published = false;
62 eventReceiver->onEvent(currentTime);
63 }
virtual void onEvent(const utils::Timeval &currentTime)=0
bool published
Definition Event.h:61

References eventReceiver, core::EventReceiver::onEvent(), and published.

Here is the call graph for this function:

◆ getEventReceiver()

EventReceiver * core::Event::getEventReceiver ( ) const

Definition at line 65 of file Event.cpp.

65 {
66 return eventReceiver;
67 }

References eventReceiver.

◆ getName()

const std::string & core::Event::getName ( ) const

Definition at line 56 of file Event.cpp.

56 {
57 return name;
58 }

◆ relax()

void core::Event::relax ( )

Definition at line 49 of file Event.cpp.

49 {
50 if (published) {
51 published = false;
53 }
54 }
void relax(core::Event *event)

References eventMultiplexer, published, and core::EventMultiplexer::relax().

Referenced by ~Event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ span()

void core::Event::span ( )

Definition at line 42 of file Event.cpp.

42 {
43 if (!published) {
44 published = true;
46 }
47 }
void span(core::Event *event)

References eventMultiplexer, published, and core::EventMultiplexer::span().

Here is the call graph for this function:

Member Data Documentation

◆ eventMultiplexer

EventMultiplexer& core::Event::eventMultiplexer
private

Definition at line 59 of file Event.h.

Referenced by Event(), relax(), and span().

◆ eventReceiver

EventReceiver* core::Event::eventReceiver
private

Definition at line 58 of file Event.h.

Referenced by dispatch(), Event(), and getEventReceiver().

◆ name

std::string core::Event::name
private

Definition at line 56 of file Event.h.

◆ published

bool core::Event::published = false
private

Definition at line 61 of file Event.h.

Referenced by dispatch(), relax(), and span().


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