OpenDDS  Snapshot(2023/04/28-20:55)
PriorityMapper.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_TRANSPORT_FRAMEWORK_PRIORITYMAPPER_H
9 #define OPENDDS_DCPS_TRANSPORT_FRAMEWORK_PRIORITYMAPPER_H
10 
11 #include "dds/DCPS/dcps_export.h"
12 
13 #include "TransportDefs.h"
14 
16 
17 namespace OpenDDS {
18 namespace DCPS {
19 
20 /**
21  * @class PriorityMapper
22  *
23  * @brief Encapsulate a TRANSPORT_PRIORITY value.
24  *
25  * This interface allows a TRANSPORT_PRIORIY value to be mapped to
26  * values to use as DiffServ codepoint and thread priority values.
27  * Specific implementations of this interface can define specific
28  * mapping algorithms for conversion from the basic
29  * TRANSPORT_PRIORITY value to the values to use for network and
30  * thread prirorities.
31  *
32  * We take our cue from the RTCORBA code base in defining the types
33  * of the priority values mapped to. RTCORBA defines both the
34  * network and thread priority values as shorts. Since this is well
35  * within the expected range of priority values to be mapped to and
36  * the short value can be expanded into larger types without
37  * complaint, this priority type should be without problem here.
38  */
40 public:
41  /// Construct with a priority value.
42  PriorityMapper(Priority priority = 0);
43 
44  virtual ~PriorityMapper();
45 
46  /// Accessors for the TRANSPORT_PRIORITY value.
47  Priority& priority();
48  Priority priority() const;
49 
50  /// Access the mapped DiffServ codepoint value.
51  virtual short codepoint() const = 0;
52 
53  /// Access the mapped thread priority value.
54  virtual short thread_priority() const = 0;
55 
56 private:
57  /// The TRANSPORT_PRIORITY value.
59 };
60 
61 } // namespace DCPS
62 } // namespace OpenDDS
63 
65 
66 #if defined (__ACE_INLINE__)
67 #include "PriorityMapper.inl"
68 #endif /* __ACE_INLINE__ */
69 
70 #endif /* PRIORITY_MAPPER_H */
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
ACE_CDR::Long Priority
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
Priority priority_
The TRANSPORT_PRIORITY value.
Encapsulate a TRANSPORT_PRIORITY value.
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28