#include <PICurrent.h>
Inheritance diagram for TAO::PICurrent:
Public Member Functions | |
PICurrent (TAO_ORB_Core &orb_core) | |
Constructor. | |
virtual CORBA::ORB_ptr | _get_orb (void) |
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. | |
void | initialize (PortableInterceptor::SlotId sc) |
Initialize the PICurrent object. | |
PortableInterceptor::Current Methods | |
virtual CORBA::Any * | get_slot (PortableInterceptor::SlotId id) |
virtual void | set_slot (PortableInterceptor::SlotId identifier, const CORBA::Any &data) |
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_ |
PortableInterceptor::SlotId | slot_count_ |
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 22 of file PICurrent.cpp.
00023 : orb_core_ (orb_core), 00024 tss_slot_ (0), // Call initialize() before use. 00025 slot_count_ (0) // Call initialize() before use. 00026 { 00027 } |
|
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 29 of file PICurrent.cpp.
00030 { 00031 } |
|
Prevent copying through the copy constructor and the assignment operator. |
|
Reimplemented from CORBA::LocalObject. Definition at line 98 of file PICurrent.cpp. References CORBA::ORB::_duplicate().
00099 { 00100 return CORBA::ORB::_duplicate (this->orb_core_.orb ()); 00101 } |
|
Verify the validity of the given SlotId.
Definition at line 83 of file PICurrent.cpp. Referenced by get_slot(), and set_slot().
00084 { 00085 // If the slot_count is zero, no initialization has been done (if there are 00086 // no slots, then the PICurrent_impl object is not created as there is no 00087 // data to copy). 00088 if (0 == this->slot_count_) 00089 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00090 00091 // No need to acquire a lock for this check. At this point, these 00092 // attributes are read only. 00093 if (identifier >= this->slot_count_) 00094 throw PortableInterceptor::InvalidSlot (); 00095 } |
|
Retrieve information stored in the slot table at the given SlotId. Definition at line 34 of file PICurrent.cpp. References check_validity(), TAO::PICurrent_Impl::get_slot(), and tsc().
00035 { 00036 this->check_validity (identifier); 00037 00038 return this->tsc ()->get_slot (identifier); 00039 } |
|
Initialize the PICurrent object.
Definition at line 104 of file PICurrent.cpp. References TAO_ORB_Core::add_tss_cleanup_func(), and CleanUpPICurrent(). Referenced by TAO::ORBInitializer_Registry::post_init().
00105 { 00106 // Only allow a single initialization; sc is the number of 00107 // allocated PICurrent data slots the end user wants. If 0 00108 // PICurrent is not used, as no data is to be stored. 00109 if ((0 == this->slot_count_) && (0 != sc)) 00110 { 00111 // NOTE: This function not only adds the cleanup function 00112 // but ALSO allocates the TSS slot PICurrent is to use. 00113 // It MUST be called BEFORE we attempt to get/set any 00114 // PICurrent slot data. 00115 if (0 != orb_core_.add_tss_cleanup_func (CleanUpPICurrent, this->tss_slot_)) 00116 throw ::CORBA::NO_MEMORY ( 00117 CORBA::SystemException::_tao_minor_code ( 00118 TAO::VMCID, 00119 ENOMEM), 00120 CORBA::COMPLETED_NO); 00121 00122 this->slot_count_ = sc; 00123 } 00124 } |
|
Prevent copying through the copy constructor and the assignment operator. |
|
Set information in the slot table at the given SlotId.
Definition at line 42 of file PICurrent.cpp. References check_validity(), TAO::PICurrent_Impl::set_slot(), and tsc().
00044 { 00045 this->check_validity (identifier); 00046 00047 this->tsc ()->set_slot (identifier, data); 00048 } |
|
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 59 of file PICurrent.cpp. References ACE_NEW_THROW_EX, TAO_ORB_Core::get_tss_resource(), and TAO_ORB_Core::set_tss_resource(). Referenced by get_slot(), set_slot(), and TAO_ClientRequestInfo::setup_picurrent().
00060 { 00061 TAO::PICurrent_Impl *impl = 00062 static_cast<TAO::PICurrent_Impl *> ( 00063 this->orb_core_.get_tss_resource (this->tss_slot_)); 00064 00065 // If this TSS has not yet been set-up, give it it's own PICurrent_Impl. 00066 if (0 == impl) 00067 { 00068 ACE_NEW_THROW_EX (impl, 00069 TAO::PICurrent_Impl, 00070 CORBA::NO_MEMORY ( 00071 CORBA::SystemException::_tao_minor_code ( 00072 TAO::VMCID, 00073 ENOMEM), 00074 CORBA::COMPLETED_NO)); 00075 00076 this->orb_core_.set_tss_resource (this->tss_slot_, impl); 00077 } 00078 00079 return impl; 00080 } |
|
Reference to the orb core.
Reimplemented from CORBA::Object. Definition at line 115 of file PICurrent.h. |
|
The number of allocated PICurrent slots end user wants. (0 is uninitialized or PICurrent is not used as no data is to be stored). Definition at line 124 of file PICurrent.h. |
|
TSS slot assigned to PICurrent_Impl objects in the OrbCore. Allocated by the orb_core_.add_tss_cleanup_func() when our initialize() method is called. Definition at line 120 of file PICurrent.h. |