Continuous_Priority_Mapping.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Continuous_Priority_Mapping.h
00006  *
00007  *  $Id: Continuous_Priority_Mapping.h 71473 2006-03-10 07:19:20Z jtc $
00008  *
00009  *  @author Irfan Pyarali
00010  */
00011 // ===================================================================
00012 
00013 #ifndef TAO_CONTINUOUS_PRIORITY_MAPPING_H
00014 #define TAO_CONTINUOUS_PRIORITY_MAPPING_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "tao/orbconf.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
00025 
00026 #include "tao/RTCORBA/rtcorba_export.h"
00027 #include "tao/RTCORBA/Priority_Mapping.h"
00028 
00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00030 
00031 /**
00032  * @class TAO_Continuous_Priority_Mapping
00033  *
00034  * @brief Maps the first n CORBA priorities to the range of native
00035  * priorities, where n is the number of native priorities.
00036  *
00037  * The lowest native priority is mapped to CORBA priority 0, next
00038  * higher native priority is mapped to CORBA priority 1, and so
00039  * on. Since in all the operating systems where TAO is supported the
00040  * native priority set contains less than 32767 priorities, part of
00041  * the CORBA priority range is left unused.  Consider NT as an
00042  * example. NT native priorities -15 -2 -1 0 1 2 15 are mapped to
00043  * CORBA priorities 0 1 2 3 4 5 6, respectively, and the rest of the
00044  * CORBA priority range is not used.
00045  *
00046  * This class was previously called Direct_Priority_Mapping.
00047  *
00048  * \nosubgrouping
00049  **/
00050 class TAO_RTCORBA_Export TAO_Continuous_Priority_Mapping
00051   : public TAO_Priority_Mapping
00052 {
00053 public:
00054 
00055   /// Constructor.
00056   TAO_Continuous_Priority_Mapping (int policy = ACE_SCHED_OTHER);
00057 
00058   /// Destructor.
00059   ~TAO_Continuous_Priority_Mapping (void);
00060 
00061   /// Convert CORBA priority to native priority.
00062   CORBA::Boolean to_native (RTCORBA::Priority corba_priority,
00063                             RTCORBA::NativePriority &native_priority);
00064 
00065   /// Convert native priority to CORBA priority.
00066   CORBA::Boolean to_CORBA (RTCORBA::NativePriority native_priority,
00067                            RTCORBA::Priority &corba_priority);
00068 
00069 private:
00070   int policy_;
00071   int min_;
00072   int max_;
00073 };
00074 
00075 TAO_END_VERSIONED_NAMESPACE_DECL
00076 
00077 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
00078 
00079 #include /**/ "ace/post.h"
00080 
00081 #endif /* TAO_CONTINUOUS_PRIORITY_MAPPING_H */

Generated on Tue Feb 2 17:42:49 2010 for TAO_RTCORBA by  doxygen 1.4.7