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 80288 2007-12-17 20:05:04Z 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_Acceptor;
00038 
00039 // Service Handler for this transport
00040 typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
00041         TAO_COIOP_SVC_HANDLER;
00042 
00043 /**
00044  * @class TAO_COIOP_Transport
00045  *
00046  * @brief Specialization of the base TAO_Transport class to handle the
00047  *  COIOP protocol.
00048  */
00049 class TAO_Strategies_Export TAO_COIOP_Transport : public TAO_Transport
00050 {
00051 public:
00052 
00053   /// Constructor.
00054   TAO_COIOP_Transport (TAO_COIOP_Connection_Handler *handler,
00055                        TAO_ORB_Core *orb_core);
00056 
00057   /// Default destructor.
00058   ~TAO_COIOP_Transport (void);
00059 
00060   /// Look for the documentation in Transport.h.
00061   virtual int handle_input (TAO_Resume_Handle &rh,
00062                             ACE_Time_Value *max_wait_time = 0);
00063 protected:
00064   /** @name Overridden Template Methods
00065    *
00066    * These are implementations of template methods declared by TAO_Transport.
00067    */
00068   //@{
00069 
00070   virtual ACE_Event_Handler * event_handler_i (void);
00071   virtual TAO_Connection_Handler *connection_handler_i (void);
00072 
00073   /// Write the complete Message_Block chain to the connection.
00074   virtual ssize_t send (iovec *iov, int iovcnt,
00075                         size_t &bytes_transferred,
00076                         const ACE_Time_Value *max_wait_time);
00077 
00078   /// Read len bytes from into buf.
00079   virtual ssize_t recv (char *buf,
00080                         size_t len,
00081                         const ACE_Time_Value *s = 0);
00082 
00083   virtual int send_message_shared (TAO_Stub *stub,
00084                                    TAO_Message_Semantics message_semantics,
00085                                    const ACE_Message_Block *message_block,
00086                                    ACE_Time_Value *max_wait_time);
00087 
00088   virtual int register_handler (void);
00089 
00090   ///@}
00091 public:
00092   /// @todo These methods IMHO should have more meaningful names.
00093   /// The names seem to indicate nothing.
00094   virtual int send_request (TAO_Stub *stub,
00095                             TAO_ORB_Core *orb_core,
00096                             TAO_OutputCDR &stream,
00097                             TAO_Message_Semantics message_semantics,
00098                             ACE_Time_Value *max_wait_time);
00099 
00100   virtual int send_message (TAO_OutputCDR &stream,
00101                             TAO_Stub *stub = 0,
00102                             TAO_Message_Semantics message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST,
00103                             ACE_Time_Value *max_time_wait = 0);
00104 
00105 private:
00106 
00107   /// The connection service handler used for accessing lower layer
00108   /// communication protocols.
00109   TAO_COIOP_Connection_Handler *connection_handler_;
00110 };
00111 
00112 TAO_END_VERSIONED_NAMESPACE_DECL
00113 
00114 #endif /* TAO_HAS_COIOP && TAO_HAS_COIOP != 0 */
00115 
00116 #include /**/ "ace/post.h"
00117 
00118 #endif  /* TAO_COIOP_TRANSPORT_H */

Generated on Tue Feb 2 17:47:18 2010 for TAO_Strategies by  doxygen 1.4.7