diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-14 04:09:51 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-14 04:09:51 +0000 |
commit | bd1719144c32060fb372c01dddd85f591b0829bc (patch) | |
tree | 7c6b72b8fd8bd36c96e3ad4c3a98a00a718d5180 /ace/Message_Block_T.h | |
parent | a533021684c3380d4b72a3e1df4e07c1fd453f0a (diff) | |
download | ATCD-bd1719144c32060fb372c01dddd85f591b0829bc.tar.gz |
ChangeLogTag:Tue Oct 13 22:40:40 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'ace/Message_Block_T.h')
-rw-r--r-- | ace/Message_Block_T.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/ace/Message_Block_T.h b/ace/Message_Block_T.h new file mode 100644 index 00000000000..353ee00d23a --- /dev/null +++ b/ace/Message_Block_T.h @@ -0,0 +1,76 @@ +/* -*- C++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Message_Block_T.h +// +// = AUTHOR +// Doug Schmidt & Carlos O'Ryan +// +// ============================================================================ + +#if !defined (ACE_MESSAGE_BLOCK_T_H) +#define ACE_MESSAGE_BLOCK_T_H + +#include "ace/Message_Block.h" + +template<class ACE_LOCK> +class ACE_Export ACE_Locked_Data_Block : public ACE_Data_Block +{ + // = TITLE + // A Data_Block with a concrete locking strategy. + // + // = DESCRIPTION + // 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. + // +public: + // = Initialization and termination methods. + 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_Block *clone (ACE_Message_Block::Message_Flags mask = 0) const; + // Return an exact "deep copy" of the message, the dynamic type is + // ACE_Locked_Data_Block<> + +private: + ACE_LOCK lock_; + // The lock + + // = Disallow these operations. + ACE_UNIMPLEMENTED_FUNC (ACE_Locked_Data_Block &operator= (const ACE_Locked_Data_Block<ACE_LOCK> &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Locked_Data_Block (const ACE_Locked_Data_Block<ACE_LOCK> &)) +}; + +#if defined (__ACE_INLINE__) +#include "ace/Message_Block_T.i" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ace/Message_Block_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Message_Block_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#endif /* ACE_MESSAGE_BLOCK_T_H */ |