summaryrefslogtreecommitdiff
path: root/TAO/docs/tutorials/Quoter/RTCORBA/Stock_PriorityMapping.h
blob: 4326b43401f2b696da90be0d0263d242c6ffec5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// $Id$

/**
 * @file Stock_PriorityMapping.h
 * @author Shanshan Jiang <shanshan.jiang@vanderbilt.edu>
 * @author William R. Otte <wotte@dre.vanderbilt.edu>
 * @author Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
 */

#ifndef STOCK_PRIORITYMAPPING_
#define STOCK_PRIORITYMAPPING_

#include "Common_Export.h"

// TAO headers
#include "tao/RTCORBA/Linear_Priority_Mapping.h"

namespace Stock
{
  /**
   * @class Stock_PriorityMapping
   * @brief Defines the runtime priority mappings used in this application.
   *
   * This class defines the priority mappings used by the stock objects. We
   * are using the TAO_Continuous_Priority_Mapping class as a base class
   * because it provides the necessary mappings of CORBA::Priority values
   * to CORBA::NativePriority values when there is only a limited number
   * of CORBA::Priority values.
   */
  class RTCORBA_Quoter_Common_Export Priority_Mapping :
    public TAO_Linear_Priority_Mapping
  {
  public:
    /// Default constructor.
    Priority_Mapping (void);

    /// Default destructor.
    virtual ~Priority_Mapping (void);

    /// Stock priorities.
    enum Priority
      {
        VERY_LOW = 0,
        LOW = 1,
        MEDIUM = 2,
        HIGH = 3,
        VERY_HIGH = 4
      };

    /// Register mapping.
    static void register_mapping (CORBA::ORB_ptr orb);
  };
 
}

#endif  // !defined STOCK_PRIORITYMAPPING_