Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Locked_Data_Block Class Template Reference

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

#include <Message_Block_T.h>

Inheritance diagram for ACE_Locked_Data_Block:

Inheritance graph
[legend]
Collaboration diagram for ACE_Locked_Data_Block:

Collaboration graph
[legend]
List of all members.

Public Methods

 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) const

Private Methods

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...


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.

Definition at line 35 of file Message_Block_T.h.


Constructor & Destructor Documentation

template<class ACE_LOCK>
ACE_INLINE ACE_Locked_Data_Block< ACE_LOCK >::ACE_Locked_Data_Block void   
 

Default "do-nothing" constructor.

Definition at line 8 of file Message_Block_T.i.

References lock_, and ACE_Data_Block::locking_strategy_.

00009 {
00010   this->locking_strategy_ = &this->lock_;
00011 }

template<class ACE_LOCK>
ACE_INLINE 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
 

Initialize.

Definition at line 15 of file Message_Block_T.i.

References ACE_Message_Block::ACE_Message_Type, and ACE_Message_Block::Message_Flags.

00021   : ACE_Data_Block (size,
00022                     msg_type,
00023                     msg_data,
00024                     allocator_strategy,
00025                     &lock_,
00026                     flags,
00027                     data_block_allocator)
00028 {
00029 }

template<class L>
ACE_Locked_Data_Block< L >::~ACE_Locked_Data_Block void    [virtual]
 

Delete all the resources held in the message.

Definition at line 16 of file Message_Block_T.cpp.

00017 {
00018 }

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 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.

Definition at line 21 of file Message_Block_T.cpp.

References ACE_NEW_MALLOC_RETURN, ACE_TRACE, ACE_Data_Block::allocator_strategy, ACE_Data_Block::clr_flags, ACE_Data_Block::data_block_allocator, ACE_Message_Block::DONT_DELETE, ACE_Data_Block::flags, ACE_Message_Block::Message_Flags, ACE_Data_Block::msg_type, and ACE_Data_Block::size.

00022 {
00023   ACE_TRACE ("ACE_Locked_Data_Block::clone_nocopy");
00024 
00025   // You always want to clear this one to prevent memory leaks but you
00026   // might add some others later.
00027   const ACE_Message_Block::Message_Flags always_clear =
00028     ACE_Message_Block::DONT_DELETE;
00029 
00030   ACE_Locked_Data_Block<ACE_LOCK> *nb;
00031 
00032   ACE_NEW_MALLOC_RETURN (nb,
00033                          ACE_static_cast(ACE_Locked_Data_Block<ACE_LOCK>*,
00034                                          this->data_block_allocator ()->malloc (sizeof (ACE_Locked_Data_Block<ACE_LOCK>))),
00035                          ACE_Locked_Data_Block<ACE_LOCK> (this->size (),
00036                                                    this->msg_type (),
00037                                                    0,
00038                                                    this->allocator_strategy (),
00039                                                    this->flags (),
00040                                                    this->data_block_allocator ()),
00041                          0);
00042 
00043   // Set new flags minus the mask...
00044   nb->clr_flags (mask | always_clear);
00045   return nb;
00046 }

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::lock_ [private]
 

The lock.

Definition at line 62 of file Message_Block_T.h.

Referenced by ACE_Locked_Data_Block.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:49:26 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002