ACE  6.3.3
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 >:
Inheritance graph
[legend]
Collaboration diagram for ACE_Locked_Data_Block< ACE_LOCK >:
Collaboration graph
[legend]

Public Member Functions

 ACE_Locked_Data_Block (void)
 Default "do-nothing" constructor. More...
 
 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. More...
 
virtual ~ACE_Locked_Data_Block (void)
 Delete all the resources held in the message. More...
 
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 (void)
 Default "do-nothing" constructor. More...
 
 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. More...
 
virtual ~ACE_Data_Block (void)
 Delete all the resources held in the message. More...
 
ACE_Message_Block::ACE_Message_Type msg_type (void) const
 Get type of the message. More...
 
void msg_type (ACE_Message_Block::ACE_Message_Type type)
 Set type of the message. More...
 
char * base (void) const
 Get message data pointer. More...
 
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). More...
 
char * end (void) const
 Return a pointer to 1 past the end of the allocated data in a message. More...
 
char * mark (void) const
 
size_t size (void) const
 
int size (size_t length)
 
size_t capacity (void) const
 Get the total amount of allocated space. More...
 
virtual ACE_Data_Blockclone (ACE_Message_Block::Message_Flags mask=0) const
 
ACE_Data_Blockduplicate (void)
 Return a "shallow" copy that increments our reference count by 1. More...
 
ACE_Data_Blockrelease (ACE_Lock *lock=0)
 
ACE_Message_Block::Message_Flags set_flags (ACE_Message_Block::Message_Flags more_flags)
 
ACE_Message_Block::Message_Flags clr_flags (ACE_Message_Block::Message_Flags less_flags)
 
ACE_Message_Block::Message_Flags flags (void) const
 Get the current message flags. More...
 
ACE_Allocatorallocator_strategy (void) const
 Obtain the allocator strategy. More...
 
ACE_Locklocking_strategy (void)
 Get the locking strategy. More...
 
ACE_Locklocking_strategy (ACE_Lock *)
 Set a new locking strategy and return the hold one. More...
 
void dump (void) const
 Dump the state of an object. More...
 
int reference_count (void) const
 Get the current reference count. More...
 
ACE_Allocatordata_block_allocator (void) const
 Get the allocator used to create this object. More...
 

Private Member Functions

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

Private Attributes

ACE_LOCK lock_
 The lock. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ACE_Data_Block
virtual ACE_Data_Blockrelease_i (void)
 Internal release implementation. More...
 
int reference_count_i (void) const
 Internal get the current reference count. More...
 
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. More...
 
size_t cur_size_
 Current size of message block. More...
 
size_t max_size_
 Total size of buffer. More...
 
ACE_Message_Block::Message_Flags flags_
 Misc flags (e.g., DONT_DELETE and USER_FLAGS). More...
 
char * base_
 Pointer To beginning of message payload. More...
 
ACE_Allocatorallocator_strategy_
 
ACE_Locklocking_strategy_
 
int reference_count_
 
ACE_Allocatordata_block_allocator_
 The allocator use to destroy ourselves. More...
 

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

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

Default "do-nothing" constructor.

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.

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

Delete all the resources held in the message.

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

Member Function Documentation

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.

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

Member Data Documentation

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: