OpenDDS  Snapshot(2023/04/28-20:55)
PacketRemoveVisitor.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_TRANSPORT_FRAMEWORK_PACKETREMOVEVISITOR_H
9 #define OPENDDS_DCPS_TRANSPORT_FRAMEWORK_PACKETREMOVEVISITOR_H
10 
11 #include "dds/DCPS/dcps_export.h"
12 #include "dds/DCPS/GuidUtils.h"
13 #include "BasicQueueVisitor_T.h"
14 #include "TransportDefs.h"
16 
18 class ACE_Message_Block;
20 
22 
23 namespace OpenDDS {
24 namespace DCPS {
25 
27  : public BasicQueueVisitor<TransportQueueElement> {
28 public:
29 
31  ACE_Message_Block*& unsent_head_block,
32  ACE_Message_Block* header_block,
33  MessageBlockAllocator& mb_allocator,
34  DataBlockAllocator& db_allocator,
35  bool remove_all = false);
36 
37  virtual ~PacketRemoveVisitor();
38 
39  /// The BasicQueue<T>::accept_remove_visitor() method will call
40  /// this visit_element() method for each element in the queue.
41  virtual int visit_element_ref(TransportQueueElement*& element);
42 
43  RemoveResult status() const;
44 
45 private:
46 
47  /// The sample that needs to be removed.
49 
50  /// The head block of the chain of unsent blocks in the packet.
52 
53  /// The packet header block that was duplicate()'d to form the
54  /// first block in the packet.
56 
57  /// Holds the status of our visit.
59 
60  /// This is the message block in the chain that corresponds to the
61  /// current (non-head) element being visited.
63 
64  /// This is the message block in the chain that has its cont() set
65  /// to the current_block_.
67 
68  /// Cached allocator for DataSampleHeader message block
70  /// Cached allocator for DataSampleHeader data block
72  // Continue removing for non-unique elements even when status is RELEASED
74 };
75 
76 } // namespace DCPS
77 } // namespace OpenDDS
78 
80 
81 #if defined (__ACE_INLINE__)
82 #include "PacketRemoveVisitor.inl"
83 #endif /* __ACE_INLINE__ */
84 
85 #endif /* OPENDDS_DCPS_PACKETREMOVEVISTOR_H */
#define ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_Message_Block *& head_
The head block of the chain of unsent blocks in the packet.
DataBlockAllocator & replaced_element_db_allocator_
Cached allocator for DataSampleHeader data block.
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
const TransportQueueElement::MatchCriteria & match_
The sample that needs to be removed.
RemoveResult
used by DataLink::remove_sample(), TransportSendStrategy, *RemoveVisitor
A fixed-size allocator that caches items for quicker access but if the pool is exhausted it will use ...
#define ACE_END_VERSIONED_NAMESPACE_DECL
MessageBlockAllocator & replaced_element_mb_allocator_
Cached allocator for DataSampleHeader message block.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
RemoveResult status_
Holds the status of our visit.
Base wrapper class around a data/control sample to be sent.