ACE  6.1.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes
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]

List of all members.

Public Member Functions

 ACE_Locked_Data_Block (void)
 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 (void)
 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 (void)
 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 (void)
 Delete all the resources held in the message.
ACE_Message_Block::ACE_Message_Type msg_type (void) const
 Get type of the message.
void msg_type (ACE_Message_Block::ACE_Message_Type type)
 Set type of the message.
char * base (void) 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 (void) const
 Return a pointer to 1 past the end of the allocated data in a message.
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.
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.
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.
ACE_Allocatorallocator_strategy (void) const
 Obtain the allocator strategy.
ACE_Locklocking_strategy (void)
 Get the locking strategy.
ACE_Locklocking_strategy (ACE_Lock *)
 Set a new locking strategy and return the hold one.
void dump (void) const
 Dump the state of an object.
int reference_count (void) const
 Get the current reference count.
ACE_Allocatordata_block_allocator (void) 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 > &)
 ACE_Locked_Data_Block (const ACE_Locked_Data_Block< ACE_LOCK > &)

Private Attributes

ACE_LOCK lock_
 The lock.

Additional Inherited Members

- Protected Member Functions inherited from ACE_Data_Block
virtual ACE_Data_Blockrelease_i (void)
 Internal release implementation.
int reference_count_i (void) 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

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: