00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef OPENDDS_DCPS_THREADPERCONREMOVEVISITOR_H 00009 #define OPENDDS_DCPS_THREADPERCONREMOVEVISITOR_H 00010 00011 #include "dds/DCPS/dcps_export.h" 00012 #include "BasicQueueVisitor_T.h" 00013 #include "TransportDefs.h" 00014 #include "ThreadPerConnectionSendTask.h" 00015 #include "ace/Message_Block.h" 00016 00017 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00018 00019 namespace OpenDDS { 00020 namespace DCPS { 00021 00022 class OpenDDS_Dcps_Export ThreadPerConRemoveVisitor 00023 : public BasicQueueVisitor<SendRequest> { 00024 public: 00025 00026 /// In order to construct a QueueRemoveVisitor, it must be 00027 /// provided with the DataSampleElement* (used as an 00028 /// identifier) that should be removed from the BasicQueue<T> 00029 /// (the one this visitor will visit when it is passed-in 00030 /// to a BasicQueue<T>::accept_remove_visitor() invocation). 00031 explicit ThreadPerConRemoveVisitor(const ACE_Message_Block* sample); 00032 00033 virtual ~ThreadPerConRemoveVisitor(); 00034 00035 /// The BasicQueue<T>::accept_remove_visitor() method will call 00036 /// this visit_element_remove() method for each element in the queue. 00037 virtual int visit_element_remove(SendRequest* element, 00038 int& remove); 00039 00040 /// True if the visitor found and removed the sample. 00041 RemoveResult status() const; 00042 00043 private: 00044 00045 /// The sample that needs to be removed. 00046 const ACE_Message_Block* sample_; 00047 00048 /// Holds the status of our visit. 00049 RemoveResult status_; 00050 }; 00051 00052 } // namespace DCPS 00053 } // namespace OpenDDS 00054 00055 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00056 00057 #if defined (__ACE_INLINE__) 00058 #include "ThreadPerConRemoveVisitor.inl" 00059 #endif /* __ACE_INLINE__ */ 00060 00061 #endif /* OPENDDS_DCPS_THREADPERCONREMOVEVISITOR_H */