00001 #include "tao/RTScheduling/Current.h"
00002 #include "tao/RTScheduling/Distributable_Thread.h"
00003 #include "tao/RTCORBA/Priority_Mapping_Manager.h"
00004 #include "tao/RTCORBA/RT_Current.h"
00005 #include "tao/ORB_Core.h"
00006 #include "tao/TSS_Resources.h"
00007 #include "ace/ACE.h"
00008 #include "ace/OS_NS_errno.h"
00009 #include "ace/OS_NS_string.h"
00010
00011
00012 ACE_RCSID (RTScheduling,
00013 Current,
00014 "$Id: Current.cpp 89725 2010-03-30 19:34:35Z olli $")
00015
00016 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00017
00018 ACE_Atomic_Op<TAO_SYNCH_MUTEX, long> TAO_RTScheduler_Current::guid_counter;
00019
00020 u_long
00021 TAO_DTId_Hash::operator () (const IdType &id) const
00022 {
00023 return ACE::hash_pjw ((const char *) id.get_buffer (),
00024 id.length ());
00025 }
00026
00027 TAO_RTScheduler_Current::TAO_RTScheduler_Current (void)
00028 {
00029 }
00030
00031 TAO_RTScheduler_Current::~TAO_RTScheduler_Current (void)
00032 {
00033 }
00034
00035 void
00036 TAO_RTScheduler_Current::init (TAO_ORB_Core* orb)
00037 {
00038 this->orb_ = orb;
00039
00040
00041 RTCORBA::Current_ptr current;
00042 ACE_NEW_THROW_EX (current,
00043 TAO_RT_Current (orb),
00044 CORBA::NO_MEMORY (CORBA::SystemException::_tao_minor_code (
00045 TAO::VMCID,
00046 ENOMEM),
00047 CORBA::COMPLETED_NO));
00048 this->rt_current_ = current;
00049 }
00050
00051 void
00052 TAO_RTScheduler_Current::rt_current (RTCORBA::Current_ptr rt_current)
00053 {
00054 this->rt_current_ = RTCORBA::Current::_duplicate (rt_current);
00055 }
00056
00057 TAO_ORB_Core*
00058 TAO_RTScheduler_Current::orb (void)
00059 {
00060 return this->orb_;
00061 }
00062
00063 DT_Hash_Map*
00064 TAO_RTScheduler_Current::dt_hash (void)
00065 {
00066 return &this->dt_hash_;
00067 }
00068
00069
00070 void
00071 TAO_RTScheduler_Current::begin_scheduling_segment (
00072 const char * name,
00073 CORBA::Policy_ptr sched_param,
00074 CORBA::Policy_ptr implicit_sched_param)
00075 {
00076 TAO_RTScheduler_Current_i *impl = this->implementation ();
00077
00078 if (impl == 0)
00079 {
00080 ACE_NEW_THROW_EX (impl,
00081 TAO_RTScheduler_Current_i (this->orb_,
00082 &this->dt_hash_),
00083 CORBA::NO_MEMORY (
00084 CORBA::SystemException::_tao_minor_code (
00085 TAO::VMCID,
00086 ENOMEM),
00087 CORBA::COMPLETED_NO));
00088
00089 this->implementation (impl);
00090 }
00091
00092 impl->begin_scheduling_segment (name,
00093 sched_param,
00094 implicit_sched_param
00095 );
00096 }
00097
00098
00099 void
00100 TAO_RTScheduler_Current::update_scheduling_segment (const char * name,
00101 CORBA::Policy_ptr sched_param,
00102 CORBA::Policy_ptr implicit_sched_param
00103 )
00104 {
00105 TAO_RTScheduler_Current_i *impl = this->implementation ();
00106
00107 if (impl == 0)
00108 throw ::CORBA::BAD_INV_ORDER ();
00109
00110 impl->update_scheduling_segment (name,
00111 sched_param,
00112 implicit_sched_param
00113 );
00114 }
00115
00116 void
00117 TAO_RTScheduler_Current::end_scheduling_segment (const char * name)
00118 {
00119 TAO_RTScheduler_Current_i *impl = this->implementation ();
00120
00121 if (impl == 0)
00122 {
00123 ACE_ERROR ((LM_ERROR,
00124 "Missing scheduling context OR DT cancelled\n"));
00125 throw ::CORBA::BAD_INV_ORDER ();
00126 return;
00127 }
00128
00129 impl->end_scheduling_segment (name
00130 );
00131 }
00132
00133 RTScheduling::DistributableThread_ptr
00134 TAO_RTScheduler_Current::lookup(const RTScheduling::Current::IdType & id)
00135 {
00136 RTScheduling::DistributableThread_var DT;
00137 int result = this->dt_hash_.find (id,
00138 DT);
00139 if (result == 0)
00140 return DT._retn ();
00141 else return RTScheduling::DistributableThread::_nil ();
00142 }
00143
00144
00145
00146
00147
00148 RTScheduling::DistributableThread_ptr
00149 TAO_RTScheduler_Current::spawn (RTScheduling::ThreadAction_ptr start,
00150 CORBA::VoidData data,
00151 const char* name,
00152 CORBA::Policy_ptr sched_param,
00153 CORBA::Policy_ptr implicit_sched_param,
00154 CORBA::ULong stack_size,
00155 RTCORBA::Priority base_priority)
00156 {
00157 TAO_RTScheduler_Current_i *impl = this->implementation ();
00158
00159 if (impl == 0)
00160 throw ::CORBA::BAD_INV_ORDER ();
00161
00162 return impl->spawn (start,
00163 data,
00164 name,
00165 sched_param,
00166 implicit_sched_param,
00167 stack_size,
00168 base_priority
00169 );
00170 }
00171
00172 RTScheduling::Current::IdType *
00173 TAO_RTScheduler_Current::id (void)
00174 {
00175 TAO_RTScheduler_Current_i *impl = this->implementation ();
00176
00177 if (impl == 0)
00178 throw ::CORBA::BAD_INV_ORDER ();
00179
00180 return impl->id ();
00181 }
00182
00183 CORBA::Policy_ptr
00184 TAO_RTScheduler_Current::scheduling_parameter (void)
00185 {
00186
00187 TAO_RTScheduler_Current_i *impl = this->implementation ();
00188
00189 if (impl == 0)
00190 throw ::CORBA::BAD_INV_ORDER ();
00191
00192 return impl->scheduling_parameter ();
00193 }
00194
00195 CORBA::Policy_ptr
00196 TAO_RTScheduler_Current::implicit_scheduling_parameter (void)
00197 {
00198 TAO_RTScheduler_Current_i *impl = this->implementation ();
00199
00200 if (impl == 0)
00201 throw ::CORBA::BAD_INV_ORDER ();
00202
00203 return impl->implicit_scheduling_parameter ();
00204 }
00205
00206 RTScheduling::Current::NameList *
00207 TAO_RTScheduler_Current::current_scheduling_segment_names (void)
00208 {
00209 TAO_RTScheduler_Current_i *impl = this->implementation ();
00210
00211 if (impl == 0)
00212 throw ::CORBA::BAD_INV_ORDER ();
00213
00214 return impl->current_scheduling_segment_names ();
00215 }
00216
00217 RTCORBA::Priority
00218 TAO_RTScheduler_Current::the_priority (void)
00219 {
00220 return this->rt_current_->the_priority ();
00221 }
00222
00223 void
00224 TAO_RTScheduler_Current::the_priority (RTCORBA::Priority the_priority)
00225 {
00226 this->rt_current_->the_priority(the_priority);
00227 }
00228
00229 TAO_RTScheduler_Current_i*
00230 TAO_RTScheduler_Current::implementation (TAO_RTScheduler_Current_i* new_current)
00231 {
00232 TAO_TSS_Resources *tss =
00233 TAO_TSS_Resources::instance ();
00234
00235 TAO_RTScheduler_Current_i *old =
00236 static_cast<TAO_RTScheduler_Current_i *> (tss->rtscheduler_current_impl_);
00237 tss->rtscheduler_current_impl_ = new_current;
00238
00239 return old;
00240 }
00241
00242 TAO_RTScheduler_Current_i*
00243 TAO_RTScheduler_Current::implementation (void)
00244 {
00245 TAO_TSS_Resources *tss =
00246 TAO_TSS_Resources::instance ();
00247
00248 TAO_RTScheduler_Current_i* impl =
00249 static_cast<TAO_RTScheduler_Current_i *> (tss->rtscheduler_current_impl_);
00250 return impl;
00251 }
00252
00253 TAO_ORB_Core*
00254 TAO_RTScheduler_Current_i::orb (void)
00255 {
00256 return this->orb_;
00257 }
00258
00259 DT_Hash_Map*
00260 TAO_RTScheduler_Current_i::dt_hash (void)
00261 {
00262 return this->dt_hash_;
00263 }
00264
00265 RTScheduling::Scheduler_ptr
00266 TAO_RTScheduler_Current_i::scheduler (void)
00267 {
00268 return RTScheduling::Scheduler::_duplicate (this->scheduler_.in ());
00269 }
00270
00271 TAO_RTScheduler_Current_i::TAO_RTScheduler_Current_i (TAO_ORB_Core* orb,
00272 DT_Hash_Map* dt_hash)
00273 :orb_ (orb),
00274 dt_ (RTScheduling::DistributableThread::_nil ()),
00275 previous_current_ (0),
00276 dt_hash_ (dt_hash)
00277 {
00278 CORBA::Object_var scheduler_obj =
00279 this->orb_->object_ref_table ().resolve_initial_reference (
00280 "RTScheduler");
00281
00282 this->scheduler_ = RTScheduling::Scheduler::_narrow (scheduler_obj.in ());
00283 }
00284
00285 TAO_RTScheduler_Current_i::TAO_RTScheduler_Current_i (
00286 TAO_ORB_Core* orb,
00287 DT_Hash_Map* dt_hash,
00288 RTScheduling::Current::IdType guid,
00289 const char * name,
00290 CORBA::Policy_ptr sched_param,
00291 CORBA::Policy_ptr implicit_sched_param,
00292 RTScheduling::DistributableThread_ptr dt,
00293 TAO_RTScheduler_Current_i* prev_current)
00294 : orb_ (orb),
00295 guid_ (guid),
00296 name_ (CORBA::string_dup (name)),
00297 sched_param_ (CORBA::Policy::_duplicate (sched_param)),
00298 implicit_sched_param_ (CORBA::Policy::_duplicate (implicit_sched_param)),
00299 dt_ (RTScheduling::DistributableThread::_duplicate (dt)),
00300 previous_current_ (prev_current),
00301 dt_hash_ (dt_hash)
00302 {
00303 CORBA::Object_var scheduler_obj =
00304 orb->object_ref_table ().resolve_initial_reference (
00305 "RTScheduler");
00306
00307 this->scheduler_ = RTScheduling::Scheduler::_narrow (scheduler_obj.in ()
00308 );
00309 }
00310
00311 TAO_RTScheduler_Current_i::~TAO_RTScheduler_Current_i (void)
00312 {
00313 }
00314
00315 void
00316 TAO_RTScheduler_Current_i::begin_scheduling_segment(
00317 const char * name,
00318 CORBA::Policy_ptr sched_param,
00319 CORBA::Policy_ptr implicit_sched_param)
00320 {
00321
00322 if (this->guid_.length () == 0)
00323 {
00324
00325 size_t temp = ++TAO_RTScheduler_Current::guid_counter;
00326 this->guid_.length (sizeof(size_t));
00327 ACE_OS::memcpy (this->guid_.get_buffer (),
00328 &temp,
00329 sizeof(size_t));
00330
00331 size_t guid;
00332 ACE_OS::memcpy (&guid,
00333 this->guid_.get_buffer (),
00334 this->guid_.length ());
00335
00336
00337
00338 this->scheduler_->begin_new_scheduling_segment (this->guid_,
00339 name,
00340 sched_param,
00341 implicit_sched_param
00342 );
00343
00344 if (CORBA::is_nil (this->dt_.in ()))
00345
00346 this->dt_ = TAO_DistributableThread_Factory::create_DT ();
00347
00348
00349 int result = this->dt_hash_->bind (this->guid_,
00350 this->dt_);
00351
00352
00353 if (result != 0)
00354 {
00355 this->cancel_thread ();
00356 }
00357
00358
00359 this->name_ = CORBA::string_dup (name);
00360 this->sched_param_ = CORBA::Policy::_duplicate (sched_param);
00361 this->implicit_sched_param_ = CORBA::Policy::_duplicate (implicit_sched_param);
00362
00363 }
00364 else
00365 {
00366
00367 if (this->dt_->state () == RTScheduling::DistributableThread::CANCELLED)
00368 {
00369 this->cancel_thread ();
00370 }
00371
00372
00373 this->scheduler_->begin_nested_scheduling_segment
00374 (this->guid_,
00375 name,
00376 sched_param,
00377 implicit_sched_param
00378 );
00379
00380 TAO_TSS_Resources *tss =
00381 TAO_TSS_Resources::instance ();
00382
00383 TAO_RTScheduler_Current_i* new_current = 0;
00384 ACE_NEW_THROW_EX (new_current,
00385 TAO_RTScheduler_Current_i (this->orb_,
00386 this->dt_hash_,
00387 this->guid_,
00388 name,
00389 sched_param,
00390 implicit_sched_param,
00391 this->dt_.in (),
00392 this),
00393 CORBA::NO_MEMORY (
00394 CORBA::SystemException::_tao_minor_code (
00395 TAO::VMCID,
00396 ENOMEM),
00397 CORBA::COMPLETED_NO));
00398
00399 tss->rtscheduler_current_impl_ = new_current;
00400 }
00401 }
00402
00403 void
00404 TAO_RTScheduler_Current_i::update_scheduling_segment (const char * name,
00405 CORBA::Policy_ptr sched_param,
00406 CORBA::Policy_ptr implicit_sched_param
00407 )
00408 {
00409
00410 if (this->dt_->state () == RTScheduling::DistributableThread::CANCELLED)
00411 {
00412 this->cancel_thread ();
00413 }
00414
00415
00416 this->scheduler_->update_scheduling_segment (this->guid_,
00417 name,
00418 sched_param,
00419 implicit_sched_param
00420 );
00421
00422
00423 this->name_ = CORBA::string_dup (name);
00424 this->sched_param_ = CORBA::Policy::_duplicate (sched_param);
00425 this->implicit_sched_param_ = CORBA::Policy::_duplicate (implicit_sched_param);
00426 }
00427
00428 void
00429 TAO_RTScheduler_Current_i::end_scheduling_segment (const char * name)
00430 {
00431
00432 if (this->dt_->state () == RTScheduling::DistributableThread::CANCELLED)
00433 {
00434 this->cancel_thread ();
00435 }
00436
00437 if (this->previous_current_ == 0)
00438 {
00439
00440
00441 this->scheduler_->end_scheduling_segment(this->guid_,
00442 name
00443 );
00444
00445
00446 this->cleanup_DT ();
00447
00448
00449 this->cleanup_current ();
00450
00451
00452 } else {
00453
00454
00455
00456 this->scheduler_->end_nested_scheduling_segment (this->guid_,
00457 name,
00458 this->previous_current_->sched_param_.in ()
00459 );
00460
00461
00462 this->cleanup_current ();
00463 }
00464 }
00465
00466
00467
00468
00469
00470 RTScheduling::DistributableThread_ptr
00471 TAO_RTScheduler_Current_i::spawn (RTScheduling::ThreadAction_ptr start,
00472 CORBA::VoidData data,
00473 const char* name,
00474 CORBA::Policy_ptr sched_param,
00475 CORBA::Policy_ptr implicit_sched_param,
00476 CORBA::ULong stack_size,
00477 RTCORBA::Priority base_priority
00478 )
00479 {
00480
00481 if (this->dt_->state () == RTScheduling::DistributableThread::CANCELLED)
00482 {
00483 this->cancel_thread ();
00484 }
00485
00486
00487 DTTask *dttask = 0;
00488
00489
00490
00491 if (sched_param == 0)
00492 sched_param = this->implicit_sched_param_.in ();
00493
00494 RTScheduling::DistributableThread_var dt = TAO_DistributableThread_Factory::create_DT ();
00495 TAO_RTScheduler_Current_i *new_current = 0;
00496
00497 ACE_NEW_RETURN (new_current,
00498 TAO_RTScheduler_Current_i (this->orb_,
00499 this->dt_hash_),
00500 0);
00501
00502 new_current->DT (dt.in ());
00503
00504 ACE_NEW_RETURN (dttask,
00505 DTTask (
00506 this->orb_,
00507 this->dt_hash_,
00508 new_current,
00509 start,
00510 data,
00511 name,
00512 sched_param,
00513 implicit_sched_param),
00514 0);
00515
00516 if (dttask->activate_task (base_priority,
00517 stack_size) == -1)
00518 {
00519 ACE_ERROR((LM_ERROR,
00520 "Unable to activate DistributableThread\n"));
00521
00522 delete dttask;
00523 return RTScheduling::DistributableThread::_nil ();
00524 }
00525
00526 return dt._retn ();
00527 }
00528
00529 int
00530 DTTask::activate_task (RTCORBA::Priority base_priority,
00531 CORBA::ULong stack_size
00532 )
00533 {
00534
00535 long default_flags = THR_NEW_LWP | THR_JOINABLE;
00536 long flags =
00537 default_flags |
00538 this->orb_->orb_params ()->scope_policy () |
00539 this->orb_->orb_params ()->sched_policy ();
00540
00541 CORBA::Object_var object =
00542 this->orb_->object_ref_table ().resolve_initial_reference (
00543 TAO_OBJID_PRIORITYMAPPINGMANAGER);
00544
00545 RTCORBA::PriorityMappingManager_var mapping_manager =
00546 RTCORBA::PriorityMappingManager::_narrow (object.in ()
00547 );
00548
00549 RTCORBA::PriorityMapping *pm =
00550 mapping_manager->mapping ();
00551
00552 RTCORBA::NativePriority native_priority;
00553 pm->to_native (base_priority,
00554 native_priority);
00555
00556 size_t stack [1];
00557 stack [0] = stack_size;
00558 if (this->activate (flags,
00559 1,
00560 0,
00561 native_priority,
00562 -1,
00563 0,
00564 0,
00565 0,
00566 stack
00567 ) == -1)
00568 {
00569 if (ACE_OS::last_error () == EPERM)
00570 ACE_ERROR_RETURN ((LM_ERROR,
00571 ACE_TEXT ("Insufficient privilege to run this test.\n")),
00572 -1);
00573 }
00574 return 0;
00575 }
00576
00577 DTTask::DTTask (TAO_ORB_Core *orb,
00578 DT_Hash_Map *dt_hash,
00579 TAO_RTScheduler_Current_i* new_current,
00580 RTScheduling::ThreadAction_ptr start,
00581 CORBA::VoidData data,
00582 const char *name,
00583 CORBA::Policy_ptr sched_param,
00584 CORBA::Policy_ptr implicit_sched_param)
00585 :orb_ (orb),
00586 dt_hash_ (dt_hash),
00587 current_ (new_current),
00588 start_ (RTScheduling::ThreadAction::_duplicate (start)),
00589 data_ (data),
00590 name_ (CORBA::string_dup (name)),
00591 sched_param_ (CORBA::Policy::_duplicate (sched_param)),
00592 implicit_sched_param_ (CORBA::Policy::_duplicate (implicit_sched_param))
00593 {
00594 }
00595
00596 DTTask::~DTTask (void)
00597 {
00598 delete this->current_;
00599 }
00600
00601 int
00602 DTTask::svc (void)
00603 {
00604 try
00605 {
00606
00607 TAO_TSS_Resources *tss =
00608 TAO_TSS_Resources::instance ();
00609
00610 tss->rtscheduler_current_impl_ = this->current_;
00611
00612 this->current_->begin_scheduling_segment (this->name_.in (),
00613 this->sched_param_.in (),
00614 this->implicit_sched_param_.in ()
00615 );
00616
00617
00618 this->start_->_cxx_do (this->data_
00619 );
00620
00621 this->current_->end_scheduling_segment (this->name_.in ()
00622 );
00623 }
00624 catch (const ::CORBA::Exception& ex)
00625 {
00626 ex._tao_print_exception ("Caught exception:");
00627 return -1;
00628 }
00629
00630 return 0;
00631 }
00632
00633 RTScheduling::Current::IdType *
00634 TAO_RTScheduler_Current_i::id (void)
00635 {
00636
00637 RTScheduling::Current::IdType_var guid = this->guid_;
00638 return guid._retn ();
00639 }
00640
00641
00642 CORBA::Policy_ptr
00643 TAO_RTScheduler_Current_i::scheduling_parameter (void)
00644 {
00645 return CORBA::Policy::_duplicate (this->sched_param_.in ());
00646 }
00647
00648 CORBA::Policy_ptr
00649 TAO_RTScheduler_Current_i::implicit_scheduling_parameter (void)
00650 {
00651 return CORBA::Policy::_duplicate (this->implicit_sched_param_.in ());
00652 }
00653
00654 RTScheduling::Current::NameList *
00655 TAO_RTScheduler_Current_i::current_scheduling_segment_names (void)
00656 {
00657 RTScheduling::Current::NameList* name_list;
00658 ACE_NEW_RETURN (name_list,
00659 RTScheduling::Current::NameList,
00660 0);
00661
00662 TAO_RTScheduler_Current_i* current = this;
00663
00664 for (int index = 0; current != 0; index++)
00665 {
00666 name_list->length (index+1);
00667 (*name_list) [index] = current->name ();
00668 current = current->previous_current_;
00669 }
00670
00671 return name_list;
00672 }
00673
00674 const char*
00675 TAO_RTScheduler_Current_i::name (void)
00676 {
00677 return this->name_.in ();
00678 }
00679
00680 #if defined (THREAD_CANCELLED)
00681 #undef THREAD_CANCELLED
00682 #endif
00683
00684 void
00685 TAO_RTScheduler_Current_i::cancel_thread (void)
00686 {
00687 size_t guid;
00688 ACE_OS::memcpy (&guid,
00689 this->guid_.get_buffer (),
00690 this->guid_.length ());
00691
00692 ACE_DEBUG ((LM_DEBUG,
00693 "Distributable Thread - %d is cancelled\n",
00694 guid));
00695
00696
00697
00698 this->scheduler_->cancel (this->guid_
00699 );
00700
00701 this->cleanup_DT ();
00702
00703
00704 this->delete_all_currents ();
00705
00706
00707 throw ::CORBA::THREAD_CANCELLED ();
00708 }
00709
00710 void
00711 TAO_RTScheduler_Current_i::cleanup_DT (void)
00712 {
00713
00714 this->dt_hash_->unbind (this->guid_);
00715 }
00716
00717 void
00718 TAO_RTScheduler_Current_i::cleanup_current (void)
00719 {
00720 TAO_TSS_Resources *tss =
00721 TAO_TSS_Resources::instance ();
00722
00723 tss->rtscheduler_current_impl_ = this->previous_current_;
00724
00725
00726 delete this;
00727 }
00728
00729 void
00730 TAO_RTScheduler_Current_i::delete_all_currents (void)
00731 {
00732 TAO_RTScheduler_Current_i* current = this;
00733
00734 while (current != 0)
00735 {
00736 TAO_RTScheduler_Current_i* prev_current = current->previous_current_;
00737 current->cleanup_current ();
00738 current = prev_current;
00739 }
00740
00741 TAO_TSS_Resources *tss =
00742 TAO_TSS_Resources::instance ();
00743
00744 tss->rtscheduler_current_impl_ = tss->rtscheduler_previous_current_impl_;
00745 }
00746
00747 void
00748 TAO_RTScheduler_Current_i::id (RTScheduling::Current::IdType guid)
00749 {
00750 this->guid_ = guid;
00751 }
00752
00753 void
00754 TAO_RTScheduler_Current_i::name (const char * name)
00755 {
00756 this->name_ = CORBA::string_dup (name);
00757 }
00758
00759 RTScheduling::DistributableThread_ptr
00760 TAO_RTScheduler_Current_i::DT (void)
00761 {
00762 return this->dt_._retn ();
00763 }
00764
00765 void
00766 TAO_RTScheduler_Current_i::DT (RTScheduling::DistributableThread_ptr dt)
00767 {
00768 this->dt_ = RTScheduling::DistributableThread::_duplicate (dt);
00769 }
00770
00771 void
00772 TAO_RTScheduler_Current_i::scheduling_parameter (CORBA::Policy_ptr sched_param)
00773 {
00774 this->sched_param_ = CORBA::Policy::_duplicate (sched_param);
00775 }
00776
00777 void
00778 TAO_RTScheduler_Current_i::implicit_scheduling_parameter (CORBA::Policy_ptr implicit_sched_param)
00779 {
00780 this->implicit_sched_param_ = CORBA::Policy::_duplicate (implicit_sched_param);
00781 }
00782
00783
00784
00785
00786
00787
00788
00789
00790 TAO_RTScheduler_Current_var::TAO_RTScheduler_Current_var (void)
00791 : ptr_ (TAO_RTScheduler_Current::_nil ())
00792 {}
00793
00794 ::TAO_RTScheduler_Current_ptr
00795 TAO_RTScheduler_Current_var::ptr (void) const
00796 {
00797 return this->ptr_;
00798 }
00799
00800 TAO_RTScheduler_Current_var::TAO_RTScheduler_Current_var (const ::TAO_RTScheduler_Current_var &p)
00801 : TAO_Base_var (),
00802 ptr_ (TAO_RTScheduler_Current::_duplicate (p.ptr ()))
00803 {}
00804
00805 TAO_RTScheduler_Current_var::~TAO_RTScheduler_Current_var (void)
00806 {
00807 ::CORBA::release (this->ptr_);
00808 }
00809
00810 TAO_RTScheduler_Current_var &
00811 TAO_RTScheduler_Current_var::operator= (TAO_RTScheduler_Current_ptr p)
00812 {
00813 ::CORBA::release (this->ptr_);
00814 this->ptr_ = p;
00815 return *this;
00816 }
00817
00818 TAO_RTScheduler_Current_var &
00819 TAO_RTScheduler_Current_var::operator= (const ::TAO_RTScheduler_Current_var &p)
00820 {
00821 if (this != &p)
00822 {
00823 ::CORBA::release (this->ptr_);
00824 this->ptr_ = ::TAO_RTScheduler_Current::_duplicate (p.ptr ());
00825 }
00826 return *this;
00827 }
00828
00829 TAO_RTScheduler_Current_var::operator const ::TAO_RTScheduler_Current_ptr &() const
00830 {
00831 return this->ptr_;
00832 }
00833
00834 TAO_RTScheduler_Current_var::operator ::TAO_RTScheduler_Current_ptr &()
00835 {
00836 return this->ptr_;
00837 }
00838
00839 TAO_RTScheduler_Current_ptr
00840 TAO_RTScheduler_Current_var::operator-> (void) const
00841 {
00842 return this->ptr_;
00843 }
00844
00845 TAO_RTScheduler_Current_ptr
00846 TAO_RTScheduler_Current_var::in (void) const
00847 {
00848 return this->ptr_;
00849 }
00850
00851 TAO_RTScheduler_Current_ptr &
00852 TAO_RTScheduler_Current_var::inout (void)
00853 {
00854 return this->ptr_;
00855 }
00856
00857 TAO_RTScheduler_Current_ptr &
00858 TAO_RTScheduler_Current_var::out (void)
00859 {
00860 ::CORBA::release (this->ptr_);
00861 this->ptr_ = ::TAO_RTScheduler_Current::_nil ();
00862 return this->ptr_;
00863 }
00864
00865 TAO_RTScheduler_Current_ptr
00866 TAO_RTScheduler_Current_var::_retn (void)
00867 {
00868
00869 ::TAO_RTScheduler_Current_ptr val = this->ptr_;
00870 this->ptr_ = ::TAO_RTScheduler_Current::_nil ();
00871 return val;
00872 }
00873
00874 TAO_RTScheduler_Current_ptr
00875 TAO_RTScheduler_Current_var::duplicate (TAO_RTScheduler_Current_ptr p)
00876 {
00877 return ::TAO_RTScheduler_Current::_duplicate (p);
00878 }
00879
00880 void
00881 TAO_RTScheduler_Current_var::release (TAO_RTScheduler_Current_ptr p)
00882 {
00883 ::CORBA::release (p);
00884 }
00885
00886 TAO_RTScheduler_Current_ptr
00887 TAO_RTScheduler_Current_var::nil (void)
00888 {
00889 return ::TAO_RTScheduler_Current::_nil ();
00890 }
00891
00892 TAO_RTScheduler_Current_ptr
00893 TAO_RTScheduler_Current_var::narrow (
00894 CORBA::Object *p
00895
00896 )
00897 {
00898 return ::TAO_RTScheduler_Current::_narrow (p);
00899 }
00900
00901 CORBA::Object *
00902 TAO_RTScheduler_Current_var::upcast (void *src)
00903 {
00904 TAO_RTScheduler_Current **tmp =
00905 static_cast<TAO_RTScheduler_Current **> (src);
00906 return *tmp;
00907 }
00908
00909 TAO_RTScheduler_Current_ptr TAO_RTScheduler_Current::_narrow (
00910 CORBA::Object_ptr obj
00911
00912 )
00913 {
00914 return
00915 TAO_RTScheduler_Current::_duplicate (
00916 dynamic_cast<TAO_RTScheduler_Current *> (obj)
00917 );
00918 }
00919
00920 TAO_RTScheduler_Current_ptr
00921 TAO_RTScheduler_Current::_duplicate (TAO_RTScheduler_Current_ptr obj)
00922 {
00923 if (!CORBA::is_nil (obj))
00924 obj->_add_ref ();
00925 return obj;
00926 }
00927
00928 const char* TAO_RTScheduler_Current::_interface_repository_id (void) const
00929 {
00930 return "IDL:TAO_RTScheduler_Current:1.0";
00931 }
00932
00933 TAO_END_VERSIONED_NAMESPACE_DECL