Fixed typos
[ACE_TAO.git] / ACE / ace / Message_Block_T.h
blobeebb940819234e76aaaaa75f5fed5ff8b61ba597
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file Message_Block_T.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 * @author Carlos O'Ryan <coryan@atdesk.com>
9 */
10 //=============================================================================
12 #ifndef ACE_MESSAGE_BLOCK_T_H
13 #define ACE_MESSAGE_BLOCK_T_H
14 #include /**/ "ace/pre.h"
16 #include "ace/Message_Block.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 /**
25 * @class ACE_Locked_Data_Block
27 * @brief A Data_Block with a concrete locking strategy.
29 * Data_Blocks can be parametric on the kind of lock they use; in
30 * many cases the lifetime of the lock is tied to the lifetime of
31 * the Data_Block itself. But since Data_Blocks are reference
32 * counted it is hard for users to control the lock lifetime.
33 * This class is parametric over the kind of lock used.
35 template <class ACE_LOCK>
36 class ACE_Locked_Data_Block : public ACE_Data_Block
38 public:
39 /// Default "do-nothing" constructor.
40 ACE_Locked_Data_Block (void);
42 /// Initialize.
43 ACE_Locked_Data_Block (size_t size,
44 ACE_Message_Block::ACE_Message_Type msg_type,
45 const char *msg_data,
46 ACE_Allocator *allocator_strategy,
47 ACE_Message_Block::Message_Flags flags,
48 ACE_Allocator *data_block_allocator);
50 /// Delete all the resources held in the message.
51 virtual ~ACE_Locked_Data_Block (void);
53 /**
54 * Return an exact "deep copy" of the message, the dynamic type is
55 * ACE_Locked_Data_Block<>
56 * See the documentation in Message_Block.h for details.
58 virtual ACE_Data_Block *clone_nocopy (ACE_Message_Block::Message_Flags mask = 0,
59 size_t max_size = 0) const;
61 private:
62 /// The lock
63 ACE_LOCK lock_;
65 // = Disallow these operations.
66 ACE_UNIMPLEMENTED_FUNC (ACE_Locked_Data_Block<ACE_LOCK> &operator= (const ACE_Locked_Data_Block<ACE_LOCK> &))
67 ACE_UNIMPLEMENTED_FUNC (ACE_Locked_Data_Block (const ACE_Locked_Data_Block<ACE_LOCK> &))
70 ACE_END_VERSIONED_NAMESPACE_DECL
72 #if defined (__ACE_INLINE__)
73 #include "ace/Message_Block_T.inl"
74 #endif /* __ACE_INLINE__ */
76 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
77 #include "ace/Message_Block_T.cpp"
78 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
80 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
81 #pragma implementation ("Message_Block_T.cpp")
82 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
84 #include /**/ "ace/post.h"
85 #endif /* ACE_MESSAGE_BLOCK_T_H */