Public Member Functions | Protected Member Functions | Private Attributes

TAO_RT_Current Class Reference

RTCORBA::Current interface iplementation. More...

#include <RT_Current.h>

Inheritance diagram for TAO_RT_Current:
Inheritance graph
[legend]
Collaboration diagram for TAO_RT_Current:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_RT_Current (TAO_ORB_Core *orb_core)
 Default constructor.
virtual RTCORBA::Priority the_priority (void)
virtual void the_priority (RTCORBA::Priority the_priority)

Protected Member Functions

virtual ~TAO_RT_Current (void)

Private Attributes

TAO_ORB_Core *const orb_core_
 ORB Core that owns us.

Detailed Description

RTCORBA::Current interface iplementation.

Allows setting/getting the priority of the current thread.

Definition at line 43 of file RT_Current.h.


Constructor & Destructor Documentation

TAO_RT_Current::TAO_RT_Current ( TAO_ORB_Core orb_core  ) 

Default constructor.

Definition at line 24 of file RT_Current.cpp.

  : orb_core_ (orb_core)
{
}

TAO_RT_Current::~TAO_RT_Current ( void   )  [protected, virtual]

Protected destructor to enforce proper memory management of this reference counted object.

Definition at line 29 of file RT_Current.cpp.

{
}


Member Function Documentation

RTCORBA::Priority TAO_RT_Current::the_priority ( void   )  [virtual]

Definition at line 34 of file RT_Current.cpp.

{
  TAO_Protocols_Hooks *tph = this->orb_core_->get_protocols_hooks ();

  RTCORBA::Priority priority = 0;

  int result =
      tph->get_thread_CORBA_priority (priority);

  if (result == -1)
    {
      if (TAO_debug_level > 0)
        ACE_DEBUG ((LM_DEBUG, "ERROR: TAO_RT_Current::the_priority. "
                    "RT CORBA Priority accessed in a thread where it has not been set.\n"));
      // Spec does not define a minor code
      throw CORBA::INITIALIZE ();
    }

  return priority;
}

void TAO_RT_Current::the_priority ( RTCORBA::Priority  the_priority  )  [virtual]

Definition at line 56 of file RT_Current.cpp.

{

  TAO_Protocols_Hooks *tph = this->orb_core_->get_protocols_hooks ();

  if (tph->set_thread_CORBA_priority (the_priority) == -1)
    {
      // Note this check is required by "2.6 Real-time Current" which states:
      // "A BAD_PARAM system exception shall be thrown if an attempt is made to set the
      // priority to a value outside the range 0 to 32767."
      // Note that it is not enough to assume that the mapping's rejection will deal with
      // this as it also says: "If the to_native call returns FALSE ... then a Real-time ORB
      // shall raise a DATA_CONVERSION system exception" i.e different exception.

      if (the_priority < 0) // short
        throw CORBA::BAD_PARAM (
                  CORBA::SystemException::_tao_minor_code (
                  0,
                  EINVAL),
                  CORBA::COMPLETED_NO);

      throw CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
    }
}


Member Data Documentation

ORB Core that owns us.

Reimplemented from CORBA::Object.

Definition at line 65 of file RT_Current.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines