00001
00002
00003 #include "tao/Transport_Selection_Guard.h"
00004 #include "tao/TSS_Resources.h"
00005
00006 ACE_RCSID (tao,
00007 Transport_Selection_Guard,
00008 "$Id: Transport_Selection_Guard.cpp 79335 2007-08-14 10:26:42Z johnnyw $")
00009
00010 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00011
00012 namespace TAO
00013 {
00014
00015 Transport_Selection_Guard*
00016 Transport_Selection_Guard::current (TAO_ORB_Core* core, size_t tss_slot_id)
00017 {
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 ACE_UNUSED_ARG (core);
00030 ACE_UNUSED_ARG (tss_slot_id);
00031
00032 #if TAO_HAS_TRANSPORT_CURRENT == 1
00033
00034 return TAO_TSS_Resources::instance ()->tsg_;
00035
00036 #else
00037
00038 return 0;
00039
00040 #endif
00041 }
00042
00043
00044
00045
00046 Transport_Selection_Guard::Transport_Selection_Guard (TAO_Transport* t)
00047 :
00048 #if TAO_HAS_TRANSPORT_CURRENT == 1
00049
00050 prev_ (TAO_TSS_Resources::instance ()->tsg_)
00051 ,
00052
00053 #endif
00054 curr_ (t)
00055 {
00056 #if TAO_HAS_TRANSPORT_CURRENT == 1
00057
00058 TAO_TSS_Resources::instance ()->tsg_ = this;
00059
00060 #endif
00061
00062 }
00063
00064
00065 Transport_Selection_Guard::~Transport_Selection_Guard (void)
00066 {
00067
00068 #if TAO_HAS_TRANSPORT_CURRENT == 1
00069
00070 TAO_TSS_Resources::instance ()->tsg_ = prev_;
00071 this->prev_ = 0;
00072
00073 #endif
00074 this->curr_ = 0;
00075 }
00076
00077 }
00078
00079 TAO_END_VERSIONED_NAMESPACE_DECL