TimingAwaiter.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <chrono>
5 
7 {
12  class SWARMIO_API TimingAwaiter final : public Awaiter<std::chrono::nanoseconds>
13  {
14  private:
15 
20  std::chrono::time_point<std::chrono::high_resolution_clock> _start;
21 
22  protected:
23 
30  virtual std::chrono::nanoseconds ExtractResponse(const Node* node, const data::Message* message) override;
31 
32  public:
33 
40  TimingAwaiter(Endpoint* endpoint, uint64_t requestIdentifier)
41  : Awaiter(endpoint, requestIdentifier)
42  {
43  _start = std::chrono::high_resolution_clock::now();
44  FinishConstruction();
45  }
46 
53  double GetResponseInMilliseconds();
54  };
55 }
A special mailbox that handles responses to a message.
Definition: Awaiter.h:19
An Awaiter that returns the roundtrip time of the Echo message.
Definition: TimingAwaiter.h:12
TimingAwaiter(Endpoint *endpoint, uint64_t requestIdentifier)
Construct a new TimingAwaiter object.
Definition: TimingAwaiter.h:40
Abstract base class for Endpoint implementations.
Definition: Endpoint.h:25
Represents a Node the Endpoint knows about and can send messages to.
std::chrono::time_point< std::chrono::high_resolution_clock > _start
When the ping request was sent.
Definition: TimingAwaiter.h:20


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