Delivery_Request.cpp

Go to the documentation of this file.
00001 // Delivery_Request.cpp,v 1.7 2006/03/14 06:14:34 jtc Exp
00002 
00003 #include "orbsvcs/Notify/Delivery_Request.h"
00004 
00005 #if ! defined (__ACE_INLINE__)
00006 #include "orbsvcs/Notify/Delivery_Request.inl"
00007 #endif /* __ACE_INLINE__ */
00008 
00009 #include "orbsvcs/Notify/Routing_Slip.h"
00010 
00011 #include "tao/debug.h"
00012 #include "tao/corba.h"
00013 
00014 //#define DEBUG_LEVEL 9
00015 #ifndef DEBUG_LEVEL
00016 # define DEBUG_LEVEL TAO_debug_level
00017 #endif //DEBUG_LEVEL
00018 
00019 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00020 
00021 namespace TAO_Notify
00022 {
00023 
00024 ///////////////////
00025 // Delivery_Request
00026 Delivery_Request::Delivery_Request (const Routing_Slip_Ptr & routing_slip, size_t request_id)
00027   : routing_slip_ (routing_slip)
00028   , request_id_ (request_id)
00029   , delivery_type_ (0)
00030 {
00031   if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
00032       ACE_TEXT ("(%P|%t) Delivery_Request:: constructor\n")
00033       ));
00034 }
00035 
00036 Delivery_Request::~Delivery_Request ()
00037 {
00038   if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
00039       ACE_TEXT ("(%P|%t) Delivery_Request:: destructor\n")
00040       ));
00041 }
00042 
00043 // DO NOT INLINE THIS.  It uses the Routing_Slip_Ptr which cannot be declared at
00044 // the time Delivery_Request.inl is compiled.
00045 void
00046 Delivery_Request::complete ()
00047 {
00048   routing_slip_->delivery_request_complete (this->request_id_);
00049 }
00050 
00051 // DO NOT INLINE THIS.  It uses the Routing_Slip_Ptr which cannot be declared at
00052 // the time Delivery_Request.inl is compiled.
00053 const TAO_Notify_Event::Ptr &
00054 Delivery_Request::event () const
00055 {
00056   return this->routing_slip_->event ();
00057 }
00058 
00059 void
00060 Delivery_Request::marshal (TAO_OutputCDR & cdr)
00061 {
00062   if (this->delivery_type_ != 0)
00063   {
00064     cdr.write_octet (this->delivery_type_);
00065     size_t dest_count = this->destination_id_.size ();
00066     cdr.write_ulong (dest_count);
00067     for (size_t ndest = 0; ndest < dest_count; ++ ndest)
00068     {
00069       cdr.write_ulong (this->destination_id_ [ndest]);
00070     }
00071   }
00072 }
00073 
00074 unsigned long
00075 Delivery_Request::sequence () const
00076 {
00077   return this->routing_slip_->sequence ();
00078 }
00079 
00080 
00081 bool
00082 Delivery_Request::should_retry () const
00083 {
00084   return this->routing_slip_->should_retry ();
00085 }
00086 
00087 void
00088 Delivery_Request::dispatch (
00089   TAO_Notify_ProxySupplier * proxy_supplier,
00090   bool filter ACE_ENV_ARG_DECL)
00091 {
00092   this->routing_slip_->dispatch (proxy_supplier, filter ACE_ENV_ARG_PARAMETER);
00093 }
00094 
00095 const Routing_Slip_Ptr &
00096 Delivery_Request::routing_slip () const
00097 {
00098   return this->routing_slip_;
00099 }
00100 
00101 } // namespace
00102 
00103 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 13:24:10 2006 for TAO_CosNotification by doxygen 1.3.6