00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file TSS_Resources.h 00006 * 00007 * TSS_Resources.h,v 1.10 2005/11/03 17:38:44 ossama Exp 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 } 00037 /** 00038 * @class TAO_TSS_Resources 00039 * 00040 * @brief The TSS resoures shared by all the ORBs 00041 * 00042 * This class is used by TAO to store the resources that are 00043 * thread-specific but are *not* ORB specific. The members are public 00044 * because only the ORB Core is expected to access them. 00045 */ 00046 class TAO_Export TAO_TSS_Resources 00047 { 00048 public: 00049 00050 /// Constructor 00051 TAO_TSS_Resources (void); 00052 00053 /// Destructor 00054 ~TAO_TSS_Resources (void); 00055 00056 /// Return a singleton instance of this class. 00057 static TAO_TSS_Resources * instance (void); 00058 00059 private: 00060 00061 /// Do not copy TSS resources 00062 //@{ 00063 TAO_TSS_Resources (const TAO_TSS_Resources&); 00064 void operator= (const TAO_TSS_Resources&); 00065 //@} 00066 00067 public: 00068 00069 /** 00070 * Points to structure containing state for the current upcall 00071 * context in this thread. Note that it does not come from the 00072 * resource factory because it must always be held in 00073 * thread-specific storage. For now, since TAO_ORB_Core instances 00074 * are TSS singletons, we simply ride along and don't allocate 00075 * occupy another TSS slot since there are some platforms where 00076 * those are precious commodities (e.g., NT). 00077 */ 00078 void * poa_current_impl_; 00079 00080 void * rtscheduler_current_impl_; 00081 00082 void * rtscheduler_previous_current_impl_; 00083 00084 /// The default environment for the thread. 00085 CORBA::Environment * default_environment_; 00086 00087 /// If the user (or library) provides no environment the ORB_Core 00088 /// still holds one. 00089 CORBA::Environment tss_environment_; 00090 00091 #if (TAO_HAS_CORBA_MESSAGING == 1) 00092 00093 /// The initial PolicyCurrent for this thread. Should be a TSS 00094 /// resource. 00095 TAO_Policy_Current_Impl initial_policy_current_; 00096 00097 /// This pointer is reset by the POA on each upcall. 00098 TAO_Policy_Current_Impl * policy_current_; 00099 00100 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ 00101 00102 /// A factory for creating GUIReactors. 00103 /** 00104 * @c GUIResource_Factory has to be stored in TSS, as GUIReactors 00105 * are operational only in within the context of GUI event loops. 00106 */ 00107 TAO::GUIResource_Factory * gui_resource_factory_; 00108 }; 00109 00110 TAO_END_VERSIONED_NAMESPACE_DECL 00111 00112 #include /**/ "ace/post.h" 00113 00114 #endif /* TAO_TSS_RESOURCES_H */