3 // ===================================================================
5 * @file PICurrent_Impl.h
7 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
9 // ===================================================================
11 #ifndef TAO_PI_CURRENT_IMPL_H
12 #define TAO_PI_CURRENT_IMPL_H
14 #include /**/ "ace/pre.h"
16 #include "tao/PI/pi_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/orbconf.h"
24 #if TAO_HAS_INTERCEPTORS == 1
26 #include "tao/PI/PI_includeC.h"
27 #include "tao/AnyTypeCode/Any.h"
28 #include "ace/Array_Base.h"
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 /// Forward declarations.
38 * @class PICurrent_Impl
40 * @brief Implementation of the PortableInterceptor::Current
43 * This class implements both the "request scope current" and the
44 * "thread scope current" objects as required by Portable
47 class TAO_PI_Export PICurrent_Impl
51 PICurrent_Impl (TAO_ORB_Core
*orb_core
= 0,
53 PICurrent_Impl
*pop
= 0);
57 /// Retrieve information stored in the slot table at the given
59 CORBA::Any
*get_slot (PortableInterceptor::SlotId identifier
);
61 /// Set information in the slot table at the given SlotId.
62 void set_slot (PortableInterceptor::SlotId identifier
,
63 const CORBA::Any
& data
);
65 /// Logically/Lazy (shallow) copy the given object's slot table.
66 void take_lazy_copy (PICurrent_Impl
*p
);
68 /// Push a new PICurrent_Impl on stack
71 /// Pop old PICurrent_Impl from stack
75 /// Force this object to convert from a logical (referenced)
76 /// copy, to a physical (or deep, actual) copy.
77 void convert_from_lazy_to_real_copy ();
79 /// Set the callback PICurrent_Impl object that will be notified
80 /// of this object's impending destruction or change.
81 /// Set to 0 to clear. (NOTE Only handles a SINGLE object at
82 /// at time, does NOT warn previous callback that this has
84 void set_callback_for_impending_change (PICurrent_Impl
*p
);
86 /// Typedef for the underyling "slot table."
87 typedef ACE_Array_Base
<CORBA::Any
> Table
;
89 /// Return a reference to the slot table currently associated
90 /// with this PICurrent_Impl object.
92 * @return Logically copied slot table if available, otherwise
93 * underlying slot table.
95 Table
& current_slot_table ();
97 PICurrent_Impl (const PICurrent_Impl
&) = delete;
98 void operator= (const PICurrent_Impl
&) = delete;
101 /// Allow for stack of PICurrent_Impl as required.
102 TAO_ORB_Core
*orb_core_
;
104 PICurrent_Impl
*pop_
;
105 PICurrent_Impl
*push_
;
107 /// Array of CORBA::Anys that is the underlying "slot table."
110 /// Access to logical copy from a PICurrent_Impl in another
111 /// scope, i.e. either the request scope or the thread scope.
112 PICurrent_Impl
*lazy_copy_
;
114 /// PICurrent_Impl object that will be notified of this object's
115 /// impending destruction or change to its slot_table_. This is
116 /// the PICurrent_Impl that has access to our slot_table_ via its
117 /// lazy_copy_ pointer. As necessary this allows that object's
118 /// convert_from_lazy_to_real_copy() to be called.
119 PICurrent_Impl
*impending_change_callback_
;
123 TAO_END_VERSIONED_NAMESPACE_DECL
125 #if defined (__ACE_INLINE__)
126 # include "tao/PI/PICurrent_Impl.inl"
127 #endif /* __ACE_INLINE__ */
129 #endif /* TAO_HAS_INTERCEPTORS == 1 */
131 #include /**/ "ace/post.h"
133 #endif /* TAO_PI_CURRENT_IMPL_H */