VR-Forces 4.1 Class Documentation
entityMapperKey.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1997 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: entityMapperKey.h,v $ $Revision: 1.2 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef ENTITYMAPPERKEY_H
13 #define ENTITYMAPPERKEY_H
14 
15 #include "ngutil/ngutilDefines.h"
16 #include <string>
17 
18 class DtEntityType;
19 
21 {
22 
23 public:
24 
25  static const int DtAnyMatch;
26 
28 
29  DtEntityMapperKey(const char* p);
30 
32  (
33  int force,
34  int super,
35  int kind,
36  int domain,
37  int country,
38  int category,
39  int subcategory,
40  int specific,
41  int extra
42  );
43 
46 
49 
51  DtEntityMapperKey& operator=(const DtEntityMapperKey& rhs);
52 
54  DtEntityMapperKey& operator=(const char* rhs);
55 
56  const std::string& string() const;
57 
58  int force() const {return myForce;}
59  void setForce(int force){myForce = force;}
60 
61  int super() const {return mySuper;}
62  void setSuper(int super){mySuper = super;}
63 
64  int kind() const {return myKind;}
65  void setKind(int kind){myKind = kind;}
66 
67  int domain() const {return myDomain;}
68  void setDomain(int domain){myDomain = domain;}
69 
70  int country() const {return myCountry;}
71  void setCountry(int country){myCountry = country;}
72 
73  int category() const {return myCategory;}
74  void setCategory(int category){myCategory = category;}
75 
76  int subcategory() const {return mySubcategory;}
77  void setSubCategory(int subcategory){mySubcategory = subcategory;}
78 
79  int specific() const {return mySpecific;}
80  void setSpecific(int specific){mySpecific = specific;}
81 
82  int extra() const {return myExtra;}
83  void setExtra(int extra){myExtra = extra;}
84 
86 
87  bool operator==(const DtEntityMapperKey& rhs) const;
88  virtual bool matchPattern(const DtEntityMapperKey &pat) const;
89 
91 
92  bool operator!=(const DtEntityMapperKey& rhs) const;
93 
95 
96  bool operator<(const DtEntityMapperKey& rhs) const;
97 
99 
100  bool operator>(const DtEntityMapperKey& rhs) const;
101 
102  int& operator[](int);
103  const int operator[](int) const;
104 
106  virtual bool exactMatch(const DtEntityMapperKey&) const;
107 
108 protected:
109 
110  mutable std::string myStringRep;
111  int myForce;
112  int mySuper;
113  int myKind;
114  int myDomain;
119  int myExtra;
120 };
121 
123 {
124  switch (i)
125  {
126  case 0:
127  return myKind;
128  case 1:
129  return myDomain;
130  case 2:
131  return myCountry;
132  case 3:
133  return myCategory;
134  case 4:
135  return mySubcategory;
136  case 5:
137  return mySpecific;
138  case 6:
139  return myExtra;
140  case 7:
141  return mySuper;
142  case 9:
143  return myForce;
144  }
145 
146  return myForce;
147 }
148 
149 inline const int DtEntityMapperKey::operator[](int i) const
150 {
151  switch (i)
152  {
153  case 0:
154  return myKind;
155  case 1:
156  return myDomain;
157  case 2:
158  return myCountry;
159  case 3:
160  return myCategory;
161  case 4:
162  return mySubcategory;
163  case 5:
164  return mySpecific;
165  case 6:
166  return myExtra;
167  case 7:
168  return mySuper;
169  case 9:
170  return myForce;
171  }
172 
173  return myForce;
174 }
175 
176 #endif
177 

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)