#include <PICurrent_Guard.h>
Public Member Functions | |
PICurrent_Guard (TAO_ServerRequest &server_request, bool tsc_to_rsc) | |
Constructor. | |
~PICurrent_Guard (void) | |
Destructor. | |
Private Attributes | |
PICurrent_Impl * | src_ |
The PICurrent implementation whose slot table will be copied. | |
PICurrent_Impl * | dest_ |
Since copies between the request scope current and thread scope current must also occur if an exception is thrown, e.g. made available to the send_exception() interception points, the "guard" idiom is used to make this action exception-safe.
Definition at line 50 of file PICurrent_Guard.h.
|
Constructor. This constructor sets up this guard to copy the data held in a given PICurrent when transitioning from that PICurrent's scope to another scope (e.g. request scope to thread scope transition immediately following receive_request_service_contexts() on server side).
Definition at line 18 of file PICurrent_Guard.cpp. References dest_, TAO_ServerRequest::orb_core(), TAO_ORB_Core::pi_current(), TAO_ServerRequest::rs_pi_current(), and src_.
00020 : src_ (0), 00021 dest_ (0) 00022 { 00023 // This constructor is used on the server side. 00024 00025 // Retrieve the thread scope current (no TSS access incurred yet). 00026 CORBA::Object_ptr pi_current_obj = 00027 server_request.orb_core ()->pi_current (); 00028 00029 TAO::PICurrent *pi_current = 00030 dynamic_cast <TAO::PICurrent*> (pi_current_obj); 00031 00032 // If the slot count is zero, there is nothing to copy. Prevent any 00033 // copying (and hence TSS accesses) from occurring. 00034 if (pi_current != 0 && pi_current->slot_count () != 0) 00035 { 00036 // Retrieve the request scope current. 00037 PICurrent_Impl * rsc = server_request.rs_pi_current (); 00038 00039 // Retrieve the thread scope current. 00040 PICurrent_Impl * tsc = pi_current->tsc (); 00041 00042 if (tsc_to_rsc) 00043 { 00044 // TSC to RSC copy. 00045 // Occurs after receive_request() interception point and 00046 // upcall. 00047 this->src_ = tsc; 00048 this->dest_ = rsc; 00049 } 00050 else 00051 { 00052 // RSC to TSC copy. 00053 // Occurs after receive_request_service_contexts() 00054 // interception point. 00055 this->src_ = rsc; 00056 this->dest_ = tsc; 00057 } 00058 } 00059 } |
|
Destructor. The destructor copies (a logical copy whenever possible) data held in a given PICurrent when transitioning from one PICurrent scope to another immediately before any ending interception points are invoked, and after the starting and intermediate (if any) interception points are invoked. Definition at line 61 of file PICurrent_Guard.cpp.
|
|
The PICurrent implementation whose slot table will be filled with the contents of another PICurrent's slot table. Definition at line 86 of file PICurrent_Guard.h. Referenced by PICurrent_Guard(), and ~PICurrent_Guard(). |
|
The PICurrent implementation whose slot table will be copied.
Definition at line 82 of file PICurrent_Guard.h. Referenced by PICurrent_Guard(), and ~PICurrent_Guard(). |