OpenDDS::DCPS::ThreadPerConRemoveVisitor Class Reference

#include <ThreadPerConRemoveVisitor.h>

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

List of all members.

Public Member Functions

 ThreadPerConRemoveVisitor (const ACE_Message_Block *sample)
virtual ~ThreadPerConRemoveVisitor ()
virtual int visit_element_remove (SendRequest *element, int &remove)
RemoveResult status () const
 True if the visitor found and removed the sample.

Private Attributes

const ACE_Message_Blocksample_
 The sample that needs to be removed.
RemoveResult status_
 Holds the status of our visit.

Detailed Description

Definition at line 22 of file ThreadPerConRemoveVisitor.h.


Constructor & Destructor Documentation

ACE_INLINE OpenDDS::DCPS::ThreadPerConRemoveVisitor::ThreadPerConRemoveVisitor ( const ACE_Message_Block sample  )  [explicit]

In order to construct a QueueRemoveVisitor, it must be provided with the DataSampleElement* (used as an identifier) that should be removed from the BasicQueue<T> (the one this visitor will visit when it is passed-in to a BasicQueue<T>::accept_remove_visitor() invocation).

Definition at line 11 of file ThreadPerConRemoveVisitor.inl.

References DBG_ENTRY.

00013   : sample_(sample)
00014   , status_(REMOVE_NOT_FOUND)
00015 {
00016   DBG_ENTRY("ThreadPerConRemoveVisitor", "ThreadPerConRemoveVisitor");
00017 }

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

Definition at line 22 of file ThreadPerConRemoveVisitor.cpp.

References DBG_ENTRY.

00023 {
00024   DBG_ENTRY("ThreadPerConRemoveVisitor", "~ThreadPerConRemoveVisitor");
00025 }


Member Function Documentation

ACE_INLINE OpenDDS::DCPS::RemoveResult OpenDDS::DCPS::ThreadPerConRemoveVisitor::status ( void   )  const

True if the visitor found and removed the sample.

Definition at line 20 of file ThreadPerConRemoveVisitor.inl.

References DBG_ENTRY, and status_.

Referenced by OpenDDS::DCPS::ThreadPerConnectionSendTask::remove_sample().

00021 {
00022   DBG_ENTRY("ThreadPerConRemoveVisitor", "status");
00023   return this->status_;
00024 }

Here is the caller graph for this function:

int OpenDDS::DCPS::ThreadPerConRemoveVisitor::visit_element_remove ( SendRequest element,
int &  remove 
) [virtual]

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

Reimplemented from OpenDDS::DCPS::BasicQueueVisitor< SendRequest >.

Definition at line 28 of file ThreadPerConRemoveVisitor.cpp.

References OpenDDS::DCPS::TransportQueueElement::data_dropped(), DBG_ENTRY, OpenDDS::DCPS::SendRequest::element_, OpenDDS::DCPS::SendRequest::op_, ACE_Message_Block::rd_ptr(), OpenDDS::DCPS::REMOVE_FOUND, OpenDDS::DCPS::REMOVE_RELEASED, sample_, OpenDDS::DCPS::SEND, and status_.

00030 {
00031   DBG_ENTRY("ThreadPerConRemoveVisitor", "visit_element_remove");
00032 
00033   TransportQueueElement::MatchOnDataPayload modp(this->sample_->rd_ptr());
00034   if ((req->op_ == SEND) && modp.matches(*req->element_)) {
00035     // We are visiting the element that we want to remove, since the
00036     // element "matches" our sample_.
00037 
00038     // In order to have the BasicQueue<T> remove the element that we
00039     // are currently visiting, set the remove flag to true (1).  The
00040     // BasicQueue<T> will perform the actual removal once we return
00041     // from this method.
00042     remove = 1;
00043 
00044     // Inform the element that we've made a decision - and it is
00045     // data_dropped()
00046     const bool released = req->element_->data_dropped();
00047 
00048     // Adjust our status_ to indicate that we actually found (and removed)
00049     // the sample.
00050     this->status_ = released ? REMOVE_RELEASED : REMOVE_FOUND;
00051 
00052     // Stop visitation since we've handled the element that matched
00053     // our sample_.
00054     return 0;
00055   }
00056 
00057   // Continue visitation.
00058   return 1;
00059 }

Here is the call graph for this function:


Member Data Documentation

The sample that needs to be removed.

Definition at line 46 of file ThreadPerConRemoveVisitor.h.

Referenced by visit_element_remove().

Holds the status of our visit.

Definition at line 49 of file ThreadPerConRemoveVisitor.h.

Referenced by status(), and visit_element_remove().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1