| Rev | Line |  | 
|---|
| [534] | 1 | // toi.h | 
|---|
|  | 2 | // Eric Aubourg         CEA/DAPNIA/SPP   septembre 1999 | 
|---|
|  | 3 |  | 
|---|
|  | 4 | #ifndef TOI_H | 
|---|
|  | 5 | #define TOI_H | 
|---|
|  | 6 |  | 
|---|
|  | 7 | #include<string> | 
|---|
|  | 8 | #include<set> | 
|---|
|  | 9 | #include<vector> | 
|---|
|  | 10 | using namespace std; | 
|---|
|  | 11 |  | 
|---|
|  | 12 | struct TOI { | 
|---|
|  | 13 | TOI() : name(""), index(unspec) {} | 
|---|
|  | 14 | TOI(string n, int i, string opts="", string u=""); | 
|---|
|  | 15 | TOI(string n, int i, set<string> opts, string u=""); | 
|---|
|  | 16 | TOI(string, string u=""); | 
|---|
|  | 17 | TOI(string n, int i, string opts, string u, string reqopts); | 
|---|
|  | 18 |  | 
|---|
|  | 19 | string name; | 
|---|
|  | 20 | set<string> options; | 
|---|
|  | 21 | set<string> reqOptions; // Used for possibleTOIs... Mandatory options for a producer. | 
|---|
|  | 22 | int index;   // -1 : unspecified. -2 : all. | 
|---|
|  | 23 | enum {unspec = -1, all = -2}; | 
|---|
|  | 24 | string unit; | 
|---|
|  | 25 | inline bool operator == (TOI const&) const; | 
|---|
|  | 26 | inline bool operator <  (TOI const&) const; | 
|---|
|  | 27 |  | 
|---|
|  | 28 | int ref; | 
|---|
|  | 29 | static vector<TOI> alltois; | 
|---|
|  | 30 | void findref(); | 
|---|
|  | 31 |  | 
|---|
| [555] | 32 | string fullName() const; | 
|---|
| [534] | 33 | }; | 
|---|
|  | 34 |  | 
|---|
|  | 35 | bool TOI::operator == (TOI const& x) const { | 
|---|
|  | 36 | return ref == x.ref; | 
|---|
|  | 37 | //return (name == x.name && options == x.options && index == x.index); | 
|---|
|  | 38 | } | 
|---|
|  | 39 |  | 
|---|
|  | 40 | bool TOI::operator < (TOI const& x) const { | 
|---|
|  | 41 | return ref < x.ref; | 
|---|
|  | 42 | #if 0 | 
|---|
|  | 43 | return ((name < x.name) || | 
|---|
|  | 44 | (name == x.name && options < x.options) || | 
|---|
|  | 45 | (name == x.name && options == x.options && index < x.index)); | 
|---|
|  | 46 | #endif | 
|---|
|  | 47 | } | 
|---|
|  | 48 |  | 
|---|
|  | 49 | #endif | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.