More tests update
[ACE_TAO.git] / TAO / examples / Advanced / ch_12 / CCS.idl
blob4722dadc125e77fc7abe63d156d5411f953eec17
2 //=============================================================================
3 /**
4 * @file CCS.idl
6 * @author Source code used in TAO has been modified and adapted from thecode provided in the book
7 * @author "Advanced CORBA Programming with C++"by Michi Henning and Steve Vinoski. Copyright1999. Addison-Wesley
8 * @author Reading
9 * @author MA. Used with permission ofAddison-Wesley.Modified for TAO by Mike Moran <mm4@cs.wustl.edu>
11 //=============================================================================
14 #pragma prefix "acme.com"
16 module CCS
18 typedef unsigned long AssetType;
19 typedef string ModelType;
20 typedef short TempType;
21 typedef string LocType;
23 interface Thermometer
25 readonly attribute ModelType model;
26 readonly attribute AssetType asset_num;
27 readonly attribute TempType temperature;
28 attribute LocType location;
30 void remove ();
33 interface Thermostat : Thermometer
35 struct BtData
37 TempType requested;
38 TempType min_permitted;
39 TempType max_permitted;
40 string error_msg;
42 exception BadTemp { BtData details; };
44 TempType get_nominal ();
45 TempType set_nominal (in TempType new_temp)
46 raises (BadTemp);
49 interface Controller
51 exception DuplicateAsset {};
53 Thermometer create_thermometer (in AssetType anum,
54 in LocType loc)
55 raises (DuplicateAsset);
57 Thermostat create_thermostat (in AssetType anum,
58 in LocType loc,
59 in TempType temp)
60 raises (DuplicateAsset, Thermostat::BadTemp);
62 typedef sequence<Thermometer> ThermometerSeq;
63 typedef sequence<Thermostat> ThermostatSeq;
65 enum SearchCriterion { ASSET, LOCATION, MODEL };
67 union KeyType switch (SearchCriterion)
69 case ASSET:
70 AssetType asset_num;
71 case LOCATION:
72 LocType loc;
73 case MODEL:
74 ModelType model_desc;
77 struct SearchType
79 KeyType key;
80 Thermometer device;
83 typedef sequence<SearchType> SearchSeq;
85 struct ErrorDetails
87 Thermostat tmstat_ref;
88 Thermostat::BtData info;
90 typedef sequence<ErrorDetails> ErrSeq;
92 exception EChange
94 ErrSeq errors;
97 ThermometerSeq list ();
98 void find (inout SearchSeq slist);
99 void change (in ThermostatSeq tlist, in short delta)
100 raises (EChange);