libzmq master
The Intelligent Transport Layer
Public Types | Public Member Functions | Private Member Functions | Private Attributes

zmq::atomic_counter_t Class Reference

#include <atomic_counter.hpp>

Collaboration diagram for zmq::atomic_counter_t:

List of all members.

Public Types

typedef uint32_t integer_t

Public Member Functions

 atomic_counter_t (integer_t value_=0)
 ~atomic_counter_t ()
integer_t add (integer_t increment_)
integer_t get ()
void set (integer_t value_)
bool sub (integer_t decrement)

Private Member Functions

 atomic_counter_t (const atomic_counter_t &)
const atomic_counter_toperator= (const atomic_counter_t &)

Private Attributes

mutex_t sync
volatile integer_t value

Detailed Description

Definition at line 55 of file atomic_counter.hpp.


Member Typedef Documentation

Definition at line 59 of file atomic_counter.hpp.


Constructor & Destructor Documentation

zmq::atomic_counter_t::atomic_counter_t ( integer_t  value_ = 0) [inline]

Definition at line 61 of file atomic_counter.hpp.

zmq::atomic_counter_t::~atomic_counter_t ( ) [inline]

Definition at line 66 of file atomic_counter.hpp.

zmq::atomic_counter_t::atomic_counter_t ( const atomic_counter_t ) [private]

Member Function Documentation

integer_t zmq::atomic_counter_t::add ( integer_t  increment_) [inline]

Definition at line 77 of file atomic_counter.hpp.

References zmq::mutex_t::lock(), sync, zmq::mutex_t::unlock(), and value.

Here is the call graph for this function:

integer_t zmq::atomic_counter_t::get ( ) [inline]

Definition at line 133 of file atomic_counter.hpp.

References value.

const atomic_counter_t& zmq::atomic_counter_t::operator= ( const atomic_counter_t ) [private]
void zmq::atomic_counter_t::set ( integer_t  value_) [inline]

Definition at line 71 of file atomic_counter.hpp.

References value.

bool zmq::atomic_counter_t::sub ( integer_t  decrement) [inline]

Definition at line 104 of file atomic_counter.hpp.

References zmq::mutex_t::lock(), sync, zmq::mutex_t::unlock(), and value.

Here is the call graph for this function:


Member Data Documentation

Definition at line 142 of file atomic_counter.hpp.

Referenced by add(), and sub().

Definition at line 140 of file atomic_counter.hpp.

Referenced by add(), get(), set(), and sub().


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines