ACE 8.0.5
Loading...
Searching...
No Matches
Message_Block.h File Reference

Classes

class  ACE_Data_Block
 Stores the data payload that is accessed via one or more ACE_Message_Block's. More...

Functions

 ACE_Message_Block (ACE_Data_Block *data_block, Message_Flags flags=0, ACE_Allocator *message_block_allocator=0)
 ACE_Message_Block (const char *data, size_t size=0, unsigned long priority=ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY)
 ACE_Message_Block (size_t size, ACE_Message_Type type=MB_DATA, ACE_Message_Block *cont=nullptr, const char *data=nullptr, ACE_Allocator *allocator_strategy=nullptr, ACE_Lock *locking_strategy=nullptr, unsigned long priority=ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY, const ACE_Time_Value &execution_time=ACE_Time_Value::zero, const ACE_Time_Value &deadline_time=ACE_Time_Value::max_time, ACE_Allocator *data_block_allocator=nullptr, ACE_Allocator *message_block_allocator=nullptr)
 ACE_Message_Block (const ACE_Message_Block &mb, size_t align)
int init (const char *data, size_t size=0)
int init (size_t size, ACE_Message_Type type=MB_DATA, ACE_Message_Block *cont=0, const char *data=0, ACE_Allocator *allocator_strategy=0, ACE_Lock *locking_strategy=0, unsigned long priority=ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY, const ACE_Time_Value &execution_time=ACE_Time_Value::zero, const ACE_Time_Value &deadline_time=ACE_Time_Value::max_time, ACE_Allocator *data_block_allocator=0, ACE_Allocator *message_block_allocator=0)
virtual ~ACE_Message_Block ()
ACE_Message_Type msg_type () const
 Get type of the message.
void msg_type (ACE_Message_Type type)
 Set type of the message.
int is_data_msg () const
 Find out what type of message this is.
ACE_Message_Type msg_class () const
 Find out what class of message this is (there are two classes, normal messages and high-priority messages).
Message_Flags set_flags (Message_Flags more_flags)
 Bitwise-or the more_flags into the existing message flags and return the new value.
Message_Flags clr_flags (Message_Flags less_flags)
 Clear the message flag bits specified in less_flags and return the new value.
Message_Flags flags () const
 Get the current message flags.
Message_Flags set_self_flags (ACE_Message_Block::Message_Flags more_flags)
 Bitwise-or the more_flags into the existing message flags and return the new value.
Message_Flags clr_self_flags (ACE_Message_Block::Message_Flags less_flags)
 Clear the message flag bits specified in less_flags and return the new value.
Message_Flags self_flags () const
 Get the current message flags.
unsigned long msg_priority () const
 Get priority of the message.
void msg_priority (unsigned long priority)
 Set priority of the message.
const ACE_Time_Valuemsg_execution_time () const
 Get execution time associated with the message.
void msg_execution_time (const ACE_Time_Value &et)
 Set execution time associated with the message.
const ACE_Time_Valuemsg_deadline_time () const
 Get absolute time of deadline associated with the message.
void msg_deadline_time (const ACE_Time_Value &dt)
 Set absolute time of deadline associated with the message.
virtual ACE_Message_Blockclone (Message_Flags mask=0) const
 Return an exact "deep copy" of the message, i.e., create fresh new copies of all the Data_Blocks and continuations.
virtual ACE_Message_Blockduplicate () const
 Return a "shallow" copy that increments our reference count by 1.
static ACE_Message_Blockduplicate (const ACE_Message_Block *mb)
virtual ACE_Message_Blockrelease ()
static ACE_Message_Blockrelease (ACE_Message_Block *mb)
int copy (const char *buf, size_t n)
int copy (const char *buf)
int crunch ()
 Normalizes data in the top-level Message_Block to align with the base, i.e., it "shifts" the data pointed to by <rd_ptr> down to the <base> and then readjusts <rd_ptr> to point to <base> and <wr_ptr> to point to <base> + the length of the moved data. Returns -1 and does nothing if the <rd_ptr> is > <wr_ptr>, else 0 on success.
void reset ()
 Resets the Message Block data to contain nothing, i.e., sets the read and write pointers to align with the base.
void access_allocators (ACE_Allocator *&allocator_strategy, ACE_Allocator *&data_block_allocator, ACE_Allocator *&message_block_allocator)
 Access all the allocators in the message block.
void reset_allocators (ACE_Allocator *allocator_strategy=0, ACE_Allocator *data_block_allocator=0, ACE_Allocator *message_block_allocator=0)
 Reset all the allocators in the message block.
char * base () const
 Get message data.
void base (char *data, size_t size, Message_Flags=DONT_DELETE)
 Set message data (doesn't reallocate).
char * end () const
 Return a pointer to 1 past the end of the allocated data in a message.
char * mark () const
char * rd_ptr () const
 Get the read pointer.
void rd_ptr (char *ptr)
 Set the read pointer to ptr.
void rd_ptr (size_t n)
 Set the read pointer ahead n bytes.
char * wr_ptr () const
 Get the write pointer.
void wr_ptr (char *ptr)
 Set the write pointer to ptr.
void wr_ptr (size_t n)
 Set the write pointer ahead n bytes. This is used to compute the <length> of a message.

Message length and size operations

Message length is (wr_ptr - rd_ptr).

Message size is capacity of the message, including data outside the [rd_ptr,wr_ptr] range.

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
size_t rd_ptr_
 Pointer to beginning of next read.
size_t wr_ptr_
 Pointer to beginning of next write.
unsigned long priority_
 Priority of message.
ACE_Message_Blockcont_
 Pointer to next message block in the chain.
ACE_Message_Blocknext_
 Pointer to next message in the list.
ACE_Message_Blockprev_
 Pointer to previous message in the list.
ACE_Message_Block::Message_Flags flags_
 Misc flags (e.g., DONT_DELETE and USER_FLAGS).
ACE_Data_Blockdata_block_
 Pointer to the reference counted data structure that contains the actual memory buffer.
ACE_Allocatormessage_block_allocator_
 The allocator used to destroy ourselves when release is called and create new message blocks on duplicate.
size_t length () const
 Get the length of the message.
void length (size_t n)
 Set the length of the message.
size_t total_length () const
 Get the length of the Message_Blocks, including chained Message_Blocks.
size_t total_size () const
 Get the total number of bytes in all Message_Blocks, including chained Message_Blocks.
void total_size_and_length (size_t &mb_size, size_t &mb_length) const
 Get the total number of bytes and total length in all Message_Blocks, including chained Message_Blocks.
size_t size () const
 Get the number of bytes in the top-level Message_Block (i.e., does not consider the bytes in chained Message_Blocks).
int size (size_t length)
size_t total_capacity () const
 Get the number of allocated bytes in all Message_Block, including chained Message_Blocks.
size_t capacity () const
 Get the number of allocated bytes in the top-level Message_Block.
size_t space () const
 Get the number of bytes available after the <wr_ptr_> in the top-level Message_Block.
ACE_Data_Blockdata_block () const
void data_block (ACE_Data_Block *)
ACE_Data_Blockreplace_data_block (ACE_Data_Block *)
 Set a new data block pointer. A pointer to the original ACE_Data_Block is returned, and not released (as it is with <data_block>).
ACE_Message_Blockcont () const
 Get the continuation field.
void cont (ACE_Message_Block *)
 Set the continuation field.
ACE_Message_Blocknext () const
 Get link to next message.
void next (ACE_Message_Block *)
 Set link to next message.
ACE_Message_Blockprev () const
 Get link to prev message.
void prev (ACE_Message_Block *)
 Set link to prev message.
ACE_Locklocking_strategy ()
 Get the locking strategy.
ACE_Locklocking_strategy (ACE_Lock *)
 Set a new locking strategy and return the hold one.
int reference_count () const
 Get the current reference count.
void dump () const
 Dump the state of an object.
 ACE_Message_Block (size_t size, ACE_Message_Type type, ACE_Message_Block *cont, const char *data, ACE_Allocator *allocator_strategy, ACE_Lock *locking_strategy, Message_Flags flags, unsigned long priority, const ACE_Time_Value &execution_time, const ACE_Time_Value &deadline_time, ACE_Data_Block *db, ACE_Allocator *data_block_allocator, ACE_Allocator *message_block_allocator)
 Perform the actual initialization.
int release_i (ACE_Lock *lock)
 Internal release implementation Returns 1 if the data block has to be destroyed.
int init_i (size_t size, ACE_Message_Type type, ACE_Message_Block *cont, const char *data, ACE_Allocator *allocator_strategy, ACE_Lock *locking_strategy, Message_Flags flags, unsigned long priority, const ACE_Time_Value &execution_time, const ACE_Time_Value &deadline_time, ACE_Data_Block *db, ACE_Allocator *data_block_allocator, ACE_Allocator *message_block_allocator)
 Perform the actual initialization.
ACE_Message_Blockoperator= (const ACE_Message_Block &)
 Declare the dynamic allocation hooks.
 ACE_Message_Block (const ACE_Message_Block &)
 Declare the dynamic allocation hooks.

Detailed Description

Function Documentation

◆ access_allocators()

void ACE_Message_Block::access_allocators ( ACE_Allocator *& allocator_strategy,
ACE_Allocator *& data_block_allocator,
ACE_Allocator *& message_block_allocator )
inline

Access all the allocators in the message block.

Todo
Not sure whether we would need finer control while trying to access allocators ie. a method for every allocator.

This method returns the allocators only from the first message block in the chain.

Parameters
allocator_strategyStrategy used to allocate the underlying buffer
data_block_allocatorStrategy used to allocate the underlying data block
message_block_allocatorStrategy used to allocate the message block

◆ ACE_Message_Block() [1/6]

ACE_Message_Block ( ACE_Data_Block * data_block,
Message_Flags flags = 0,
ACE_Allocator * message_block_allocator = 0 )

◆ ACE_Message_Block() [2/6]

ACE_Message_Block ( const ACE_Message_Block & )
private

Declare the dynamic allocation hooks.

◆ ACE_Message_Block() [3/6]

ACE_Message_Block ( const ACE_Message_Block & mb,
size_t align )

A copy constructor. This constructor is a bit different. If the incoming Message Block has a data block from the stack this constructor does a deep copy ie. allocates a new data block on the heap and does a copy of the data from the incoming message block. As a final note, the alignment information is used to align the data block if it is created afresh. If the incoming mb has a data block has a data block allocated from the heap, then this constructor just duplicates (ie. a shallow copy) the data block of the incoming mb.

◆ ACE_Message_Block() [4/6]

ACE_Message_Block ( const char * data,
size_t size = 0,
unsigned long priority = ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY )

Create an ACE_Message_Block that refers to data without copying it. The data memory will not be freed when this block is destroyed; memory management of data is left to the caller. Note that the size of the new ACE_Message_Block will be size, but the length will be 0 until the write pointer is changed.

◆ ACE_Message_Block() [5/6]

ACE_Message_Block ( size_t size,
ACE_Message_Type type,
ACE_Message_Block * cont,
const char * data,
ACE_Allocator * allocator_strategy,
ACE_Lock * locking_strategy,
Message_Flags flags,
unsigned long priority,
const ACE_Time_Value & execution_time,
const ACE_Time_Value & deadline_time,
ACE_Data_Block * db,
ACE_Allocator * data_block_allocator,
ACE_Allocator * message_block_allocator )
protected

Perform the actual initialization.

◆ ACE_Message_Block() [6/6]

ACE_Message_Block ( size_t size,
ACE_Message_Type type = MB_DATA,
ACE_Message_Block * cont = nullptr,
const char * data = nullptr,
ACE_Allocator * allocator_strategy = nullptr,
ACE_Lock * locking_strategy = nullptr,
unsigned long priority = ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY,
const ACE_Time_Value & execution_time = ACE_Time_Value::zero,
const ACE_Time_Value & deadline_time = ACE_Time_Value::max_time,
ACE_Allocator * data_block_allocator = nullptr,
ACE_Allocator * message_block_allocator = nullptr )

Create an initialized message of type type containing size bytes. The cont argument initializes the continuation field in the ACE_Message_Block. If data == 0 then this block allocates and owns the block's memory, using allocator to get the data if it's non-0. If data != 0 then this block refers to that memory until this this block ceases to exist; this object will not free data on destruction. If locking_strategy is non-0 then this is used to protect regions of code that access shared state (e.g., reference counting) from race conditions. Note that the size of the ACE_Message_Block will be size, but the length will be 0 until the write pointer is set. The data_block_allocator is used to allocate the data blocks while the allocator_strategy is used to allocate the buffers contained by those. The message_block_allocator is used to allocate new ACE_Message_Block objects when the duplicate() method is called. If a message_block_allocator is given, this ACE_Message_Block and future ACE_Message_Block objects created by duplicate() will be freed using this allocator when they are released.

Note
If you use this allocator, the ACE_Message_Block you created should have been created using this allocator because it will be released to the same allocator.

◆ base() [1/2]

char * base ( ) const

Get message data.

◆ base() [2/2]

void base ( char * data,
size_t size,
Message_Flags = DONT_DELETE )

Set message data (doesn't reallocate).

◆ capacity()

size_t capacity ( ) const

Get the number of allocated bytes in the top-level Message_Block.

◆ clone()

virtual ACE_Message_Block * clone ( Message_Flags mask = 0) const
virtual

Return an exact "deep copy" of the message, i.e., create fresh new copies of all the Data_Blocks and continuations.

◆ clr_flags()

Message_Flags clr_flags ( Message_Flags less_flags)

Clear the message flag bits specified in less_flags and return the new value.

◆ clr_self_flags()

ACE_Message_Block::Message_Flags ACE_Message_Block::clr_self_flags ( ACE_Message_Block::Message_Flags less_flags)
inline

Clear the message flag bits specified in less_flags and return the new value.

◆ cont() [1/2]

ACE_Message_Block * ACE_Message_Block::cont ( ) const
inline

Get the continuation field.

◆ cont() [2/2]

void ACE_Message_Block::cont ( ACE_Message_Block * cont_msg)
inline

Set the continuation field.

◆ copy() [1/2]

int copy ( const char * buf)

Copies a 0-terminated character string into this ACE_Message_Block. The string is copied into the block starting at the current write pointer. The 0-terminator is included in the copied data.

Parameters
bufPointer to the character string to copy from.
Return values
0on success; the write pointer is advanced by the string's length, including the 0 terminator.
-1if the amount of free space following the write pointer in the block is less than required to hold the entire string. Free space can be checked by calling space().

◆ copy() [2/2]

int copy ( const char * buf,
size_t n )

Copies data into this ACE_Message_Block. Data is copied into the block starting at the current write pointer.

Parameters
bufPointer to the buffer to copy from.
nThe number of bytes to copy.
Return values
0on success; the write pointer is advanced by
  • n.
-1if the amount of free space following the write pointer in the block is less than
  • n. Free space can be checked by calling space().

◆ crunch()

int ACE_Message_Block::crunch ( )

Normalizes data in the top-level Message_Block to align with the base, i.e., it "shifts" the data pointed to by <rd_ptr> down to the <base> and then readjusts <rd_ptr> to point to <base> and <wr_ptr> to point to <base> + the length of the moved data. Returns -1 and does nothing if the <rd_ptr> is > <wr_ptr>, else 0 on success.

◆ data_block() [1/2]

ACE_Data_Block * ACE_Message_Block::data_block ( ) const
inline

Get a pointer to the data block. Note that the ACE_Message_Block still references the block; this call does not change the reference count.

◆ data_block() [2/2]

void ACE_Message_Block::data_block ( ACE_Data_Block * db)

Set a new data block pointer. The original ACE_Data_Block is released as a result of this call. If you need to keep the original block, call <replace_data_block> instead. Upon return, this ACE_Message_Block holds a pointer to the new ACE_Data_Block, taking over the reference you held on it prior to the call.

◆ dump()

void dump ( ) const

Dump the state of an object.

◆ duplicate() [1/2]

virtual ACE_Message_Block * duplicate ( ) const
virtual

Return a "shallow" copy that increments our reference count by 1.

◆ duplicate() [2/2]

ACE_Message_Block * duplicate ( const ACE_Message_Block * mb)
static

Return a "shallow" copy that increments our reference count by 1. This is similar to CORBA's _duplicate() method, which is useful if you want to eliminate lots of checks for NULL mb pointers before calling _duplicate() on them.

◆ end()

char * end ( ) const

Return a pointer to 1 past the end of the allocated data in a message.

◆ flags()

Message_Flags flags ( ) const

Get the current message flags.

◆ init() [1/2]

int init ( const char * data,
size_t size = 0 )

Create a Message Block that assumes it has ownership of data, but in reality it doesn't (i.e., cannot delete it since it didn't malloc it!). Note that the size of the Message_Block will be size, but the length will be 0 until <wr_ptr> is set.

◆ init() [2/2]

int init ( size_t size,
ACE_Message_Type type = MB_DATA,
ACE_Message_Block * cont = 0,
const char * data = 0,
ACE_Allocator * allocator_strategy = 0,
ACE_Lock * locking_strategy = 0,
unsigned long priority = ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY,
const ACE_Time_Value & execution_time = ACE_Time_Value::zero,
const ACE_Time_Value & deadline_time = ACE_Time_Value::max_time,
ACE_Allocator * data_block_allocator = 0,
ACE_Allocator * message_block_allocator = 0 )

Create an initialized message of type type containing size bytes. The cont argument initializes the continuation field in the Message_Block. If data == 0 then we create and own the data, using allocator_strategy to get the data if it's non-0. If data != 0 we assume that we have ownership of the data till this object ceases to exist (and don't delete it during destruction). If locking_strategy is non-0 then this is used to protect regions of code that access shared state (e.g., reference counting) from race conditions. Note that the size of the Message_Block will be size, but the length will be 0 until <wr_ptr> is set. The data_block_allocator is use to allocate the data blocks while the allocator_strategy is used to allocate the buffers contained by those.

