4 //=============================================================================
6 * @file Multi_Priority_Mapping.h
8 * Declares a priority mapping to support cross platform communication.
10 * @author Brian Mendel (brian.r.mendel@boeing.com)
12 //=============================================================================
15 #ifndef TAO_MULTI_PRIORITY_MAPPING_H
16 #define TAO_MULTI_PRIORITY_MAPPING_H
18 #include "tao/orbconf.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
26 #include "tao/RTCORBA/Priority_Mapping.h"
28 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
31 * @class TAO_Multi_Priority_Mapping
33 * @brief An implementation of the Priority_Mapping interface for communication
34 * between different platforms
36 * This implementation uses a custom mapping between the range of
37 * priorities for a given scheduling class (ACE_SCHED_OTHER,
38 * ACE_SCHED_FIFO, ACE_SCHED_RR) and the valid range of CORBA
39 * priorities (0...32767)
41 class TAO_RTCORBA_Export TAO_Multi_Priority_Mapping
42 : public TAO_Priority_Mapping
45 /// Default constructor
47 * @param base_native_priority The native priority to use for the highest
49 * @param base_corba_priority The corba priority to use for the highest
51 * @param priority_spacing The priority increment to use between endpoints
52 * @param priorities_contiguous Some platforms do use contiguous priorities
53 * @param policy The scheduling policy to use.
55 TAO_Multi_Priority_Mapping (int base_native_priority
,
56 int base_corba_priority
,
57 int priority_spacing
= 1,
58 int priorities_contiguous
= 1,
59 int policy
= ACE_SCHED_FIFO
);
62 virtual ~TAO_Multi_Priority_Mapping ();
64 virtual CORBA::Boolean
65 to_native (RTCORBA::Priority corba_priority
,
66 RTCORBA::NativePriority
&native_priority
);
67 virtual CORBA::Boolean
68 to_CORBA (RTCORBA::NativePriority native_priority
,
69 RTCORBA::Priority
&corba_priority
);
73 int base_native_priority_
;
74 int base_corba_priority_
;
76 const int priority_spacing_
;
77 const int priorities_contiguous_
;
79 /// The scheduling policy
87 TAO_END_VERSIONED_NAMESPACE_DECL
89 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
91 #endif /* TAO_MULTI_PRIORITY_MAPPING_H */