Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / TSS_Resources.h
blobeb2b7950d44a6047c7f01870bf0a7a81066ba5c9
1 // -*- C++ -*-
3 // ===================================================================
4 /**
5 * @file TSS_Resources.h
7 * @author DOC Group - ISIS at Vanderbilt University
8 * @author DOC Center - Washington University at St. Louis
9 * @author DOC Laboratory - University of California at Irvine
11 // ===================================================================
13 #ifndef TAO_TAO_TSS_RESOURCES_H
14 #define TAO_TAO_TSS_RESOURCES_H
16 #include /**/ "ace/pre.h"
18 #include /**/ "tao/TAO_Export.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "tao/Environment.h"
26 #include "tao/Policy_Current_Impl.h"
28 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
30 // Forward declarations
31 namespace TAO
33 class GUIResource_Factory;
34 class Transport_Selection_Guard;
36 /**
37 * @class TAO_TSS_Resources
39 * @brief The TSS resoures shared by all the ORBs
41 * This class is used by TAO to store the resources that are
42 * thread-specific but are *not* ORB specific. The members are public
43 * because only the ORB Core is expected to access them.
45 class TAO_Export TAO_TSS_Resources
47 public:
48 /// Constructor
49 TAO_TSS_Resources ();
51 /// Destructor
52 ~TAO_TSS_Resources ();
54 /// Return a singleton instance of this class.
55 static TAO_TSS_Resources * instance ();
57 private:
58 /// Do not copy TSS resources
59 //@{
60 TAO_TSS_Resources (const TAO_TSS_Resources&);
61 void operator= (const TAO_TSS_Resources&);
62 //@}
64 public:
65 /**
66 * Points to structure containing state for the current upcall
67 * context in this thread. Note that it does not come from the
68 * resource factory because it must always be held in
69 * thread-specific storage. For now, since TAO_ORB_Core instances
70 * are TSS singletons, we simply ride along and don't allocate
71 * occupy another TSS slot since there are some platforms where
72 * those are precious commodities (e.g., NT).
74 void * poa_current_impl_;
76 void * rtscheduler_current_impl_;
78 void * rtscheduler_previous_current_impl_;
80 /// The CORBA priority of the thread if set via RTCORBA::Current.
81 /// RTCORBA::minPriority - 1 otherwise.
82 CORBA::Short rtcorba_current_priority_;
84 /// The default environment for the thread.
85 CORBA::Environment * default_environment_;
87 /// If the user (or library) provides no environment the ORB_Core
88 /// still holds one.
89 CORBA::Environment tss_environment_;
91 #if (TAO_HAS_CORBA_MESSAGING == 1)
93 /// The initial PolicyCurrent for this thread. Should be a TSS
94 /// resource.
95 TAO_Policy_Current_Impl initial_policy_current_;
97 /// This pointer is reset by the POA on each upcall.
98 TAO_Policy_Current_Impl * policy_current_;
100 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
102 /// A factory for creating GUIReactors.
104 * @c GUIResource_Factory has to be stored in TSS, as GUIReactors
105 * are operational only in within the context of GUI event loops.
107 TAO::GUIResource_Factory * gui_resource_factory_;
109 #if TAO_HAS_TRANSPORT_CURRENT == 1
111 /// A TSS for a pointer to the current transport guard (see
112 /// below). The guard keeps track of the Transport, if any that has
113 /// been selected for use by the current thread, in the context of
114 /// an upcall or client-side interceptor.
116 TAO::Transport_Selection_Guard* tsg_;
118 #endif /* TAO_HAS_TRANSPORT_CURRENT == 1 */
121 TAO_END_VERSIONED_NAMESPACE_DECL
123 #include /**/ "ace/post.h"
125 #endif /* TAO_TSS_RESOURCES_H */