Apache Mesos
Public Types | Static Public Member Functions | List of all members
process::Clock Class Reference

Provides timers. More...

#include <clock.hpp>

Public Types

enum  Update { SAFE, FORCE }
 

Static Public Member Functions

static void initialize (lambda::function< void(const std::list< Timer > &)> &&callback)
 Initialize the clock with the specified callback that will be invoked whenever a batch of timers has expired. More...
 
static void finalize ()
 Clears all timers without executing them. More...
 
static Time now ()
 The current clock time for either the current process that makes this call or the global clock time if not invoked from a process. More...
 
static Time now (ProcessBase *process)
 
static Timer timer (const Duration &duration, const lambda::function< void()> &thunk)
 
static bool cancel (const Timer &timer)
 
static void pause ()
 Pauses the clock e.g. More...
 
static bool paused ()
 Check whether clock is currently running. More...
 
static void resume ()
 
static void advance (const Duration &duration)
 
static void advance (ProcessBase *process, const Duration &duration)
 
static void update (const Time &time)
 
static void update (ProcessBase *process, const Time &time, Update update=SAFE)
 
static void order (ProcessBase *from, ProcessBase *to)
 
static void settle ()
 
static bool settled ()
 

Detailed Description

Provides timers.

Member Enumeration Documentation

Enumerator
SAFE 

Don't update Clock for a process if going backwards in time.

FORCE 

Update Clock even if going backwards in time.

Member Function Documentation

static void process::Clock::advance ( const Duration duration)
static
static void process::Clock::advance ( ProcessBase process,
const Duration duration 
)
static
static bool process::Clock::cancel ( const Timer timer)
static
static void process::Clock::finalize ( )
static

Clears all timers without executing them.

The process manager must be properly finalized before the clock is finalized. This will eliminate the need for timers to activate and prevent further timers from being added after finalization.

Also, the Clock must not be paused when finalizing.

static void process::Clock::initialize ( lambda::function< void(const std::list< Timer > &)> &&  callback)
static

Initialize the clock with the specified callback that will be invoked whenever a batch of timers has expired.

static Time process::Clock::now ( )
static

The current clock time for either the current process that makes this call or the global clock time if not invoked from a process.

Returns
This process' current clock time or the global clock time if not invoked from a process.
static Time process::Clock::now ( ProcessBase process)
static
static void process::Clock::order ( ProcessBase from,
ProcessBase to 
)
static
static void process::Clock::pause ( )
static

Pauses the clock e.g.

for testing purposes.

static bool process::Clock::paused ( )
static

Check whether clock is currently running.

static void process::Clock::resume ( )
static
static void process::Clock::settle ( )
static
static bool process::Clock::settled ( )
static
static Timer process::Clock::timer ( const Duration duration,
const lambda::function< void()> &  thunk 
)
static
static void process::Clock::update ( const Time time)
static
static void process::Clock::update ( ProcessBase process,
const Time time,
Update  update = SAFE 
)
static

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