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

Represents a collection of standard services that can be used to simulate an ordinary device. More...

#include <ExampleDevice.h>

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

Public Member Functions

void AddConstantTelemetryValue (const std::string &key, const data::Variant &value, bool includeInStatus=false)
 Add a constant telemetry value. More...
 
void AddFauxEventHandler (FauxEventHandler *eventHandler)
 Add an event handler and register it. More...
 
void AddInMemoryParameter (InMemoryParameter *parameter)
 Add an In-Memory Parameter and register it. More...
 
 ExampleDevice (Endpoint *endpoint)
 Construct a new Example Device object. More...
 
virtual bool ReceiveMessage (const Node *sender, const data::Message *message) override
 Delivery point of all messages. More...
 
 ~ExampleDevice () override
 Destroy the Example Device object. More...
 
- Public Member Functions inherited from swarmio::profiles::MemberProfile
swarmio::services::event::ServiceGetEventService ()
 Get a reference for the Event service. More...
 
swarmio::services::keyvalue::ServiceGetKeyValueService ()
 Get a reference for the Key-Value service. More...
 
 MemberProfile (Endpoint *endpoint)
 Construct a new MemberProfile. More...
 
virtual ~MemberProfile ()
 Destroy the MemberProfile object. More...
 
- Public Member Functions inherited from swarmio::profiles::Profile
swarmio::services::discovery::ServiceGetDiscoveryService ()
 Get a reference for the Discovery service. More...
 
swarmio::services::ping::ServiceGetPingService ()
 Get a reference for the Ping service. More...
 
swarmio::services::telemetry::ServiceGetTelemetryService ()
 Get a reference for the Telemetry service. More...
 
virtual ~Profile ()
 Destroy the Profile object. More...
 
- Public Member Functions inherited from swarmio::Mailbox
virtual void Disconnect ()
 Disconnect this Mailbox from the Endpoint. More...
 
EndpointGetEndpoint ()
 Get the associated Endpoint. More...
 
 Mailbox (const Mailbox &)=delete
 Remove copy constructor. More...
 
virtual void MailboxWasConnected () noexcept
 Called when the mailbox is attached to an already running endpoint or if the attached endpoint has just started. More...
 
virtual void MailboxWillBeDisconnected () noexcept
 Called right before the mailbox is disconnected from its endpoint or if the attached endpoint is about to stop. More...
 
virtual void NodeDidJoin (const Node *node) noexcept
 Called when a new Node has joined the group. More...
 
virtual void NodeWasDiscovered (const Node *node) noexcept
 Called when a new Node has been discovered. More...
 
virtual void NodeWillLeave (const Node *node) noexcept
 Called when a Node signals that it will leave. More...
 
Mailboxoperator= (const Mailbox &)=delete
 Remove assignment operator. More...
 
virtual ~Mailbox ()
 Destroy the Mailbox object. More...
 

Private Attributes

std::list< FauxEventHandler * > _eventHandlers
 Event handlers. More...
 
uint32_t _messageCounter = 0
 Number of incoming messages. More...
 
std::list< InMemoryParameter * > _parameters
 Parameters. More...
 

Additional Inherited Members

- Protected Member Functions inherited from swarmio::profiles::Profile
 Profile (Endpoint *endpoint, bool performActiveDiscovery)
 Construct a new Profile. More...
 
- Protected Member Functions inherited from swarmio::Mailbox
void FinishConstruction ()
 Called when the last constructor has finished its job. More...
 
void FinishMovingTo (Mailbox *other)
 Called when message handling should be passed onto the new instance. More...
 
 Mailbox ()
 Construct a disconnected Mailbox. More...
 
 Mailbox (Endpoint *endpoint)
 Construct a new Mailbox object. More...
 
 Mailbox (Mailbox &&other)
 Move a Mailbox object. More...
 
- Protected Attributes inherited from swarmio::profiles::MemberProfile
swarmio::services::event::Service _eventService
 Event service. More...
 
swarmio::services::keyvalue::Service _keyvalueService
 Key-Value service. More...
 
- Protected Attributes inherited from swarmio::profiles::Profile
swarmio::services::discovery::Service _discoveryService
 Discovery service. More...
 
swarmio::services::ping::Service _pingService
 Ping service. More...
 
swarmio::services::telemetry::Service _telemetryService
 Telemetry service. More...
 

Detailed Description

Represents a collection of standard services that can be used to simulate an ordinary device.

Definition at line 16 of file ExampleDevice.h.

Constructor & Destructor Documentation

ExampleDevice::ExampleDevice ( Endpoint endpoint)

Construct a new Example Device object.

Parameters
endpointEndpoint to use

Definition at line 7 of file ExampleDevice.cpp.

ExampleDevice::~ExampleDevice ( )
override

Destroy the Example Device object.

Definition at line 51 of file ExampleDevice.cpp.

Member Function Documentation

void ExampleDevice::AddConstantTelemetryValue ( const std::string &  key,
const data::Variant &  value,
bool  includeInStatus = false 
)

Add a constant telemetry value.

Parameters
keyKey
valueValue
includeInStatusTrue if the value should be broadcast in the status descriptor

Definition at line 33 of file ExampleDevice.cpp.

void ExampleDevice::AddFauxEventHandler ( FauxEventHandler eventHandler)

Add an event handler and register it.

Parameters
eventHandlerEvent handler

Definition at line 39 of file ExampleDevice.cpp.

void ExampleDevice::AddInMemoryParameter ( InMemoryParameter parameter)

Add an In-Memory Parameter and register it.

Parameters
parameterParameter

Definition at line 45 of file ExampleDevice.cpp.

bool ExampleDevice::ReceiveMessage ( const Node sender,
const data::Message *  message 
)
overridevirtual

Delivery point of all messages.

Parameters
senderThe node that has sent the message
messageThe message itself
Returns
True if the message had been processed and should not be forwarded to other mailboxes

Reimplemented from swarmio::Mailbox.

Definition at line 19 of file ExampleDevice.cpp.

Member Data Documentation

std::list<FauxEventHandler*> swarmio::simulator::ExampleDevice::_eventHandlers
private

Event handlers.

Definition at line 30 of file ExampleDevice.h.

uint32_t swarmio::simulator::ExampleDevice::_messageCounter = 0
private

Number of incoming messages.

Definition at line 24 of file ExampleDevice.h.

std::list<InMemoryParameter*> swarmio::simulator::ExampleDevice::_parameters
private

Parameters.

Definition at line 36 of file ExampleDevice.h.


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


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