ACE 8.0.5
Loading...
Searching...
No Matches
ACE_Locked_Data_Block< ACE_LOCK > Class Template Reference

A Data_Block with a concrete locking strategy. More...

#include <Message_Block_T.h>

Inheritance diagram for ACE_Locked_Data_Block< ACE_LOCK >:
Collaboration diagram for ACE_Locked_Data_Block< ACE_LOCK >:

Public Member Functions

 ACE_Locked_Data_Block ()
 Default "do-nothing" constructor.
 ACE_Locked_Data_Block (size_t size, ACE_Message_Block::ACE_Message_Type msg_type, const char *msg_data, ACE_Allocator *allocator_strategy, ACE_Message_Block::Message_Flags flags, ACE_Allocator *data_block_allocator)
 Initialize.
virtual ~ACE_Locked_Data_Block ()
 Delete all the resources held in the message.
virtual ACE_Data_Blockclone_nocopy (ACE_Message_Block::Message_Flags mask=0, size_t max_size=0) const
Public Member Functions inherited from ACE_Data_Block
 ACE_Data_Block ()
 Default "do-nothing" constructor.
 ACE_Data_Block (size_t size, ACE_Message_Block::ACE_Message_Type msg_type, const char *msg_data, ACE_Allocator *allocator_strategy, ACE_Lock *locking_strategy, ACE_Message_Block::Message_Flags flags, ACE_Allocator *data_block_allocator)
 Initialize.
virtual ~ACE_Data_Block ()
 Delete all the resources held in the message.
ACE_Message_Block::ACE_Message_Type msg_type () const
 Get type of the message.
void msg_type (ACE_Message_Block::ACE_Message_Type type)
 Set type of the message.
char * base () const
 Get message data pointer.
void base (char *data, size_t size, ACE_Message_Block::Message_Flags mflags=ACE_Message_Block::DONT_DELETE)
 Set message data pointer (doesn't reallocate).
char * end () const
 Return a pointer to 1 past the end of the allocated data in a message.
char * mark () const
size_t size () const
 Get the total amount of allotted space in the message. The amount of allotted space may be less than allocated space.
int size (size_t length)
 Set the total amount of space in the message. Returns 0 if successful, else -1.
size_t capacity () const
 Get the total amount of allocated space.
virtual ACE_Data_Blockclone (ACE_Message_Block::Message_Flags mask=0) const
ACE_Data_Blockduplicate ()
 Return a "shallow" copy that increments our reference count by 1.
ACE_Data_Blockrelease (ACE_Lock *lock=0)
ACE_Message_Block::Message_Flags set_flags (ACE_Message_Block::Message_Flags more_flags)
 Bitwise-or the more_flags into the existing message flags and return the new value.
ACE_Message_Block::Message_Flags clr_flags (ACE_Message_Block::Message_Flags less_flags)
 Clear the message flag bits specified in less_flags and return the new value.
ACE_Message_Block::Message_Flags flags () const
 Get the current message flags.
ACE_Allocatorallocator_strategy () const
 Obtain the allocator strategy.
ACE_Locklocking_strategy ()
 Get the locking strategy.
ACE_Locklocking_strategy (ACE_Lock *)
 Set a new locking strategy and return the hold one.
void dump () const
 Dump the state of an object.
int reference_count () const
 Get the current reference count.
ACE_Allocatordata_block_allocator () const
 Get the allocator used to create this object.

Private Member Functions

ACE_Locked_Data_Block< ACE_LOCK > & operator= (const ACE_Locked_Data_Block< ACE_LOCK > &)=delete
 ACE_Locked_Data_Block (const ACE_Locked_Data_Block< ACE_LOCK > &)=delete

Private Attributes

ACE_LOCK lock_
 The lock.

Additional Inherited Members

Protected Member Functions inherited from ACE_Data_Block
virtual ACE_Data_Blockrelease_i ()
 Internal release implementation.
int reference_count_i () const
 Internal get the current reference count.
ACE_Data_Blockrelease_no_delete (ACE_Lock *lock)
Protected Attributes inherited from ACE_Data_Block
ACE_Message_Block::ACE_Message_Type type_
 Type of message.
size_t cur_size_
 Current size of message block.
size_t max_size_
 Total size of buffer.
ACE_Message_Block::Message_Flags flags_
 Misc flags (e.g., DONT_DELETE and USER_FLAGS).
char * base_
 Pointer To beginning of message payload.
ACE_Allocatorallocator_strategy_
ACE_Locklocking_strategy_
int reference_count_
ACE_Allocatordata_block_allocator_
 The allocator use to destroy ourselves.

Detailed Description

template<class ACE_LOCK>
class ACE_Locked_Data_Block< ACE_LOCK >

A Data_Block with a concrete locking strategy.

Data_Blocks can be parametric on the kind of lock they use; in many cases the lifetime of the lock is tied to the lifetime of the Data_Block itself. But since Data_Blocks are reference counted it is hard for users to control the lock lifetime. This class is parametric over the kind of lock used.

Constructor & Destructor Documentation

◆ ACE_Locked_Data_Block() [1/3]

template<class ACE_LOCK>
ACE_Locked_Data_Block< ACE_LOCK >::ACE_Locked_Data_Block ( )
inline

Default "do-nothing" constructor.

◆ ACE_Locked_Data_Block() [2/3]

template<class ACE_LOCK>
ACE_Locked_Data_Block< ACE_LOCK >::ACE_Locked_Data_Block ( size_t size,
ACE_Message_Block::ACE_Message_Type msg_type,
const char * msg_data,
ACE_Allocator * allocator_strategy,
ACE_Message_Block::Message_Flags flags,
ACE_Allocator * data_block_allocator )
inline

Initialize.

◆ ~ACE_Locked_Data_Block()

template<class L>
ACE_Locked_Data_Block< L >::~ACE_Locked_Data_Block ( )
virtual

Delete all the resources held in the message.

◆ ACE_Locked_Data_Block() [3/3]

template<class ACE_LOCK>
ACE_Locked_Data_Block< ACE_LOCK >::ACE_Locked_Data_Block ( const ACE_Locked_Data_Block< ACE_LOCK > & )
privatedelete

Member Function Documentation

◆ clone_nocopy()

template<class ACE_LOCK>
ACE_Data_Block * ACE_Locked_Data_Block< ACE_LOCK >::clone_nocopy ( ACE_Message_Block::Message_Flags mask = 0,
size_t max_size = 0 ) const
virtual

Return an exact "deep copy" of the message, the dynamic type is ACE_Locked_Data_Block<> See the documentation in Message_Block.h for details.

Reimplemented from ACE_Data_Block.

◆ operator=()

template<class ACE_LOCK>
ACE_Locked_Data_Block< ACE_LOCK > & ACE_Locked_Data_Block< ACE_LOCK >::operator= ( const ACE_Locked_Data_Block< ACE_LOCK > & )
privatedelete

Member Data Documentation

◆ lock_

template<class ACE_LOCK>
ACE_LOCK ACE_Locked_Data_Block< ACE_LOCK >::lock_
private

The lock.


The documentation for this class was generated from the following files: