3 // ===================================================================
5 * @file PICurrent_Guard.h
7 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
9 // ===================================================================
11 #ifndef TAO_PI_CURRENT_GUARD_H
12 #define TAO_PI_CURRENT_GUARD_H
14 #include /**/ "ace/pre.h"
16 #include "tao/PI_Server/pi_server_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 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
28 /// Forward declarations.
29 class TAO_ServerRequest
;
36 * @class PICurrent_Guard
38 * @brief Class used to make copying between request scope current
39 * and thread scope current exception-safe.
41 * Since copies between the request scope current and thread scope
42 * current must also occur if an exception is thrown, e.g. made
43 * available to the send_exception() interception points, the
44 * "guard" idiom is used to make this action exception-safe.
46 * @note This Guard class is only used on the server side.
53 * This constructor sets up this guard to copy the data held in a
54 * given PICurrent when transitioning from that PICurrent's scope
55 * to another scope (e.g. request scope to thread scope transition
56 * immediately following receive_request_service_contexts() on
59 * @param tsc_to_rsc true when copying TSC slot table to RSC slot
60 * table, i.e. after target operation
63 PICurrent_Guard (TAO_ServerRequest
&server_request
,
68 * The destructor copies (a logical copy whenever possible) data
69 * held in a given PICurrent when transitioning from one PICurrent
70 * scope to another immediately before any ending interception
71 * points are invoked, and after the starting and intermediate (if
72 * any) interception points are invoked.
77 /// The PICurrent implementation whose slot table will be copied.
80 /// The PICurrent implementation whose slot table will be filled
81 /// with the contents of another PICurrent's slot table.
82 PICurrent_Impl
*dest_
;
86 TAO_END_VERSIONED_NAMESPACE_DECL
88 #endif /* TAO_HAS_INTERCEPTORS == 1 */
90 #include /**/ "ace/post.h"
92 #endif /* TAO_PI_CURRENT_GUARD_H */