libcaf  0.15.5
Public Types | Public Member Functions | List of all members
caf::actor_clock Class Referenceabstract

A monotonic clock for scheduling timeouts and delayed messages. More...

#include <actor_clock.hpp>

Public Types

using clock_type = std::chrono::steady_clock
 Underlying clock type.
 
using time_point = typename clock_type::time_point
 Discrete point in time.
 
using duration_type = typename clock_type::duration
 Difference between two points in time.
 

Public Member Functions

virtual time_point now () const noexcept
 Returns the current wall-clock time.
 
virtual duration_type difference (atom_value measurement, time_point t0, time_point t1) const noexcept
 Returns the difference between t0 and t1, allowing the clock to return any arbitrary value depending on the measurement that took place. More...
 
virtual void set_receive_timeout (time_point t, abstract_actor *self, uint32_t id)=0
 Schedules a timeout_msg for self at time point t, overriding any previous receive timeout. More...
 
virtual void set_request_timeout (time_point t, abstract_actor *self, message_id id)=0
 Schedules a sec::request_timeout for self at time point t.
 
virtual void cancel_receive_timeout (abstract_actor *self)=0
 Cancels a pending receive timeout.
 
virtual void cancel_request_timeout (abstract_actor *self, message_id id)=0
 Cancels the pending request timeout for id.
 
virtual void cancel_timeouts (abstract_actor *self)=0
 Cancels all timeouts for self.
 
virtual void schedule_message (time_point t, strong_actor_ptr receiver, mailbox_element_ptr content)=0
 Schedules an arbitrary message to receiver for time point t.
 
virtual void schedule_message (time_point t, group target, strong_actor_ptr sender, message content)=0
 Schedules an arbitrary message to target for time point t.
 

Detailed Description

A monotonic clock for scheduling timeouts and delayed messages.

Member Function Documentation

◆ difference()

virtual duration_type caf::actor_clock::difference ( atom_value  measurement,
time_point  t0,
time_point  t1 
) const
virtualnoexcept

Returns the difference between t0 and t1, allowing the clock to return any arbitrary value depending on the measurement that took place.

◆ set_receive_timeout()

virtual void caf::actor_clock::set_receive_timeout ( time_point  t,
abstract_actor self,
uint32_t  id 
)
pure virtual

Schedules a timeout_msg for self at time point t, overriding any previous receive timeout.


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