UIPMC_Transport.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     UIPMC_Transport.h
00006  *
00007  *  UIPMC_Transport.h,v 1.17 2006/03/14 06:14:34 jtc Exp
00008  *
00009  *  @author Frank Hunleth <fhunleth@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_UIPMC_TRANSPORT_H
00014 #define TAO_UIPMC_TRANSPORT_H
00015 #include /**/ "ace/pre.h"
00016 
00017 #include "orbsvcs/PortableGroup/portablegroup_export.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 #include "tao/Transport.h"
00024 
00025 #include "ace/SOCK_Stream.h"
00026 #include "ace/Svc_Handler.h"
00027 
00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00029 
00030 // Forward decls.
00031 class TAO_UIPMC_Connection_Handler;
00032 class TAO_ORB_Core;
00033 class TAO_Operation_Details;
00034 class TAO_Pluggable_Messaging;
00035 class TAO_Acceptor;
00036 
00037 // Service Handler for this transport
00038 typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
00039         TAO_UIPMC_SVC_HANDLER;
00040 
00041 #if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
00042 template class TAO_PortableGroup_Export ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>;
00043 #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
00044 
00045 /**
00046  * @class TAO_UIPMC_Transport
00047  *
00048  * @brief Specialization of the base TAO_Transport class to handle the
00049  *  MIOP protocol.
00050  */
00051 class TAO_PortableGroup_Export TAO_UIPMC_Transport : public TAO_Transport
00052 {
00053 public:
00054 
00055   /// Constructor.
00056   TAO_UIPMC_Transport (TAO_UIPMC_Connection_Handler *handler,
00057                       TAO_ORB_Core *orb_core,
00058                       CORBA::Boolean flag);
00059 
00060   /// Default destructor.
00061   ~TAO_UIPMC_Transport (void);
00062 
00063   /// Look for the documentation in Transport.h.
00064   virtual int handle_input (TAO_Resume_Handle &rh,
00065                             ACE_Time_Value *max_wait_time = 0,
00066                             int block = 0);
00067 protected:
00068   /** @name Overridden Template Methods
00069    *
00070    * These are implementations of template methods declared by TAO_Transport.
00071    */
00072   //@{
00073 
00074   virtual ACE_Event_Handler * event_handler_i (void);
00075   virtual TAO_Connection_Handler *connection_handler_i (void);
00076   virtual TAO_Pluggable_Messaging *messaging_object (void);
00077 
00078   /// Write the complete Message_Block chain to the connection.
00079   virtual ssize_t send (iovec *iov, int iovcnt,
00080                         size_t &bytes_transferred,
00081                         const ACE_Time_Value *max_wait_time);
00082 
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 register_handler (void);
00090 
00091 public:
00092   /// @@TODO: These methods IMHO should have more meaningful
00093   /// names. 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                             int message_semantics,
00098                             ACE_Time_Value *max_wait_time);
00099 
00100   virtual int send_message (TAO_OutputCDR &stream,
00101                             TAO_Stub *stub = 0,
00102                             int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST,
00103                             ACE_Time_Value *max_time_wait = 0);
00104 
00105   /// Initialising the messaging object
00106   virtual int messaging_init (CORBA::Octet major,
00107                               CORBA::Octet minor);
00108 
00109   //@}
00110 
00111 private:
00112   /// Process the message that we have read.
00113   int process_message (void);
00114 
00115   /// Construct and write a unique ID to the MIOP header.
00116   void write_unique_id (TAO_OutputCDR &miop_hdr, unsigned long unique);
00117 
00118 private:
00119 
00120   /// The connection service handler used for accessing lower layer
00121   /// communication protocols.
00122   TAO_UIPMC_Connection_Handler *connection_handler_;
00123 
00124   /// Our messaging object.
00125   TAO_Pluggable_Messaging *messaging_object_;
00126 };
00127 
00128 TAO_END_VERSIONED_NAMESPACE_DECL
00129 
00130 #include /**/ "ace/post.h"
00131 #endif  /* TAO_UIPMC_TRANSPORT_H */

Generated on Thu Nov 9 14:03:35 2006 for TAO_PortableGroup by doxygen 1.3.6