◆ init_i()

int init_i ( size_t size,
ACE_Message_Type type,
ACE_Message_Block * cont,
const char * data,
ACE_Allocator * allocator_strategy,
ACE_Lock * locking_strategy,
Message_Flags flags,
unsigned long priority,
const ACE_Time_Value & execution_time,
const ACE_Time_Value & deadline_time,
ACE_Data_Block * db,
ACE_Allocator * data_block_allocator,
ACE_Allocator * message_block_allocator )
protected

Perform the actual initialization.

◆ is_data_msg()

int ACE_Message_Block::is_data_msg ( ) const
inline

Find out what type of message this is.

◆ length() [1/2]

size_t length ( ) const

Get the length of the message.

◆ length() [2/2]

void length ( size_t n)

Set the length of the message.

◆ locking_strategy() [1/2]

ACE_Lock * locking_strategy ( )

Get the locking strategy.

◆ locking_strategy() [2/2]

ACE_Lock * locking_strategy ( ACE_Lock * )

Set a new locking strategy and return the hold one.

◆ mark()

char * mark ( ) const

Return a pointer to 1 past the end of the allotted data in a message. Allotted data may be less than allocated data if a value smaller than capacity() to is passed to size().

◆ msg_class()

ACE_Message_Block::ACE_Message_Type ACE_Message_Block::msg_class ( ) const
inline

Find out what class of message this is (there are two classes, normal messages and high-priority messages).

◆ msg_deadline_time() [1/2]

const ACE_Time_Value & ACE_Message_Block::msg_deadline_time ( ) const
inline

Get absolute time of deadline associated with the message.

◆ msg_deadline_time() [2/2]

void ACE_Message_Block::msg_deadline_time ( const ACE_Time_Value & dt)
inline

Set absolute time of deadline associated with the message.

◆ msg_execution_time() [1/2]

const ACE_Time_Value & ACE_Message_Block::msg_execution_time ( ) const
inline

Get execution time associated with the message.

◆ msg_execution_time() [2/2]

void ACE_Message_Block::msg_execution_time ( const ACE_Time_Value & et)
inline

Set execution time associated with the message.

◆ msg_priority() [1/2]

unsigned long ACE_Message_Block::msg_priority ( ) const
inline

Get priority of the message.

◆ msg_priority() [2/2]

void ACE_Message_Block::msg_priority ( unsigned long priority)
inline

Set priority of the message.

◆ msg_type() [1/2]

ACE_Message_Type msg_type ( ) const

Get type of the message.

◆ msg_type() [2/2]

void msg_type ( ACE_Message_Type type)

Set type of the message.

◆ next() [1/2]

ACE_Message_Block * next ( ) const

