libzmq  master
ZeroMQ C++ Core Engine (LIBZMQ)
zmq::timers_t Class Reference

#include <timers.hpp>

Collaboration diagram for zmq::timers_t:

Classes

struct  timer_t
 

Public Member Functions

 timers_t ()
 
 ~timers_t ()
 
int add (size_t interval, timers_timer_fn handler, void *arg)
 
int cancel (int timer_id)
 
bool check_tag ()
 
int execute ()
 
int reset (int timer_id)
 
int set_interval (int timer_id, size_t interval)
 
long timeout ()
 

Private Types

typedef std::set< intcancelled_timers_t
 
typedef struct zmq::timers_t::timer_t timer_t
 
typedef std::multimap< uint64_t, timer_ttimersmap_t
 

Private Member Functions

 timers_t (const timers_t &)
 
const timers_toperator= (const timers_t &)
 

Private Attributes

cancelled_timers_t cancelled_timers
 
clock_t clock
 
int next_timer_id
 
uint32_t tag
 
timersmap_t timers
 

Detailed Description

Definition at line 44 of file timers.hpp.

Member Typedef Documentation

typedef std::set<int> zmq::timers_t::cancelled_timers_t
private

Definition at line 100 of file timers.hpp.

typedef std::multimap<uint64_t, timer_t> zmq::timers_t::timersmap_t
private

Definition at line 97 of file timers.hpp.

Constructor & Destructor Documentation

zmq::timers_t::timers_t ( )

Definition at line 34 of file timers.cpp.

zmq::timers_t::~timers_t ( )

Definition at line 41 of file timers.cpp.

References tag.

zmq::timers_t::timers_t ( const timers_t )
private

Member Function Documentation

int zmq::timers_t::add ( size_t  interval,
timers_timer_fn  handler,
void *  arg 
)

Definition at line 52 of file timers.cpp.

References clock, next_timer_id, zmq::clock_t::now_ms(), zmq::timers_t::timer_t::timer_id, and timers.

Here is the call graph for this function:

int zmq::timers_t::cancel ( int  timer_id)

Definition at line 61 of file timers.cpp.

References cancelled_timers.

bool zmq::timers_t::check_tag ( )

Definition at line 47 of file timers.cpp.

References tag.

int zmq::timers_t::execute ( )
const timers_t& zmq::timers_t::operator= ( const timers_t )
private
int zmq::timers_t::reset ( int  timer_id)

Definition at line 93 of file timers.cpp.

References clock, zmq::timers_t::timer_t::interval, zmq::clock_t::now_ms(), and timers.

Here is the call graph for this function:

int zmq::timers_t::set_interval ( int  timer_id,
size_t  interval 
)

Definition at line 75 of file timers.cpp.

References clock, zmq::timers_t::timer_t::interval, zmq::clock_t::now_ms(), and timers.

Here is the call graph for this function:

long zmq::timers_t::timeout ( )

Definition at line 109 of file timers.cpp.

References cancelled_timers, clock, zmq::clock_t::now_ms(), and timers.

Here is the call graph for this function:

Member Data Documentation

cancelled_timers_t zmq::timers_t::cancelled_timers
private

Definition at line 101 of file timers.hpp.

Referenced by cancel(), execute(), and timeout().

clock_t zmq::timers_t::clock
private

Definition at line 88 of file timers.hpp.

Referenced by add(), execute(), reset(), set_interval(), and timeout().

int zmq::timers_t::next_timer_id
private

Definition at line 85 of file timers.hpp.

Referenced by add().

uint32_t zmq::timers_t::tag
private

Definition at line 83 of file timers.hpp.

Referenced by check_tag(), and ~timers_t().

timersmap_t zmq::timers_t::timers
private

Definition at line 98 of file timers.hpp.

Referenced by add(), execute(), reset(), set_interval(), and timeout().