PortableGroup_Acceptor_Registry.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     PortableGroup_Acceptor_Registry.h
00006  *
00007  *  $Id: PortableGroup_Acceptor_Registry.h 77080 2007-02-12 19:43:29Z johnnyw $
00008  *
00009  *  Registry for dynamically created acceptors.
00010  *
00011  *  @author Frank Hunleth <fhunleth@cs.wustl.edu>
00012  */
00013 //=============================================================================
00014 
00015 #ifndef TAO_PORTABLEGROUP_ACCEPTOR_REGISTRY_H
00016 #define TAO_PORTABLEGROUP_ACCEPTOR_REGISTRY_H
00017 
00018 #include /**/ "ace/pre.h"
00019 
00020 #include "ace/Unbounded_Queue.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #include "ace/CORBA_macros.h"
00027 
00028 #include "orbsvcs/PortableGroup/portablegroup_export.h"
00029 
00030 #include "tao/Transport_Acceptor.h"
00031 #include "tao/Resource_Factory.h"
00032 
00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00034 
00035 class TAO_Profile;
00036 
00037 namespace CORBA
00038 {
00039   class Environment;
00040 }
00041 
00042 /**
00043  * @class TAO_PortableGroup_Acceptor_Registry
00044  *
00045  * @brief .
00046  *
00047  * There is one TAO_PortableGroup_Acceptor_Registry per ORB_Core.
00048  */
00049 class TAO_PortableGroup_Export TAO_PortableGroup_Acceptor_Registry
00050 {
00051 public:
00052 
00053   /**
00054    * @struct Entry
00055    *
00056    * @brief Value field of the portable group acceptor registry.
00057    */
00058   struct Entry
00059   {
00060     /// Pointer to the acceptor for this GroupId.
00061     TAO_Acceptor *acceptor;
00062 
00063     /// Cached endpoint that the acceptor is listening on.
00064     TAO_Endpoint *endpoint;
00065 
00066     /// Count of times that this GroupId has been opened.
00067     int cnt;
00068   };
00069 
00070 
00071   // = Initialization and termination methods.
00072   ///  Default constructor.
00073   TAO_PortableGroup_Acceptor_Registry (void);
00074 
00075   ///  Default destructor.
00076   ~TAO_PortableGroup_Acceptor_Registry (void);
00077 
00078   /// Open an acceptor based on a tagged profile.
00079   void open (const TAO_Profile* profile, TAO_ORB_Core &orb_core);
00080 
00081   /// Close all open acceptors.
00082   int close_all (void);
00083 
00084   typedef ACE_Unbounded_Queue<Entry> Acceptor_Registry;
00085   typedef ACE_Unbounded_Queue_Iterator<Entry> Acceptor_Registry_Iterator;
00086 
00087 protected:
00088 
00089   /// Helper function to open a group acceptor.
00090   void open_i (const TAO_Profile* profile,
00091                TAO_ORB_Core &orb_core,
00092                TAO_ProtocolFactorySetItor &factory);
00093 
00094   /// Find an acceptor by using a profile.
00095   int find (const TAO_Profile* profile,
00096             Entry *&entry);
00097 
00098 private:
00099 
00100   // The acceptor registry should not be copied.
00101   TAO_PortableGroup_Acceptor_Registry (
00102     const TAO_PortableGroup_Acceptor_Registry&);
00103   void operator= (const TAO_PortableGroup_Acceptor_Registry&);
00104 
00105 private:
00106   /// List of acceptors that are currently open.
00107   Acceptor_Registry registry_;
00108 };
00109 
00110 TAO_END_VERSIONED_NAMESPACE_DECL
00111 
00112 #include /**/ "ace/post.h"
00113 
00114 #endif /* TAO_PORTABLEGROUP_ACCEPTOR_REGISTRY_H */

Generated on Sun Jan 27 16:22:31 2008 for TAO_PortableGroup by doxygen 1.3.6