diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-30 20:51:16 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-30 20:51:16 +0000 |
commit | 44201fbd210a380f97b9d9faa2688a0a4632a445 (patch) | |
tree | 3a2e955790abe4cac5291c72827ebcde8150e805 /TAO/tao/RT_Current.cpp | |
parent | 80dfbff0a8be9a69b768c30fc7fceb1495454eea (diff) | |
download | ATCD-44201fbd210a380f97b9d9faa2688a0a4632a445.tar.gz |
ChangeLogTag:Mon Aug 30 15:15:39 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/RT_Current.cpp')
-rw-r--r-- | TAO/tao/RT_Current.cpp | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/TAO/tao/RT_Current.cpp b/TAO/tao/RT_Current.cpp new file mode 100644 index 00000000000..9917e641a36 --- /dev/null +++ b/TAO/tao/RT_Current.cpp @@ -0,0 +1,102 @@ +// +// $Id$ +// + +#include "tao/RT_Current.h" + +#if defined (TAO_HAS_RT_CORBA) + +#include "tao/Stub.h" +#include "tao/ORB_Core.h" +#include "tao/Priority_Mapping.h" + +#include "ace/Thread.h" + +#if !defined (__ACE_INLINE__) +#include "tao/RT_Current.i" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, RT_Current, "$Id$") + +TAO_RT_Current_ptr +TAO_RT_Current::_duplicate (TAO_RT_Current_ptr obj) +{ + if (!CORBA::is_nil (obj)) + obj->_incr_refcnt (); + + return obj; +} + +TAO_RT_Current_ptr TAO_RT_Current::_narrow ( + CORBA::Object_ptr obj, + CORBA::Environment &ACE_TRY_ENV + ) +{ + if (CORBA::is_nil (obj)) + return TAO_RT_Current::_nil (); + CORBA::Boolean check = + !obj->_is_a ("IDL:omg.org/RTCORBA/Current:1.0", ACE_TRY_ENV); + ACE_CHECK_RETURN (TAO_RT_Current::_nil ()); + if (check) + return TAO_RT_Current::_nil (); + + TAO_Stub *stub = obj->_stubobj (); + stub->_incr_refcnt (); + + TAO_RT_Current *current; + ACE_NEW_RETURN (current, + TAO_RT_Current (stub), + 0); + + return current; +} + +CORBA::Boolean TAO_RT_Current::_is_a (const char *value, + CORBA::Environment &) +{ + if ( + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/RTCORBA/Current:1.0")) || + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Current:1.0")) || + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0"))) + return 1; + return 0; +} + +const char* TAO_RT_Current::_interface_repository_id (void) const +{ + return "IDL:omg.org/RTCORBA/Current:1.0"; +} + +RTCORBA::Priority +TAO_RT_Current::the_priority ( + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC (( + CORBA::SystemException + )) +{ + TAO_ORB_Core *orb_core = + this->_stubobj ()->orb_core (); + + RTCORBA::Priority priority; + if (orb_core->get_thread_priority (priority) == -1) + ACE_THROW_RETURN (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO), -1); + + return 0; +} + +void +TAO_RT_Current::the_priority ( + RTCORBA::Priority the_priority, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC (( + CORBA::SystemException + )) +{ + TAO_ORB_Core *orb_core = + this->_stubobj ()->orb_core (); + + if (orb_core->set_thread_priority (the_priority) == -1) + ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); +} + +#endif /* TAO_HAS_RT_CORBA */ |