Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / CSD_ThreadPool / CSD_TP_Dispatchable_Visitor.cpp
blob222a63547c79810cf79aa4b24be449e2a5d3f7d4
1 #include "tao/CSD_ThreadPool/CSD_TP_Dispatchable_Visitor.h"
3 #if !defined (__ACE_INLINE__)
4 # include "tao/CSD_ThreadPool/CSD_TP_Dispatchable_Visitor.inl"
5 #endif /* ! __ACE_INLINE__ */
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 TAO::CSD::TP_Dispatchable_Visitor::~TP_Dispatchable_Visitor()
14 bool
15 TAO::CSD::TP_Dispatchable_Visitor::visit_request(TP_Request* request,
16 bool& remove_flag)
18 // Ask the request object if the target servant is "ready" to accept
19 // a request being dispatched to it.
20 if (request->is_ready())
22 // Ok. This request is a "dispatchable" request. It is what we were
23 // hoping to find.
25 // Save a copy of the request in our handle data member.
26 request->_add_ref();
27 this->request_ = request;
29 // Make sure that the queue will extract the request from the queue
30 // upon our return.
31 remove_flag = true;
33 // Mark the target servant as being "busy".
34 request->mark_as_busy();
36 // Stop the visitation by returning false.
37 return false;
40 // The target servant object of the request isn't ready, so the request
41 // is not considered to be a "dispatchable" request.
43 // Return true to visit the next request in the queue (if there is one).
44 return true;
47 TAO_END_VERSIONED_NAMESPACE_DECL