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

Message_Block_T.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Message_Block_T.h
00006  *
00007  *  $Id: Message_Block_T.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Douglas C. Schmidt <schmidt@cs.wustl.edu> and Carlos O'Ryan <coryan@uci.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef ACE_MESSAGE_BLOCK_T_H
00014 #define ACE_MESSAGE_BLOCK_T_H
00015 #include "ace/pre.h"
00016 
00017 #include "ace/Message_Block.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 /**
00024  * @class ACE_Locked_Data_Block
00025  *
00026  * @brief A Data_Block with a concrete locking strategy.
00027  *
00028  * Data_Blocks can be parametric on the kind of lock they use; in
00029  * many cases the lifetime of the lock is tied to the lifetime of
00030  * the Data_Block itself. But since Data_Blocks are reference
00031  * counted it is hard for users to control the lock lifetime.
00032  * This class is parametric over the kind of lock used.
00033  */
00034 template <class ACE_LOCK>
00035 class ACE_Locked_Data_Block : public ACE_Data_Block
00036 {
00037 public:
00038   // = Initialization and termination methods.
00039   /// Default "do-nothing" constructor.
00040   ACE_Locked_Data_Block (void);
00041 
00042   /// Initialize.
00043   ACE_Locked_Data_Block (size_t size,
00044                          ACE_Message_Block::ACE_Message_Type msg_type,
00045                          const char *msg_data,
00046                          ACE_Allocator *allocator_strategy,
00047                          ACE_Message_Block::Message_Flags flags,
00048                          ACE_Allocator *data_block_allocator);
00049 
00050   /// Delete all the resources held in the message.
00051   virtual ~ACE_Locked_Data_Block (void);
00052 
00053   /**
00054    * Return an exact "deep copy" of the message, the dynamic type is
00055    * ACE_Locked_Data_Block<>
00056    * See the documentation in Message_Block.h for details.
00057    */
00058   virtual ACE_Data_Block *clone_nocopy (ACE_Message_Block::Message_Flags mask = 0) const;
00059 
00060 private:
00061   /// The lock
00062   ACE_LOCK lock_;
00063 
00064   // = Disallow these operations.
00065   ACE_UNIMPLEMENTED_FUNC (ACE_Locked_Data_Block<ACE_LOCK> &operator= (const ACE_Locked_Data_Block<ACE_LOCK> &))
00066   ACE_UNIMPLEMENTED_FUNC (ACE_Locked_Data_Block (const ACE_Locked_Data_Block<ACE_LOCK> &))
00067 };
00068 
00069 #if defined (__ACE_INLINE__)
00070 #include "ace/Message_Block_T.i"
00071 #endif /* __ACE_INLINE__ */
00072 
00073 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00074 #include "ace/Message_Block_T.cpp"
00075 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00076 
00077 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00078 #pragma implementation ("Message_Block_T.cpp")
00079 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00080 
00081 #include "ace/post.h"
00082 #endif /* ACE_MESSAGE_BLOCK_T_H */

Generated on Mon Jun 16 11:20:22 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002