DIOP_Transport.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   DIOP_Transport.h
00006  *
00007  *  $Id: DIOP_Transport.h 79151 2007-08-01 09:04:36Z johnnyw $
00008  *
00009  *  @author  Michael Kircher
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_DIOP_TRANSPORT_H
00014 #define TAO_DIOP_TRANSPORT_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "tao/orbconf.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #if defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0)
00025 
00026 #include "tao/Strategies/strategies_export.h"
00027 #include "tao/Transport.h"
00028 #include "ace/SOCK_Dgram.h"
00029 #include "ace/Svc_Handler.h"
00030 
00031 #if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
00032 template class TAO_Strategies_Export ACE_Svc_Handler<ACE_SOCK_DGRAM, ACE_NULL_SYNCH>;
00033 #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
00034 
00035 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00036 
00037 // Forward decls.
00038 class TAO_DIOP_Connection_Handler;
00039 class TAO_ORB_Core;
00040 class TAO_Operation_Details;
00041 class TAO_Pluggable_Messaging;
00042 class TAO_Acceptor;
00043 
00044 // Service Handler for this transport
00045 typedef ACE_Svc_Handler<ACE_SOCK_DGRAM, ACE_NULL_SYNCH>
00046         TAO_DIOP_SVC_HANDLER;
00047 
00048 /**
00049  * @class TAO_DIOP_Transport
00050  *
00051  * @brief Specialization of the base TAO_Transport class to handle the
00052  *  DIOP protocol.
00053  */
00054 class TAO_Strategies_Export TAO_DIOP_Transport : public TAO_Transport
00055 {
00056 public:
00057 
00058   /// Constructor.
00059   TAO_DIOP_Transport (TAO_DIOP_Connection_Handler *handler,
00060                       TAO_ORB_Core *orb_core);
00061 
00062   /// Default destructor.
00063   ~TAO_DIOP_Transport (void);
00064 
00065   /// Look for the documentation in Transport.h.
00066   virtual int handle_input (TAO_Resume_Handle &rh,
00067                             ACE_Time_Value *max_wait_time = 0);
00068 protected:
00069   /** @name Overridden Template Methods
00070    *
00071    * These are implementations of template methods declared by TAO_Transport.
00072    */
00073   //@{
00074 
00075   virtual ACE_Event_Handler * event_handler_i (void);
00076   virtual TAO_Connection_Handler *connection_handler_i (void);
00077   virtual TAO_Pluggable_Messaging *messaging_object (void);
00078 
00079   /// Write the complete Message_Block chain to the connection.
00080   virtual ssize_t send (iovec *iov, int iovcnt,
00081                         size_t &bytes_transferred,
00082                         const ACE_Time_Value *max_wait_time);
00083 
00084   /// Read len bytes from into buf.
00085   virtual ssize_t recv (char *buf,
00086                         size_t len,
00087                         const ACE_Time_Value *s = 0);
00088 
00089   virtual int send_message_shared (TAO_Stub *stub,
00090                                    int message_semantics,
00091                                    const ACE_Message_Block *message_block,
00092                                    ACE_Time_Value *max_wait_time);
00093 
00094   virtual int register_handler (void);
00095 
00096   ///@}
00097 public:
00098   /// @todo These methods IMHO should have more meaningful names.
00099   /// The names seem to indicate nothing.
00100   virtual int send_request (TAO_Stub *stub,
00101                             TAO_ORB_Core *orb_core,
00102                             TAO_OutputCDR &stream,
00103                             int message_semantics,
00104                             ACE_Time_Value *max_wait_time);
00105 
00106   virtual int send_message (TAO_OutputCDR &stream,
00107                             TAO_Stub *stub = 0,
00108                             int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST,
00109                             ACE_Time_Value *max_time_wait = 0);
00110 
00111   /// Initialising the messaging object
00112   virtual int messaging_init (CORBA::Octet major,
00113                               CORBA::Octet minor);
00114 
00115 private:
00116 
00117   /// The connection service handler used for accessing lower layer
00118   /// communication protocols.
00119   TAO_DIOP_Connection_Handler *connection_handler_;
00120 
00121   /// Our messaging object.
00122   TAO_Pluggable_Messaging *messaging_object_;
00123 };
00124 
00125 TAO_END_VERSIONED_NAMESPACE_DECL
00126 
00127 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */
00128 
00129 #include /**/ "ace/post.h"
00130 
00131 #endif  /* TAO_DIOP_TRANSPORT_H */

Generated on Sun Jan 27 15:59:47 2008 for TAO_Strategies by doxygen 1.3.6