Message_Block_T.cpp

Go to the documentation of this file.
00001 // $Id: Message_Block_T.cpp 80826 2008-03-04 14:51:23Z wotte $
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,
00023                                                size_t max_size) const
00024 {
00025   ACE_TRACE ("ACE_Locked_Data_Block::clone_nocopy");
00026 
00027   // You always want to clear this one to prevent memory leaks but you
00028   // might add some others later.
00029   const ACE_Message_Block::Message_Flags always_clear =
00030     ACE_Message_Block::DONT_DELETE;
00031 
00032   ACE_Locked_Data_Block<ACE_LOCK> *nb = 0;
00033 
00034   ACE_NEW_MALLOC_RETURN (nb,
00035                          static_cast<ACE_Locked_Data_Block<ACE_LOCK>*> (
00036                                          this->data_block_allocator ()->malloc (sizeof (ACE_Locked_Data_Block<ACE_LOCK>))),
00037                          ACE_Locked_Data_Block<ACE_LOCK> (
00038                                                    max_size == 0 ?
00039                                                      this->size () : max_size,
00040                                                    this->msg_type (),
00041                                                    0,
00042                                                    this->allocator_strategy (),
00043                                                    this->flags (),
00044                                                    this->data_block_allocator ()),
00045                          0);
00046 
00047   // Set new flags minus the mask...
00048   nb->clr_flags (mask | always_clear);
00049   return nb;
00050 }
00051 
00052 ACE_END_VERSIONED_NAMESPACE_DECL
00053 
00054 #endif /* ACE_MESSAGE_BLOCK_T_CPP */

Generated on Tue Feb 2 17:18:40 2010 for ACE by  doxygen 1.4.7