Get link to next message.

◆ next() [2/2]

void next ( ACE_Message_Block * )

Set link to next message.

◆ operator=()

ACE_Message_Block & operator= ( const ACE_Message_Block & )
private

Declare the dynamic allocation hooks.

◆ prev() [1/2]

ACE_Message_Block * prev ( ) const

Get link to prev message.

◆ prev() [2/2]

void prev ( ACE_Message_Block * )

Set link to prev message.

◆ rd_ptr() [1/3]

char * rd_ptr ( ) const

Get the read pointer.

◆ rd_ptr() [2/3]

void rd_ptr ( char * ptr)

Set the read pointer to ptr.

◆ rd_ptr() [3/3]

void rd_ptr ( size_t n)

Set the read pointer ahead n bytes.

◆ reference_count()

int reference_count ( ) const

Get the current reference count.

◆ release() [1/2]

virtual ACE_Message_Block * release ( )
virtual

Decrease the shared ACE_Data_Block's reference count by 1. If the ACE_Data_Block's reference count goes to 0, it is deleted. In all cases, this ACE_Message_Block is deleted - it must have come from the heap, or there will be trouble.

release() is designed to release the continuation chain; the destructor is not. If we make the destructor release the continuation chain by calling release() or delete on the message blocks in the continuation chain, the following code will not work since the message block in the continuation chain is not off the heap:

ACE_Message_Block mb1 (1024); ACE_Message_Block mb2 (1024);

mb1.cont (&mb2);

And hence, call release() on a dynamically allocated message block. This will release all the message blocks in the continuation chain. If you call delete or let the message block fall off the stack, cleanup of the message blocks in the continuation chain becomes the responsibility of the user.

Return values
0,always,andthe object this method was invoked on is no longer valid.

◆ release() [2/2]

ACE_Message_Block * release ( ACE_Message_Block * mb)
static

This behaves like the non-static method release(), except that it checks if mb is 0. This is similar to CORBA::release(), which is useful if you want to eliminate lots of checks for NULL pointers before calling release() on them. Returns mb.

◆ release_i()

int release_i ( ACE_Lock * lock)
protected

Internal release implementation Returns 1 if the data block has to be destroyed.

◆ replace_data_block()

ACE_Data_Block * ACE_Message_Block::replace_data_block ( ACE_Data_Block * db)
inline

Set a new data block pointer. A pointer to the original ACE_Data_Block is returned, and not released (as it is with <data_block>).

◆ reset()

void reset ( )

Resets the Message Block data to contain nothing, i.e., sets the read and write pointers to align with the base.

◆ reset_allocators()

void ACE_Message_Block::reset_allocators ( ACE_Allocator * allocator_strategy = 0,
ACE_Allocator * data_block_allocator = 0,
ACE_Allocator * message_block_allocator = 0 )
inline

Reset all the allocators in the message block.

Todo
Not sure whether we would need finer control while trying to reset allocators ie. a method for every allocator.

This method resets the allocators in all the message blocks in the chain.

◆ self_flags()

ACE_Message_Block::Message_Flags ACE_Message_Block::self_flags ( ) const
inline

Get the current message flags.

◆ set_flags()

Message_Flags set_flags ( Message_Flags more_flags)

Bitwise-or the more_flags into the existing message flags and return the new value.

◆ set_self_flags()

ACE_Message_Block::Message_Flags ACE_Message_Block::set_self_flags ( ACE_Message_Block::Message_Flags more_flags)
inline

Bitwise-or the more_flags into the existing message flags and return the new value.

Todo
I think the following set of methods could not be used at all. May be they are useless. Let us have it so that we don't mess up memory management of the Message_Block. Somebody correct me if I am totally totally wrong..

◆ size() [1/2]

size_t size ( ) const

Get the number of bytes in the top-level Message_Block (i.e., does not consider the bytes in chained Message_Blocks).

◆ size() [2/2]

int size ( size_t length)

Set the number of bytes in the top-level Message_Block, reallocating space if necessary. However, the rd_ptr_ and wr_ptr_ remain at the original offsets into the buffer, even if it is reallocated. Returns 0 if successful, else -1.

◆ space()

size_t ACE_Message_Block::space ( ) const
inline

Get the number of bytes available after the <wr_ptr_> in the top-level Message_Block.

◆ total_capacity()

size_t ACE_Message_Block::total_capacity ( ) const

Get the number of allocated bytes in all Message_Block, including chained Message_Blocks.

◆ total_length()

size_t total_length ( ) const

Get the length of the Message_Blocks, including chained Message_Blocks.

◆ total_size()

size_t total_size ( ) const

Get the total number of bytes in all Message_Blocks, including chained Message_Blocks.

◆ total_size_and_length()

void ACE_Message_Block::total_size_and_length ( size_t & mb_size,
size_t & mb_length ) const

Get the total number of bytes and total length in all Message_Blocks, including chained Message_Blocks.

◆ wr_ptr() [1/3]

char * wr_ptr ( ) const

Get the write pointer.

◆ wr_ptr() [2/3]

void wr_ptr ( char * ptr)

Set the write pointer to ptr.

◆ wr_ptr() [3/3]

void wr_ptr ( size_t n)

Set the write pointer ahead n bytes. This is used to compute the <length> of a message.

◆ ~ACE_Message_Block()

ACE_Message_Block::~ACE_Message_Block ( )
virtual

Delete all the resources held in the message.

Note
Note that release() is designed to release the continuation chain; the destructor is not. See release() for details.

Variable Documentation

◆ ACE_ALLOC_HOOK_DECLARE

ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ cont_

ACE_Message_Block* cont_
protected

Pointer to next message block in the chain.

◆ data_block_

ACE_Data_Block* data_block_
protected

Pointer to the reference counted data structure that contains the actual memory buffer.

◆ flags_

ACE_Message_Block::Message_Flags flags_
protected

Misc flags (e.g., DONT_DELETE and USER_FLAGS).

◆ message_block_allocator_

ACE_Allocator* message_block_allocator_
protected

The allocator used to destroy ourselves when release is called and create new message blocks on duplicate.

◆ next_

ACE_Message_Block* next_
protected

Pointer to next message in the list.

◆ prev_

ACE_Message_Block* prev_
protected

Pointer to previous message in the list.

◆ priority_

unsigned long priority_
protected

Priority of message.

◆ rd_ptr_

size_t rd_ptr_
protected

Pointer to beginning of next read.

◆ wr_ptr_

size_t wr_ptr_
protected

Pointer to beginning of next write.