OpenDDS::DCPS::RemoveAllVisitor Class Reference

#include <RemoveAllVisitor.h>

Inheritance diagram for OpenDDS::DCPS::RemoveAllVisitor:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::RemoveAllVisitor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RemoveAllVisitor ()
virtual ~RemoveAllVisitor ()
virtual int visit_element_remove (TransportQueueElement *element, int &remove)
int status () const
int removed_bytes () const

Private Attributes

int status_
 Holds the status of our visit.
size_t removed_bytes_

Detailed Description

Definition at line 19 of file RemoveAllVisitor.h.


Constructor & Destructor Documentation

ACE_INLINE OpenDDS::DCPS::RemoveAllVisitor::RemoveAllVisitor (  ) 

Definition at line 11 of file RemoveAllVisitor.inl.

References DBG_ENTRY_LVL.

00012   : status_(0),
00013     removed_bytes_(0)
00014 {
00015   DBG_ENTRY_LVL("RemoveAllVisitor","RemoveAllVisitor",6);
00016 }

OpenDDS::DCPS::RemoveAllVisitor::~RemoveAllVisitor (  )  [virtual]

Definition at line 16 of file RemoveAllVisitor.cpp.

References DBG_ENTRY_LVL.

00017 {
00018   DBG_ENTRY_LVL("RemoveAllVisitor","~RemoveAllVisitor",6);
00019 }


Member Function Documentation

ACE_INLINE int OpenDDS::DCPS::RemoveAllVisitor::removed_bytes (  )  const

Definition at line 26 of file RemoveAllVisitor.inl.

References DBG_ENTRY_LVL, and removed_bytes_.

00027 {
00028   DBG_ENTRY_LVL("RemoveAllVisitor","removed_bytes",6);
00029   return static_cast<int>(this->removed_bytes_);
00030 }

ACE_INLINE int OpenDDS::DCPS::RemoveAllVisitor::status (  )  const

Accessor for the status. Called after this visitor object has been passed to BasicQueue<T>::accept_remove_visitor().

Definition at line 19 of file RemoveAllVisitor.inl.

References DBG_ENTRY_LVL, and status_.

00020 {
00021   DBG_ENTRY_LVL("RemoveAllVisitor","status",6);
00022   return this->status_;
00023 }

int OpenDDS::DCPS::RemoveAllVisitor::visit_element_remove ( TransportQueueElement element,
int &  remove 
) [virtual]

The BasicQueue<T>::accept_remove_visitor() method will call this visit_element_remove() method for each element in the queue.

Definition at line 22 of file RemoveAllVisitor.cpp.

References OpenDDS::DCPS::TransportQueueElement::data_dropped(), DBG_ENTRY_LVL, OpenDDS::DCPS::TransportQueueElement::msg(), and status_.

00024 {
00025   DBG_ENTRY_LVL("RemoveAllVisitor","visit_element_remove",6);
00026 
00027   // Always remove the element passed in. Always set the remove flag
00028   // to true (1).  The BasicQueue<T> will perform the actual removal
00029   // once we return from this method.
00030   remove = 1;
00031 
00032   // Add the total_length() of the element->msg() chain to our
00033   // removed_bytes_ (running) total.
00034   if (element->msg()) {
00035     this->removed_bytes_ += element->msg()->total_length();
00036   }
00037 
00038   // Inform the element that we've made a decision - and it is
00039   // data_dropped()
00040   // This visitor is used in TransportSendStrategy::clear and
00041   // TransportSendBuffer::release. In formal case, the sample
00042   // is dropped by transport. In the later case, the
00043   // dropped_by_transport is not used as the sample is cloned
00044   // and no callback is made to writer.
00045   element->data_dropped(true);
00046 
00047   // Adjust our status_ to indicate that we actually found (and removed)
00048   // the sample.
00049   this->status_ = 1;
00050 
00051   // Continue visitation.
00052   return 1;
00053 }


Member Data Documentation

size_t OpenDDS::DCPS::RemoveAllVisitor::removed_bytes_ [private]

Definition at line 42 of file RemoveAllVisitor.h.

Referenced by removed_bytes().

int OpenDDS::DCPS::RemoveAllVisitor::status_ [private]

Holds the status of our visit.

Definition at line 40 of file RemoveAllVisitor.h.

Referenced by status(), and visit_element_remove().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:28 2016 for OpenDDS by  doxygen 1.4.7