SHMIOP_Acceptor.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // $Id: SHMIOP_Acceptor.h 81470 2008-04-28 12:40:23Z elliott_c $
00003 // ===================================================================
00004 /**
00005  *  @file   SHMIOP_Acceptor.h
00006  *
00007  *  @brief  SHMIOP specific acceptor processing
00008  *
00009  *  @author Nanbor Wang <nanbor@cs.wustl.edu>
00010  */
00011 // ===================================================================
00012 
00013 #ifndef TAO_SHMIOP_ACCEPTOR_H
00014 #define TAO_SHMIOP_ACCEPTOR_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_SHMIOP) && (TAO_HAS_SHMIOP != 0)
00025 
00026 #include "tao/Transport_Acceptor.h"
00027 #include "tao/Strategies/SHMIOP_Connection_Handler.h"
00028 #include "tao/Acceptor_Impl.h"
00029 #include "ace/Acceptor.h"
00030 #include "ace/MEM_Acceptor.h"
00031 #include "tao/GIOP_Message_Version.h"
00032 // TAO SHMIOP_Acceptor concrete call definitions
00033 
00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00035 
00036 /**
00037  * @class TAO_SHMIOP_Acceptor
00038  *
00039  * @brief The SHMIOP-specific bridge class for the concrete acceptor.
00040  *
00041  */
00042 class TAO_Strategies_Export TAO_SHMIOP_Acceptor : public TAO_Acceptor
00043 {
00044 public:
00045   /// Constructor.
00046   TAO_SHMIOP_Acceptor (void);
00047 
00048   /// Destructor.
00049   ~TAO_SHMIOP_Acceptor (void);
00050 
00051   typedef TAO_Strategy_Acceptor<TAO_SHMIOP_Connection_Handler, ACE_MEM_ACCEPTOR> TAO_SHMIOP_BASE_ACCEPTOR;
00052   typedef TAO_Creation_Strategy<TAO_SHMIOP_Connection_Handler> TAO_SHMIOP_CREATION_STRATEGY;
00053   typedef TAO_Concurrency_Strategy<TAO_SHMIOP_Connection_Handler> TAO_SHMIOP_CONCURRENCY_STRATEGY;
00054   typedef TAO_Accept_Strategy<TAO_SHMIOP_Connection_Handler, ACE_MEM_ACCEPTOR> TAO_SHMIOP_ACCEPT_STRATEGY;
00055 
00056   /**
00057    * @name The TAO_Acceptor Methods
00058    *
00059    * Please check the documentation in Transport_Acceptor.h for details.
00060    */
00061   //@{
00062   virtual int open (TAO_ORB_Core *orb_core,
00063                     ACE_Reactor *reactor,
00064                     int version_major,
00065                     int version_minor,
00066                     const char *port,
00067                     const char *options = 0);
00068   virtual int open_default (TAO_ORB_Core *orb_core,
00069                             ACE_Reactor *reactor,
00070                             int version_major,
00071                             int version_minor,
00072                             const char *options = 0);
00073   virtual int close (void);
00074   virtual int create_profile (const TAO::ObjectKey &object_key,
00075                               TAO_MProfile &mprofile,
00076                               CORBA::Short priority);
00077 
00078   virtual int is_collocated (const TAO_Endpoint* endpoint);
00079   virtual CORBA::ULong endpoint_count (void);
00080 
00081   virtual int object_key (IOP::TaggedProfile &profile,
00082                           TAO::ObjectKey &key);
00083   //@}
00084 
00085   /// Set the MMAP options the MEM_Stream this acceptor creates will
00086   /// use.
00087   int set_mmap_options (const ACE_TCHAR *prefix,
00088                         ACE_OFF_T size);
00089 
00090 private:
00091   /// Implement the common part of the open*() methods.
00092   int open_i (TAO_ORB_Core* orb_core,
00093               ACE_Reactor *reactor);
00094 
00095   /// Parse protocol specific options.
00096   virtual int parse_options (const char *options);
00097 
00098   /// Create a SHMIOP profile representing this acceptor.
00099   int create_new_profile (const TAO::ObjectKey &object_key,
00100                           TAO_MProfile &mprofile,
00101                           CORBA::Short priority);
00102 
00103   /// Add the endpoints on this acceptor to a shared profile.
00104   int create_shared_profile (const TAO::ObjectKey &object_key,
00105                              TAO_MProfile &mprofile,
00106                              CORBA::Short priority);
00107 
00108 protected:
00109   /// Cache the information about the endpoint serviced by this
00110   /// acceptor.
00111   /// @todo There may in fact be multiple hostnames for this endpoint.
00112   ///    For example it the IP address is INADDR_ANY
00113   ///    (0.0.0.0) then there will be possibly a different hostname for
00114   ///    each interface.
00115   ACE_CString host_;
00116 
00117   /// A local endpoint.
00118   ACE_MEM_Addr address_;
00119 
00120   /// The GIOP version for this endpoint
00121   TAO_GIOP_Message_Version version_;
00122 
00123   /// ORB Core.
00124   TAO_ORB_Core *orb_core_;
00125 
00126 private:
00127   /// The concrete acceptor, as a pointer to it's base class.
00128   TAO_SHMIOP_BASE_ACCEPTOR base_acceptor_;
00129 
00130   /// Acceptor strategies.
00131   TAO_SHMIOP_CREATION_STRATEGY *creation_strategy_;
00132   TAO_SHMIOP_CONCURRENCY_STRATEGY *concurrency_strategy_;
00133   TAO_SHMIOP_ACCEPT_STRATEGY *accept_strategy_;
00134 
00135   /// Determine the prefix (include path name) of the mmap file.
00136   const ACE_TCHAR *mmap_file_prefix_;
00137 
00138   /// Determine the minimum size of mmap file.  This dictate the
00139   /// maximum size of a CORBA method invocation.
00140   ACE_OFF_T mmap_size_;
00141 };
00142 
00143 TAO_END_VERSIONED_NAMESPACE_DECL
00144 
00145 #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */
00146 
00147 #include /**/ "ace/post.h"
00148 
00149 #endif  /* TAO_SHMIOP_ACCEPTOR_H */

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