OpenDDS  Snapshot(2023/04/28-20:55)
ThreadPerConRemoveVisitor.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_THREADPERCONREMOVEVISITOR_H
9 #define OPENDDS_DCPS_TRANSPORT_FRAMEWORK_THREADPERCONREMOVEVISITOR_H
10 
11 #include "dds/DCPS/dcps_export.h"
12 #include "BasicQueueVisitor_T.h"
13 #include "TransportDefs.h"
15 #include "ace/Message_Block.h"
16 
18 
19 namespace OpenDDS {
20 namespace DCPS {
21 
23  : public BasicQueueVisitor<SendRequest> {
24 public:
25 
26  /// In order to construct a QueueRemoveVisitor, it must be
27  /// provided with the DataSampleElement* (used as an
28  /// identifier) that should be removed from the BasicQueue<T>
29  /// (the one this visitor will visit when it is passed-in
30  /// to a BasicQueue<T>::accept_remove_visitor() invocation).
31  explicit ThreadPerConRemoveVisitor(const ACE_Message_Block* sample);
32 
33  virtual ~ThreadPerConRemoveVisitor();
34 
35  /// The BasicQueue<T>::accept_remove_visitor() method will call
36  /// this visit_element_remove() method for each element in the queue.
37  virtual int visit_element_remove(SendRequest* element,
38  int& remove);
39 
40  /// True if the visitor found and removed the sample.
41  RemoveResult status() const;
42 
43 private:
44 
45  /// The sample that needs to be removed.
47 
48  /// Holds the status of our visit.
50 };
51 
52 } // namespace DCPS
53 } // namespace OpenDDS
54 
56 
57 #if defined (__ACE_INLINE__)
59 #endif /* __ACE_INLINE__ */
60 
61 #endif /* OPENDDS_DCPS_THREADPERCONREMOVEVISITOR_H */
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
RemoveResult
used by DataLink::remove_sample(), TransportSendStrategy, *RemoveVisitor
const ACE_Message_Block * sample_
The sample that needs to be removed.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
RemoveResult status_
Holds the status of our visit.
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28