Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / examples / Advanced / ch_21 / CCS.idl
blob8ab1c077cd6319faab6f2bb5479f7f95a4fa1e72
1 //=============================================================================
2 /**
3 * @file CCS.idl
5 * @author Source code used in TAO has been modified and adapted from the codeprovided in the book
6 * @author "Advanced CORBA Programming with C++" by MichiHenning and Steve Vinoski. Copyright 1999. Addison-Wesley
7 * @author Reading
8 * @author MA.Modified for TAO by Mike Moran <mm4@cs.wustl.edu>
9 */
10 //=============================================================================
16 #pragma prefix "acme.com"
18 module CCS {
19 typedef unsigned long AssetType;
20 typedef string ModelType;
21 typedef short TempType;
22 typedef string LocType;
24 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 {
34 struct BtData {
35 TempType requested;
36 TempType min_permitted;
37 TempType max_permitted;
38 string error_msg;
40 exception BadTemp { BtData details; };
42 TempType get_nominal();
43 TempType set_nominal(in TempType new_temp)
44 raises(BadTemp);
47 interface Controller {
48 exception DuplicateAsset {};
50 Thermometer create_thermometer(
51 in AssetType anum,
52 in LocType loc
53 ) raises(DuplicateAsset);
54 Thermostat create_thermostat(
55 in AssetType anum,
56 in LocType loc,
57 in TempType temp
58 ) raises(DuplicateAsset, Thermostat::BadTemp);
60 typedef sequence<Thermometer> ThermometerSeq;
61 typedef sequence<Thermostat> ThermostatSeq;
63 enum SearchCriterion { ASSET, LOCATION, MODEL };
65 union KeyType switch(SearchCriterion) {
66 case ASSET:
67 AssetType asset_num;
68 case LOCATION:
69 LocType loc;
70 case MODEL:
71 ModelType model_desc;
74 struct SearchType {
75 KeyType key;
76 Thermometer device;
78 typedef sequence<SearchType> SearchSeq;
80 struct ErrorDetails {
81 Thermostat tmstat_ref;
82 Thermostat::BtData info;
84 typedef sequence<ErrorDetails> ErrSeq;
86 exception EChange {
87 ErrSeq errors;
90 ThermometerSeq list();
91 void find(inout SearchSeq slist);
92 void change(
93 in ThermostatSeq tlist, in short delta
94 ) raises(EChange);