Profile.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <swarmio/Endpoint.h>
4 #include <swarmio/Mailbox.h>
9 
10 namespace swarmio::profiles
11 {
16  class Profile : public Mailbox
17  {
18  protected:
19 
25 
31 
37 
45  Profile(Endpoint* endpoint, bool performActiveDiscovery)
46  : Mailbox(endpoint),
47  _discoveryService(endpoint, performActiveDiscovery),
48  _pingService(endpoint), _telemetryService(endpoint)
49  {
50  _discoveryService.RegisterDiscoverable(&_pingService);
51  _discoveryService.RegisterDiscoverable(&_telemetryService);
52  }
53 
54  public:
55 
62  {
63  return _discoveryService;
64  }
65 
72  {
73  return _pingService;
74  }
75 
82  {
83  return _telemetryService;
84  }
85 
90  virtual ~Profile()
91  {
92  _discoveryService.UnregisterDiscoverable(&_telemetryService);
93  _discoveryService.UnregisterDiscoverable(&_pingService);
94  }
95  };
96 }
virtual ~Profile()
Destroy the Profile object.
Definition: Profile.h:90
void RegisterDiscoverable(Discoverable *discoverable)
Register a new Discoverable service.
Telemetry Service can subscribe to receive updates from remote nodes on named values.
The Discovery Service makes it possible to query remote nodes for services.
Profile(Endpoint *endpoint, bool performActiveDiscovery)
Construct a new Profile.
Definition: Profile.h:45
swarmio::services::discovery::Service _discoveryService
Discovery service.
Definition: Profile.h:24
swarmio::services::telemetry::Service _telemetryService
Telemetry service.
Definition: Profile.h:36
void UnregisterDiscoverable(Discoverable *discoverable)
Unregister a Discoverable service.
Abstract base class for Endpoint implementations.
Definition: Endpoint.h:25
swarmio::services::telemetry::Service & GetTelemetryService()
Get a reference for the Telemetry service.
Definition: Profile.h:81
Ping Service dispatches and responds to ping requests, and measures the time between the request and ...
Definition: ping/Service.h:15
swarmio::services::discovery::Service & GetDiscoveryService()
Get a reference for the Discovery service.
Definition: Profile.h:61
Base class for profiles.
Definition: Profile.h:16
swarmio::services::ping::Service & GetPingService()
Get a reference for the Ping service.
Definition: Profile.h:71
swarmio::services::ping::Service _pingService
Ping service.
Definition: Profile.h:30
Abstract base class for Mailbox implementations.
Definition: Mailbox.h:13


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