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

#include <atomic_counter.hpp>

Collaboration diagram for zmq::atomic_counter_t:

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 () const
 
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 74 of file atomic_counter.hpp.

Member Typedef Documentation

Definition at line 78 of file atomic_counter.hpp.

Constructor & Destructor Documentation

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

Definition at line 80 of file atomic_counter.hpp.

zmq::atomic_counter_t::~atomic_counter_t ( )
inline

Definition at line 85 of file atomic_counter.hpp.

Referenced by zmq::shared_message_memory_allocator::call_dec_ref().

Here is the caller graph for this function:

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 96 of file atomic_counter.hpp.

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

Referenced by zmq::metadata_t::add_ref(), zmq::msg_t::add_refs(), zmq::poller_base_t::adjust_load(), zmq::msg_t::copy(), zmq::ctx_t::create_socket(), and zmq::own_t::inc_seqnum().

Here is the call graph for this function:

Here is the caller graph for this function:

integer_t zmq::atomic_counter_t::get ( ) const
inline

Definition at line 195 of file atomic_counter.hpp.

References value.

Referenced by zmq::own_t::check_term_acks(), and zmq::poller_base_t::get_load().

Here is the caller graph for this function:

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 90 of file atomic_counter.hpp.

References value.

Referenced by zmq::msg_t::add_refs(), zmq::shared_message_memory_allocator::allocate(), and zmq::msg_t::copy().

Here is the caller graph for this function:

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

Definition at line 142 of file atomic_counter.hpp.

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

Referenced by zmq::poller_base_t::adjust_load(), zmq::shared_message_memory_allocator::allocate(), zmq::shared_message_memory_allocator::deallocate(), and zmq::metadata_t::drop_ref().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

mutex_t zmq::atomic_counter_t::sync
private

Definition at line 209 of file atomic_counter.hpp.

Referenced by add(), and sub().

volatile integer_t zmq::atomic_counter_t::value
private

Definition at line 205 of file atomic_counter.hpp.

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