00001 // -*- C++ -*- 00002 00003 00004 //============================================================================= 00005 /** 00006 * @file Linear_Priority_Mapping.h 00007 * 00008 * $Id: Linear_Priority_Mapping.h 79339 2007-08-14 17:49:17Z sowayaa $ 00009 * 00010 * Declares the Linear_Priority_Mapping interface, as defined in the 00011 * RT-CORBA spec. 00012 * 00013 * 00014 * @author Carlos O'Ryan (coryan@cs.wustl.edu) 00015 */ 00016 //============================================================================= 00017 00018 00019 #ifndef TAO_LINEAR_PRIORITY_MAPPING_H 00020 #define TAO_LINEAR_PRIORITY_MAPPING_H 00021 #include /**/ "ace/pre.h" 00022 00023 #include "tao/orbconf.h" 00024 00025 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00026 # pragma once 00027 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00028 00029 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 00030 00031 #include "tao/RTCORBA/rtcorba_export.h" 00032 #include "tao/RTCORBA/Priority_Mapping.h" 00033 00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00035 00036 /** 00037 * @class TAO_Linear_Priority_Mapping 00038 * 00039 * @brief A simple implementation of the Priority_Mapping interface. 00040 * 00041 * This implementation uses linear mapping between the range of 00042 * priorities for a given scheduling class (ACE_SCHED_OTHER, 00043 * ACE_SCHED_FIFO, ACE_SCHED_RR) and the valid range of CORBA 00044 * priorities (0...32767) 00045 */ 00046 class TAO_RTCORBA_Export TAO_Linear_Priority_Mapping : public TAO_Priority_Mapping 00047 { 00048 public: 00049 /// Default constructor 00050 TAO_Linear_Priority_Mapping (long policy); 00051 00052 /// The destructor 00053 virtual ~TAO_Linear_Priority_Mapping (void); 00054 00055 virtual CORBA::Boolean to_native (RTCORBA::Priority corba_priority, 00056 RTCORBA::NativePriority &native_priority); 00057 virtual CORBA::Boolean to_CORBA (RTCORBA::NativePriority native_priority, 00058 RTCORBA::Priority &corba_priority); 00059 00060 private: 00061 /// The scheduling policy 00062 long policy_; 00063 00064 // The range 00065 int const min_; 00066 int const max_; 00067 }; 00068 00069 TAO_END_VERSIONED_NAMESPACE_DECL 00070 00071 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */ 00072 00073 #include /**/ "ace/post.h" 00074 #endif /* TAO_LINEAR_PRIORITY_MAPPING_H */