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

#include <decoder_allocators.hpp>

Inheritance diagram for zmq::shared_message_memory_allocator:
Collaboration diagram for zmq::shared_message_memory_allocator:

Public Member Functions

 shared_message_memory_allocator (std::size_t bufsize_)
 
 shared_message_memory_allocator (std::size_t bufsize_, std::size_t maxMessages)
 
 ~shared_message_memory_allocator ()
 
void advance_content ()
 
unsigned char * allocate ()
 
unsigned char * buffer ()
 
unsigned char * data ()
 
void deallocate ()
 
void inc_ref ()
 
zmq::msg_t::content_tprovide_content ()
 
unsigned char * release ()
 
void resize (std::size_t new_size)
 
std::size_t size () const
 

Static Public Member Functions

static void call_dec_ref (void *, void *buffer)
 

Private Attributes

unsigned char * buf
 
std::size_t bufsize
 
std::size_t max_size
 
std::size_t maxCounters
 
zmq::msg_t::content_tmsg_content
 

Detailed Description

Definition at line 93 of file decoder_allocators.hpp.

Constructor & Destructor Documentation

zmq::shared_message_memory_allocator::shared_message_memory_allocator ( std::size_t  bufsize_)
explicit

Definition at line 37 of file decoder_allocators.cpp.

zmq::shared_message_memory_allocator::shared_message_memory_allocator ( std::size_t  bufsize_,
std::size_t  maxMessages 
)

Definition at line 46 of file decoder_allocators.cpp.

zmq::shared_message_memory_allocator::~shared_message_memory_allocator ( )

Definition at line 55 of file decoder_allocators.cpp.

References deallocate().

Here is the call graph for this function:

Member Function Documentation

void zmq::shared_message_memory_allocator::advance_content ( )
inline

Definition at line 141 of file decoder_allocators.hpp.

Referenced by zmq::raw_decoder_t::decode(), and zmq::v2_decoder_t::size_ready().

Here is the caller graph for this function:

unsigned char * zmq::shared_message_memory_allocator::allocate ( )

Definition at line 60 of file decoder_allocators.cpp.

References alloc_assert, buf, bufsize, max_size, maxCounters, msg_content, release(), zmq::atomic_counter_t::set(), and zmq::atomic_counter_t::sub().

Referenced by zmq::raw_decoder_t::get_buffer().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char* zmq::shared_message_memory_allocator::buffer ( )
inline

Definition at line 126 of file decoder_allocators.hpp.

References zmq::c_single_allocator::buf.

Referenced by zmq::raw_decoder_t::decode(), and zmq::v2_decoder_t::size_ready().

Here is the caller graph for this function:

void zmq::shared_message_memory_allocator::call_dec_ref ( void *  ,
void *  buffer 
)
static

Definition at line 122 of file decoder_allocators.cpp.

References buf, zmq_assert, and zmq::atomic_counter_t::~atomic_counter_t().

Referenced by zmq::raw_decoder_t::decode(), and zmq::v2_decoder_t::size_ready().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char * zmq::shared_message_memory_allocator::data ( )

Definition at line 141 of file decoder_allocators.cpp.

References buf.

Referenced by zmq::v2_decoder_t::size_ready().

Here is the caller graph for this function:

void zmq::shared_message_memory_allocator::deallocate ( )

Definition at line 98 of file decoder_allocators.cpp.

References buf, release(), and zmq::atomic_counter_t::sub().

Referenced by ~shared_message_memory_allocator().

Here is the call graph for this function:

Here is the caller graph for this function:

void zmq::shared_message_memory_allocator::inc_ref ( )

Definition at line 117 of file decoder_allocators.cpp.

References buf.

Referenced by zmq::v2_decoder_t::size_ready().

Here is the caller graph for this function:

zmq::msg_t::content_t* zmq::shared_message_memory_allocator::provide_content ( )
inline

Definition at line 136 of file decoder_allocators.hpp.

Referenced by zmq::raw_decoder_t::decode(), and zmq::v2_decoder_t::size_ready().

Here is the caller graph for this function:

unsigned char * zmq::shared_message_memory_allocator::release ( )

Definition at line 107 of file decoder_allocators.cpp.

References buf, bufsize, and msg_content.

Referenced by allocate(), deallocate(), and zmq::raw_decoder_t::decode().

Here is the caller graph for this function:

void zmq::shared_message_memory_allocator::resize ( std::size_t  new_size)
inline

Definition at line 131 of file decoder_allocators.hpp.

References zmq::c_single_allocator::bufsize.

std::size_t zmq::shared_message_memory_allocator::size ( ) const

Definition at line 136 of file decoder_allocators.cpp.

References bufsize.

Referenced by zmq::raw_decoder_t::get_buffer(), and zmq::v2_decoder_t::size_ready().

Here is the caller graph for this function:

Member Data Documentation

unsigned char* zmq::shared_message_memory_allocator::buf
private

Definition at line 147 of file decoder_allocators.hpp.

Referenced by allocate(), call_dec_ref(), data(), deallocate(), inc_ref(), and release().

std::size_t zmq::shared_message_memory_allocator::bufsize
private

Definition at line 148 of file decoder_allocators.hpp.

Referenced by allocate(), release(), and size().

std::size_t zmq::shared_message_memory_allocator::max_size
private

Definition at line 149 of file decoder_allocators.hpp.

Referenced by allocate().

std::size_t zmq::shared_message_memory_allocator::maxCounters
private

Definition at line 151 of file decoder_allocators.hpp.

Referenced by allocate().

zmq::msg_t::content_t* zmq::shared_message_memory_allocator::msg_content
private

Definition at line 150 of file decoder_allocators.hpp.

Referenced by allocate(), and release().