QueueRemoveVisitor.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_QUEUEREMOVEVISITOR_H
00009 #define OPENDDS_DCPS_QUEUEREMOVEVISITOR_H
00010 
00011 #include "dds/DCPS/dcps_export.h"
00012 #include "dds/DCPS/GuidUtils.h"
00013 #include "BasicQueueVisitor_T.h"
00014 #include "TransportDefs.h"
00015 #include "TransportQueueElement.h"
00016 
00017 #include "ace/Message_Block.h"
00018 
00019 namespace OpenDDS {
00020 namespace DCPS {
00021 
00022 class TransportQueueElement;
00023 
00024 class OpenDDS_Dcps_Export QueueRemoveVisitor
00025   : public BasicQueueVisitor<TransportQueueElement> {
00026 public:
00027 
00028   explicit QueueRemoveVisitor(const TransportQueueElement::MatchCriteria& mc);
00029 
00030   virtual ~QueueRemoveVisitor();
00031 
00032   /// The BasicQueue<T>::accept_remove_visitor() method will call
00033   /// this visit_element_remove() method for each element in the queue.
00034   virtual int visit_element_remove(TransportQueueElement* element,
00035                                    int&                   remove);
00036 
00037   /// Accessor for the status.  Called after this visitor object has
00038   /// been passed to BasicQueue<T>::accept_remove_visitor().
00039   RemoveResult status() const;
00040 
00041   int removed_bytes() const;
00042 
00043 private:
00044 
00045   /// Criteria object describing the Queue Element that needs to be removed.
00046   const TransportQueueElement::MatchCriteria& mc_;
00047 
00048   /// Holds the status of our visit.
00049   RemoveResult status_;
00050 
00051   size_t removed_bytes_;
00052 };
00053 
00054 } // namespace DCPS
00055 } // namespace OpenDDS
00056 
00057 #if defined (__ACE_INLINE__)
00058 #include "QueueRemoveVisitor.inl"
00059 #endif /* __ACE_INLINE__ */
00060 
00061 #endif  /* OPENDDS_DCPS_QUEUEREMOVEVISITOR_H */

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