Public Member Functions | Protected Member Functions | Private Attributes | List of all members
swarmio::services::telemetry::UpdateAwaiter Class Referencefinal

An Awaiter that has a longer lifetime and is updated periodically. More...

#include <UpdateAwaiter.h>

Inheritance diagram for swarmio::services::telemetry::UpdateAwaiter:
Inheritance graph
[legend]

Public Member Functions

const NodeGetTarget () const
 Get target node. More...
 
virtual void MailboxWillBeDisconnected () noexceptoverride
 On disconnect, an unsubscribe request is sent in order to stop the flow of messages gracefully. More...
 
 UpdateAwaiter (Endpoint *endpoint, uint64_t requestIdentifier, const Node *target)
 Construct a new UpdateAwaiter object. More...
 
- Public Member Functions inherited from swarmio::services::Awaiter< data::telemetry::Update >
 Awaiter (Endpoint *endpoint, uint64_t requestIdentifier)
 Construct a new ResponseAwaiter object. More...
 
 Awaiter (const data::telemetry::Update &value)
 Construct an awaiter with a cached value. More...
 
 Awaiter (Awaiter &&other)
 Move an Awaiter object. More...
 
uint64_t GetIdentifier () const
 Get request identifier. More...
 
data::telemetry::Update GetResponse ()
 Get the response value. Will throw an exception if called before the response is received. More...
 
bool HasException ()
 Checks whether the result of the processing has ended with an exception. More...
 
virtual bool ReceiveMessage (const Node *sender, const data::Message *message) override
 Delivery point of all messages. More...
 
bool WaitForResponse (const std::chrono::milliseconds &timeout)
 Wait for the response to become available or util the timeout period ellapses. 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 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...
 

Protected Member Functions

virtual data::telemetry::Update ExtractResponse (const Node *node, const data::Message *message) override
 Called when a response for the original message has been received. More...
 
virtual bool IsFinished () override
 Telemetry update awaiters remain valid for their entire lifetime. 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...
 

Private Attributes

const Node_target
 Target node. More...
 

Detailed Description

An Awaiter that has a longer lifetime and is updated periodically.

Definition at line 12 of file UpdateAwaiter.h.

Constructor & Destructor Documentation

swarmio::services::telemetry::UpdateAwaiter::UpdateAwaiter ( Endpoint endpoint,
uint64_t  requestIdentifier,
const Node target 
)
inline

Construct a new UpdateAwaiter object.

Parameters
endpointEndpoint
requestIdentifierOriginal message identifier

Definition at line 60 of file UpdateAwaiter.h.

Member Function Documentation

virtual data::telemetry::Update swarmio::services::telemetry::UpdateAwaiter::ExtractResponse ( const Node node,
const data::Message *  message 
)
inlineoverrideprotectedvirtual

Called when a response for the original message has been received.

Parameters
nodeSender node
messageMessage

Implements swarmio::services::Awaiter< data::telemetry::Update >.

Definition at line 30 of file UpdateAwaiter.h.

const Node* swarmio::services::telemetry::UpdateAwaiter::GetTarget ( ) const
inline

Get target node.

Returns
const Node* Target

Definition at line 87 of file UpdateAwaiter.h.

virtual bool swarmio::services::telemetry::UpdateAwaiter::IsFinished ( )
inlineoverrideprotectedvirtual

Telemetry update awaiters remain valid for their entire lifetime.

Returns
Always true

Reimplemented from swarmio::services::Awaiter< data::telemetry::Update >.

Definition at line 47 of file UpdateAwaiter.h.

virtual void swarmio::services::telemetry::UpdateAwaiter::MailboxWillBeDisconnected ( )
inlineoverridevirtualnoexcept

On disconnect, an unsubscribe request is sent in order to stop the flow of messages gracefully.

Reimplemented from swarmio::Mailbox.

Definition at line 71 of file UpdateAwaiter.h.

Member Data Documentation

const Node* swarmio::services::telemetry::UpdateAwaiter::_target
private

Target node.

Definition at line 20 of file UpdateAwaiter.h.


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


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