ThreadPerConRemoveVisitor.h

Go to the documentation of this file.
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 namespace OpenDDS {
00018 namespace DCPS {
00019 
00020 class OpenDDS_Dcps_Export ThreadPerConRemoveVisitor
00021   : public BasicQueueVisitor<SendRequest> {
00022 public:
00023 
00024   /// In order to construct a QueueRemoveVisitor, it must be
00025   /// provided with the DataSampleElement* (used as an
00026   /// identifier) that should be removed from the BasicQueue<T>
00027   /// (the one this visitor will visit when it is passed-in
00028   /// to a BasicQueue<T>::accept_remove_visitor() invocation).
00029   explicit ThreadPerConRemoveVisitor(const ACE_Message_Block* sample);
00030 
00031   virtual ~ThreadPerConRemoveVisitor();
00032 
00033   /// The BasicQueue<T>::accept_remove_visitor() method will call
00034   /// this visit_element_remove() method for each element in the queue.
00035   virtual int visit_element_remove(SendRequest*           element,
00036                                    int&                   remove);
00037 
00038   /// True if the visitor found and removed the sample.
00039   RemoveResult status() const;
00040 
00041 private:
00042 
00043   /// The sample that needs to be removed.
00044   const ACE_Message_Block* sample_;
00045 
00046   /// Holds the status of our visit.
00047   RemoveResult status_;
00048 };
00049 
00050 } // namespace DCPS
00051 } // namespace OpenDDS
00052 
00053 #if defined (__ACE_INLINE__)
00054 #include "ThreadPerConRemoveVisitor.inl"
00055 #endif /* __ACE_INLINE__ */
00056 
00057 #endif  /* OPENDDS_DCPS_THREADPERCONREMOVEVISITOR_H */

Generated on Fri Feb 12 20:05:28 2016 for OpenDDS by  doxygen 1.4.7