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 62 of file Event.h.

Constructor & Destructor Documentation

◆ Event()

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

Definition at line 54 of file Event.cpp.

55 : name(name)
57 , eventMultiplexer(core::EventLoop::instance().getEventMultiplexer()) {
58 }
static EventLoop & instance()
Definition EventLoop.cpp:79
EventMultiplexer & eventMultiplexer
Definition Event.h:81
EventReceiver * eventReceiver
Definition Event.h:80
std::string name
Definition Event.h:78

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

Referenced by core::EventReceiver::EventReceiver().

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

◆ ~Event()

core::Event::~Event ( )

Definition at line 60 of file Event.cpp.

60 {
61 relax();
62 }
void relax()
Definition Event.cpp:71

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 82 of file Event.cpp.

82 {
83 published = false;
84 eventReceiver->onEvent(currentTime);
85 }
virtual void onEvent(const utils::Timeval &currentTime)=0
bool published
Definition Event.h:83

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

Referenced by core::EventMultiplexer::EventQueue::execute().

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

◆ getEventReceiver()

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

Definition at line 87 of file Event.cpp.

87 {
88 return eventReceiver;
89 }

References eventReceiver.

Referenced by core::EventMultiplexer::EventQueue::clear().

Here is the caller graph for this function:

◆ getName()

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

Definition at line 78 of file Event.cpp.

78 {
79 return name;
80 }

References name.

Referenced by core::EventReceiver::getName().

Here is the caller graph for this function:

◆ relax()

void core::Event::relax ( )

Definition at line 71 of file Event.cpp.

71 {
72 if (published) {
73 published = false;
75 }
76 }
void relax(core::Event *event)

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

Referenced by core::EventReceiver::relax(), and ~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 64 of file Event.cpp.

64 {
65 if (!published) {
66 published = true;
68 }
69 }
void span(core::Event *event)

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

Referenced by core::EventReceiver::span().

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

Member Data Documentation

◆ eventMultiplexer

EventMultiplexer& core::Event::eventMultiplexer
private

Definition at line 81 of file Event.h.

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

◆ eventReceiver

EventReceiver* core::Event::eventReceiver
private

Definition at line 80 of file Event.h.

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

◆ name

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

Definition at line 78 of file Event.h.

Referenced by Event(), and getName().

◆ published

bool core::Event::published = false
private

Definition at line 83 of file Event.h.

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


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