blob: e0412905b564b87f1aa9dc9b0451befacc70798b (
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
57
|
<!-- $Id$ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Stock Priority Mapping definition for the Stock Quoter Publisher/Subscriber Real-time CORBA Service</title>
</head>
<body
text = "#000000"
link = "#000fff"
vLink= "#ff0f0f"
aLink = "#0000ff"
bgColor = "#ffffff">
<hr><h2>Stock Priority Mapping definition for the Stock Quoter Publisher/Subscriber Real-time CORBA Service</h2><hr>
<P> The Stock Database class defines the priority mappings used by the stock objects.<P>
<h3>Defining the Priority enum</h3>
We define five levels of prioriies as follows: <P>
<PRE>
enum Priority
{
VERY_LOW = 0,
LOW = 1,
MEDIUM = 2,
HIGH = 3,
VERY_HIGH = 4
};
</PRE>
<hr><h3>Implementing the register_mapping () function</h3>
The main steps of this function are described as follows: <P>
<li>Get the Priority Mapping Manager.</li> <P>
<PRE>
CORBA::Object_var obj = orb->resolve_initial_references ("PriorityMappingManager");
TAO_Priority_Mapping_Manager_var manager = TAO_Priority_Mapping_Manager::_narrow (obj.in ());
</PRE>
<li>Create an instance of Stock Priority Mapping object and install it.</li> <P>
<PRE>
RTCORBA::PriorityMapping *my_mapping = new Stock::Priority_Mapping;
manager->mapping (my_mapping);
</PRE>
<hr><b>Email: </b><a href="mailto:"</a<ADDRESS>shanshan.jiang@vanderbilt.edu</ADDRESS>
</body>
</html>
|