Public Member Functions | Private Attributes | List of all members
swarmio::simulator::FauxEventHandler Class Referencefinal

A special event handler that serves discovery information and ignores the event itself. More...

#include <FauxEventHandler.h>

Inheritance diagram for swarmio::simulator::FauxEventHandler:
Inheritance graph
[legend]

Public Member Functions

void AddParameter (const std::string &key, data::discovery::Type type)
 Add a new parameter to serve for discovery. More...
 
virtual data::discovery::Schema DescribeEvent (const std::string &name) override
 Handlers may add parameter descriptors to the event descriptor when asked to do so by overriding this method. More...
 
virtual void EventWasTriggered (const Node *node, const data::event::Notification &event) override
 Handlers are notified using this method when an event has been triggered. More...
 
 FauxEventHandler (const std::string &name)
 Create a new fake event handler. More...
 
const std::string & GetName () const
 Get the name of the event. More...
 

Private Attributes

std::string _name
 Event name. More...
 
std::map< std::string, data::discovery::Type > _parameters
 Parameters. More...
 

Detailed Description

A special event handler that serves discovery information and ignores the event itself.

Definition at line 16 of file FauxEventHandler.h.

Constructor & Destructor Documentation

swarmio::simulator::FauxEventHandler::FauxEventHandler ( const std::string &  name)
inline

Create a new fake event handler.

Parameters
nameEvent name

Definition at line 39 of file FauxEventHandler.h.

Member Function Documentation

void swarmio::simulator::FauxEventHandler::AddParameter ( const std::string &  key,
data::discovery::Type  type 
)
inline

Add a new parameter to serve for discovery.

Parameters
keyParameter name
typeParameter type

Definition at line 48 of file FauxEventHandler.h.

virtual data::discovery::Schema swarmio::simulator::FauxEventHandler::DescribeEvent ( const std::string &  name)
inlineoverridevirtual

Handlers may add parameter descriptors to the event descriptor when asked to do so by overriding this method.

Parameters
nameName

Implements swarmio::services::event::Handler.

Definition at line 70 of file FauxEventHandler.h.

virtual void swarmio::simulator::FauxEventHandler::EventWasTriggered ( const Node node,
const data::event::Notification &  event 
)
inlineoverridevirtual

Handlers are notified using this method when an event has been triggered.

Parameters
nodeSource node
eventEvent

Implements swarmio::services::event::Handler.

Definition at line 61 of file FauxEventHandler.h.

const std::string& swarmio::simulator::FauxEventHandler::GetName ( ) const
inline

Get the name of the event.

Returns
const std::string&

Definition at line 92 of file FauxEventHandler.h.

Member Data Documentation

std::string swarmio::simulator::FauxEventHandler::_name
private

Event name.

Definition at line 24 of file FauxEventHandler.h.

std::map<std::string, data::discovery::Type> swarmio::simulator::FauxEventHandler::_parameters
private

Parameters.

Definition at line 30 of file FauxEventHandler.h.


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


swarmros
Author(s):
autogenerated on Fri Apr 3 2020 03:42:48