Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / RTCORBA / Continuous_Priority_Mapping.h
blob1e4e0ae1ece1defc0e60a4fd202da1283bedf973
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Continuous_Priority_Mapping.h
7 * @author Irfan Pyarali
8 */
9 // ===================================================================
11 #ifndef TAO_CONTINUOUS_PRIORITY_MAPPING_H
12 #define TAO_CONTINUOUS_PRIORITY_MAPPING_H
14 #include /**/ "ace/pre.h"
16 #include "tao/orbconf.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
24 #include "tao/RTCORBA/rtcorba_export.h"
25 #include "tao/RTCORBA/Priority_Mapping.h"
27 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
29 /**
30 * @class TAO_Continuous_Priority_Mapping
32 * @brief Maps the first n CORBA priorities to the range of native
33 * priorities, where n is the number of native priorities.
35 * The lowest native priority is mapped to CORBA priority 0, next
36 * higher native priority is mapped to CORBA priority 1, and so
37 * on. Since in all the operating systems where TAO is supported the
38 * native priority set contains less than 32767 priorities, part of
39 * the CORBA priority range is left unused. Consider NT as an
40 * example. NT native priorities -15 -2 -1 0 1 2 15 are mapped to
41 * CORBA priorities 0 1 2 3 4 5 6, respectively, and the rest of the
42 * CORBA priority range is not used.
44 * This class was previously called Direct_Priority_Mapping.
46 * \nosubgrouping
47 **/
48 class TAO_RTCORBA_Export TAO_Continuous_Priority_Mapping
49 : public TAO_Priority_Mapping
51 public:
52 /// Constructor.
53 TAO_Continuous_Priority_Mapping (int policy = ACE_SCHED_OTHER);
55 /// Destructor.
56 ~TAO_Continuous_Priority_Mapping ();
58 /// Convert CORBA priority to native priority.
59 CORBA::Boolean to_native (RTCORBA::Priority corba_priority,
60 RTCORBA::NativePriority &native_priority);
62 /// Convert native priority to CORBA priority.
63 CORBA::Boolean to_CORBA (RTCORBA::NativePriority native_priority,
64 RTCORBA::Priority &corba_priority);
66 private:
67 int policy_;
68 int min_;
69 int max_;
72 TAO_END_VERSIONED_NAMESPACE_DECL
74 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
76 #include /**/ "ace/post.h"
78 #endif /* TAO_CONTINUOUS_PRIORITY_MAPPING_H */