COIOP_Transport.h

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

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