ExampleDevice.h
Go to the documentation of this file.
1 #pragma once
2 
6 #include <list>
7 
9 {
17  {
18  private:
19 
24  uint32_t _messageCounter = 0;
25 
30  std::list<FauxEventHandler*> _eventHandlers;
31 
36  std::list<InMemoryParameter*> _parameters;
37 
38  public:
39 
45  ExampleDevice(Endpoint* endpoint);
46 
52  void AddFauxEventHandler(FauxEventHandler* eventHandler);
53 
59  void AddInMemoryParameter(InMemoryParameter* parameter);
60 
69  void AddConstantTelemetryValue(const std::string& key, const data::Variant& value, bool includeInStatus = false);
70 
79  virtual bool ReceiveMessage(const Node* sender, const data::Message* message) override;
80 
85  ~ExampleDevice() override;
86  };
87 }
88 
A special event handler that serves discovery information and ignores the event itself.
Service profile for swarm members.
Definition: MemberProfile.h:14
std::list< InMemoryParameter * > _parameters
Parameters.
Definition: ExampleDevice.h:36
A strongly typed in-memory parameter target that can be made read-only.
void AddFauxEventHandler(FauxEventHandler *eventHandler)
Add an event handler and register it.
ExampleDevice(Endpoint *endpoint)
Construct a new Example Device object.
void AddInMemoryParameter(InMemoryParameter *parameter)
Add an In-Memory Parameter and register it.
Abstract base class for Endpoint implementations.
Definition: Endpoint.h:25
Represents a collection of standard services that can be used to simulate an ordinary device...
Definition: ExampleDevice.h:16
std::list< FauxEventHandler * > _eventHandlers
Event handlers.
Definition: ExampleDevice.h:30
uint32_t _messageCounter
Number of incoming messages.
Definition: ExampleDevice.h:24
~ExampleDevice() override
Destroy the Example Device object.
Represents a Node the Endpoint knows about and can send messages to.
void AddConstantTelemetryValue(const std::string &key, const data::Variant &value, bool includeInStatus=false)
Add a constant telemetry value.
virtual bool ReceiveMessage(const Node *sender, const data::Message *message) override
Delivery point of all messages.


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