00001 // Message_Block_T.cpp,v 4.13 2006/04/19 11:52:31 jwillemsen Exp 00002 00003 #ifndef ACE_MESSAGE_BLOCK_T_CPP 00004 #define ACE_MESSAGE_BLOCK_T_CPP 00005 00006 #include "ace/Malloc_Base.h" /* Need ACE_Allocator */ 00007 00008 #if !defined (__ACE_INLINE__) 00009 #include "ace/Message_Block_T.inl" 00010 #endif /* __ACE_INLINE__ */ 00011 00012 #include "ace/os_include/os_errno.h" 00013 00014 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00015 00016 template<class L> 00017 ACE_Locked_Data_Block<L>::~ACE_Locked_Data_Block (void) 00018 { 00019 } 00020 00021 template<class ACE_LOCK> ACE_Data_Block * 00022 ACE_Locked_Data_Block<ACE_LOCK>::clone_nocopy (ACE_Message_Block::Message_Flags mask) const 00023 { 00024 ACE_TRACE ("ACE_Locked_Data_Block::clone_nocopy"); 00025 00026 // You always want to clear this one to prevent memory leaks but you 00027 // might add some others later. 00028 const ACE_Message_Block::Message_Flags always_clear = 00029 ACE_Message_Block::DONT_DELETE; 00030 00031 ACE_Locked_Data_Block<ACE_LOCK> *nb = 0; 00032 00033 ACE_NEW_MALLOC_RETURN (nb, 00034 static_cast<ACE_Locked_Data_Block<ACE_LOCK>*> ( 00035 this->data_block_allocator ()->malloc (sizeof (ACE_Locked_Data_Block<ACE_LOCK>))), 00036 ACE_Locked_Data_Block<ACE_LOCK> (this->size (), 00037 this->msg_type (), 00038 0, 00039 this->allocator_strategy (), 00040 this->flags (), 00041 this->data_block_allocator ()), 00042 0); 00043 00044 // Set new flags minus the mask... 00045 nb->clr_flags (mask | always_clear); 00046 return nb; 00047 } 00048 00049 ACE_END_VERSIONED_NAMESPACE_DECL 00050 00051 #endif /* ACE_MESSAGE_BLOCK_T_CPP */