3 //=============================================================================
5 * @file Message_Block_T.h
7 * $Id: Message_Block_T.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
10 * @author Carlos O'Ryan <coryan@atdesk.com>
12 //=============================================================================
14 #ifndef ACE_MESSAGE_BLOCK_T_H
15 #define ACE_MESSAGE_BLOCK_T_H
16 #include /**/ "ace/pre.h"
18 #include "ace/Message_Block.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 * @class ACE_Locked_Data_Block
29 * @brief A Data_Block with a concrete locking strategy.
31 * Data_Blocks can be parametric on the kind of lock they use; in
32 * many cases the lifetime of the lock is tied to the lifetime of
33 * the Data_Block itself. But since Data_Blocks are reference
34 * counted it is hard for users to control the lock lifetime.
35 * This class is parametric over the kind of lock used.
37 template <class ACE_LOCK
>
38 class ACE_Locked_Data_Block
: public ACE_Data_Block
41 // = Initialization and termination methods.
42 /// Default "do-nothing" constructor.
43 ACE_Locked_Data_Block (void);
46 ACE_Locked_Data_Block (size_t size
,
47 ACE_Message_Block::ACE_Message_Type msg_type
,
49 ACE_Allocator
*allocator_strategy
,
50 ACE_Message_Block::Message_Flags flags
,
51 ACE_Allocator
*data_block_allocator
);
53 /// Delete all the resources held in the message.
54 virtual ~ACE_Locked_Data_Block (void);
57 * Return an exact "deep copy" of the message, the dynamic type is
58 * ACE_Locked_Data_Block<>
59 * See the documentation in Message_Block.h for details.
61 virtual ACE_Data_Block
*clone_nocopy (ACE_Message_Block::Message_Flags mask
= 0,
62 size_t max_size
= 0) const;
68 // = Disallow these operations.
69 ACE_UNIMPLEMENTED_FUNC (ACE_Locked_Data_Block
<ACE_LOCK
> &operator= (const ACE_Locked_Data_Block
<ACE_LOCK
> &))
70 ACE_UNIMPLEMENTED_FUNC (ACE_Locked_Data_Block (const ACE_Locked_Data_Block
<ACE_LOCK
> &))
73 ACE_END_VERSIONED_NAMESPACE_DECL
75 #if defined (__ACE_INLINE__)
76 #include "ace/Message_Block_T.inl"
77 #endif /* __ACE_INLINE__ */
79 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
80 #include "ace/Message_Block_T.cpp"
81 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
83 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
84 #pragma implementation ("Message_Block_T.cpp")
85 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
87 #include /**/ "ace/post.h"
88 #endif /* ACE_MESSAGE_BLOCK_T_H */