#include <PICurrent.h>
Inheritance diagram for TAO::PICurrent:
Public Member Functions | |
PICurrent (TAO_ORB_Core &orb_core) | |
Constructor. | |
virtual CORBA::ORB_ptr | _get_orb () |
PortableInterceptor::SlotId | slot_count (void) const |
Number of slots allocated in the slot table. | |
PICurrent_Impl * | tsc (void) |
void | check_validity (const PortableInterceptor::SlotId &identifier) |
Verify the validity of the given SlotId. | |
int | initialize (PortableInterceptor::SlotId sc) |
Initialize the PICurrent object. | |
PortableInterceptor::Current Methods | |
virtual CORBA::Any * | get_slot (PortableInterceptor::SlotId id) throw (CORBA::SystemException, PortableInterceptor::InvalidSlot) |
virtual void | set_slot (PortableInterceptor::SlotId identifier, const CORBA::Any &data) throw (CORBA::SystemException, PortableInterceptor::InvalidSlot) |
Set information in the slot table at the given SlotId. | |
Protected Member Functions | |
virtual | ~PICurrent (void) |
Destructor. | |
Private Member Functions | |
PICurrent (const PICurrent &) | |
void | operator= (const PICurrent &) |
Private Attributes | |
TAO_ORB_Core & | orb_core_ |
Reference to the orb core. | |
size_t | tss_slot_ |
TSS slot assigned to this object. | |
PortableInterceptor::SlotId | slot_count_ |
The number of allocated slots. |
PortableInterceptor::Current is useful for passing data between request interceptors, in addition to passing data from an interceptor to the calling thread.
Definition at line 57 of file PICurrent.h.
|
Constructor.
Definition at line 23 of file PICurrent.cpp.
00024 : orb_core_ (orb_core), 00025 tss_slot_ (0), 00026 slot_count_ (0) 00027 { 00028 } |
|
Destructor. Protected destructor to enforce the fact this class is reference counted, and should not be destroyed using delete() by anything other than the reference counting mechanism. Definition at line 30 of file PICurrent.cpp.
00031 { 00032 } |
|
Prevent copying through the copy constructor and the assignment operator. |
|
Reimplemented from CORBA::LocalObject. Definition at line 94 of file PICurrent.cpp. References CORBA::ORB::_duplicate().
00095 { 00096 return CORBA::ORB::_duplicate (this->orb_core_.orb ()); 00097 } |
|
Verify the validity of the given SlotId.
Definition at line 84 of file PICurrent.cpp. References ACE_THROW.
00086 { 00087 // No need to acquire a lock for this check. At this point, these 00088 // attributes are read only. 00089 if (identifier >= this->slot_count_) 00090 ACE_THROW (PortableInterceptor::InvalidSlot ()); 00091 } |
|
Retrieve information stored in the slot table at the given SlotId. Definition at line 35 of file PICurrent.cpp. References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_THROW_RETURN, and TAO::PICurrent_Impl::get_slot().
00039 { 00040 this->check_validity (identifier ACE_ENV_ARG_PARAMETER); 00041 ACE_CHECK_RETURN (0); 00042 00043 PICurrent_Impl *impl = this->tsc (); 00044 00045 if (impl == 0) 00046 ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, 00047 CORBA::COMPLETED_NO), 00048 0); 00049 00050 return impl->get_slot (identifier ACE_ENV_ARG_PARAMETER); 00051 } |
|
Initialize the PICurrent object.
Definition at line 100 of file PICurrent.cpp. References ACE_NEW_RETURN, TAO_ORB_Core::add_tss_cleanup_func(), TAO_ORB_Core::set_tss_resource(), tsc(), and tss_slot_. Referenced by TAO::ORBInitializer_Registry::post_init().
00102 { 00103 this->slot_count_ = sc; 00104 00105 if (this->tsc () == 0 && tss_slot_ == 0) 00106 { 00107 TAO::PICurrent_Impl *impl = 0; 00108 ACE_NEW_RETURN (impl, 00109 TAO::PICurrent_Impl, 00110 0); 00111 00112 const int result = this->orb_core_.add_tss_cleanup_func (0, 00113 tss_slot_); 00114 00115 if (result != 0) 00116 return result; 00117 00118 this->orb_core_.set_tss_resource (tss_slot_, impl); 00119 } 00120 00121 return 0; 00122 } |
|
Prevent copying through the copy constructor and the assignment operator. |
|
Set information in the slot table at the given SlotId.
Definition at line 54 of file PICurrent.cpp. References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_THROW, and TAO::PICurrent_Impl::set_slot().
00059 { 00060 this->check_validity (identifier ACE_ENV_ARG_PARAMETER); 00061 ACE_CHECK; 00062 00063 PICurrent_Impl *impl = this->tsc (); 00064 00065 if (impl == 0) 00066 ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, 00067 CORBA::COMPLETED_NO)); 00068 00069 impl->set_slot (identifier, data ACE_ENV_ARG_PARAMETER); 00070 ACE_CHECK; 00071 } |
|
Number of slots allocated in the slot table.
Definition at line 8 of file PICurrent.inl. Referenced by TAO_ClientRequestInfo::setup_picurrent().
00009 { 00010 return this->slot_count_; 00011 } |
|
Retrieve the PICurrent implementation from TSS, i.e. the thread scope current (TSC). Definition at line 74 of file PICurrent.cpp. References TAO_ORB_Core::get_tss_resource(). Referenced by initialize(), and TAO_ClientRequestInfo::setup_picurrent().
00075 { 00076 TAO::PICurrent_Impl *impl = 00077 static_cast<TAO::PICurrent_Impl *> ( 00078 this->orb_core_.get_tss_resource (this->tss_slot_)); 00079 00080 return impl; 00081 } |
|
Reference to the orb core.
Reimplemented from CORBA::Object. Definition at line 127 of file PICurrent.h. |
|
The number of allocated slots.
Definition at line 133 of file PICurrent.h. |
|
TSS slot assigned to this object.
Definition at line 130 of file PICurrent.h. Referenced by initialize(). |