00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file TSS_Resources.h 00006 * 00007 * $Id: TSS_Resources.h 76092 2006-12-19 22:32:59Z iliyan $ 00008 * 00009 * @author DOC Group - ISIS at Vanderbilt University 00010 * @author DOC Center - Washington University at St. Louis 00011 * @author DOC Laboratory - University of California at Irvine 00012 */ 00013 // =================================================================== 00014 00015 #ifndef TAO_TAO_TSS_RESOURCES_H 00016 #define TAO_TAO_TSS_RESOURCES_H 00017 00018 #include /**/ "ace/pre.h" 00019 00020 #include /**/ "tao/TAO_Export.h" 00021 00022 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00023 # pragma once 00024 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00025 00026 #include "tao/Environment.h" 00027 00028 #include "tao/Policy_Current_Impl.h" 00029 00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00031 00032 // Forward declarations 00033 namespace TAO 00034 { 00035 class GUIResource_Factory; 00036 class Transport_Selection_Guard; 00037 } 00038 /** 00039 * @class TAO_TSS_Resources 00040 * 00041 * @brief The TSS resoures shared by all the ORBs 00042 * 00043 * This class is used by TAO to store the resources that are 00044 * thread-specific but are *not* ORB specific. The members are public 00045 * because only the ORB Core is expected to access them. 00046 */ 00047 class TAO_Export TAO_TSS_Resources 00048 { 00049 public: 00050 00051 /// Constructor 00052 TAO_TSS_Resources (void); 00053 00054 /// Destructor 00055 ~TAO_TSS_Resources (void); 00056 00057 /// Return a singleton instance of this class. 00058 static TAO_TSS_Resources * instance (void); 00059 00060 private: 00061 00062 /// Do not copy TSS resources 00063 //@{ 00064 TAO_TSS_Resources (const TAO_TSS_Resources&); 00065 void operator= (const TAO_TSS_Resources&); 00066 //@} 00067 00068 public: 00069 00070 /** 00071 * Points to structure containing state for the current upcall 00072 * context in this thread. Note that it does not come from the 00073 * resource factory because it must always be held in 00074 * thread-specific storage. For now, since TAO_ORB_Core instances 00075 * are TSS singletons, we simply ride along and don't allocate 00076 * occupy another TSS slot since there are some platforms where 00077 * those are precious commodities (e.g., NT). 00078 */ 00079 void * poa_current_impl_; 00080 00081 void * rtscheduler_current_impl_; 00082 00083 void * rtscheduler_previous_current_impl_; 00084 00085 /// The default environment for the thread. 00086 CORBA::Environment * default_environment_; 00087 00088 /// If the user (or library) provides no environment the ORB_Core 00089 /// still holds one. 00090 CORBA::Environment tss_environment_; 00091 00092 #if (TAO_HAS_CORBA_MESSAGING == 1) 00093 00094 /// The initial PolicyCurrent for this thread. Should be a TSS 00095 /// resource. 00096 TAO_Policy_Current_Impl initial_policy_current_; 00097 00098 /// This pointer is reset by the POA on each upcall. 00099 TAO_Policy_Current_Impl * policy_current_; 00100 00101 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ 00102 00103 /// A factory for creating GUIReactors. 00104 /** 00105 * @c GUIResource_Factory has to be stored in TSS, as GUIReactors 00106 * are operational only in within the context of GUI event loops. 00107 */ 00108 TAO::GUIResource_Factory * gui_resource_factory_; 00109 00110 #if TAO_HAS_TRANSPORT_CURRENT == 1 00111 00112 /// A TSS for a pointer to the current transport guard (see 00113 /// below). The guard keeps track of the Transport, if any that has 00114 /// been selected for use by the current thread, in the context of 00115 /// an upcall or client-side interceptor. 00116 00117 TAO::Transport_Selection_Guard* tsg_; 00118 00119 #endif /* TAO_HAS_TRANSPORT_CURRENT == 1 */ 00120 }; 00121 00122 TAO_END_VERSIONED_NAMESPACE_DECL 00123 00124 #include /**/ "ace/post.h" 00125 00126 #endif /* TAO_TSS_RESOURCES_H */