00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file TSS_Resources.h 00006 * 00007 * $Id: TSS_Resources.h 82826 2008-09-25 08:12:53Z smcqueen $ 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 CORBA priority of the thread if set via RTCORBA::Current. 00086 /// RTCORBA::minPriority - 1 otherwise. 00087 CORBA::Short rtcorba_current_priority_; 00088 00089 /// The default environment for the thread. 00090 CORBA::Environment * default_environment_; 00091 00092 /// If the user (or library) provides no environment the ORB_Core 00093 /// still holds one. 00094 CORBA::Environment tss_environment_; 00095 00096 #if (TAO_HAS_CORBA_MESSAGING == 1) 00097 00098 /// The initial PolicyCurrent for this thread. Should be a TSS 00099 /// resource. 00100 TAO_Policy_Current_Impl initial_policy_current_; 00101 00102 /// This pointer is reset by the POA on each upcall. 00103 TAO_Policy_Current_Impl * policy_current_; 00104 00105 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ 00106 00107 /// A factory for creating GUIReactors. 00108 /** 00109 * @c GUIResource_Factory has to be stored in TSS, as GUIReactors 00110 * are operational only in within the context of GUI event loops. 00111 */ 00112 TAO::GUIResource_Factory * gui_resource_factory_; 00113 00114 #if TAO_HAS_TRANSPORT_CURRENT == 1 00115 00116 /// A TSS for a pointer to the current transport guard (see 00117 /// below). The guard keeps track of the Transport, if any that has 00118 /// been selected for use by the current thread, in the context of 00119 /// an upcall or client-side interceptor. 00120 00121 TAO::Transport_Selection_Guard* tsg_; 00122 00123 #endif /* TAO_HAS_TRANSPORT_CURRENT == 1 */ 00124 }; 00125 00126 TAO_END_VERSIONED_NAMESPACE_DECL 00127 00128 #include /**/ "ace/post.h" 00129 00130 #endif /* TAO_TSS_RESOURCES_H */