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 #pragma once
13 
14 #include <vrfGuiCore/vrfGuiCore.h>
15 #include <vrfExtProtocol/objType.h>
16 #include <vlpi/entityType.h>
17 #include <string>
18 
19 class DtEntityType;
20 
21 namespace makVrf
22 {
23  class DT_DLL_VRFGUICORE DtEntityMapperKey : public DtEntityType
24  {
25  public:
26 
27  static const int DtAnyMatch;
28 
30 
31  DtEntityMapperKey(const char* p);
32 
33  DtEntityMapperKey(const DtEntityType&, int force = -1);
34 
36  (
37  int force,
38  int kind,
39  int domain,
40  int country,
41  int category,
42  int subcategory,
43  int specific,
44  int extra
45  );
46 
47  DtEntityMapperKey(int force, const DtEntityType&);
48 
51 
53  virtual ~DtEntityMapperKey();
54 
56  DtEntityMapperKey& operator=(const DtEntityMapperKey& rhs);
57 
59  DtEntityMapperKey& operator=(const char* rhs);
60 
61  const std::string& string() const;
62 
63  int force() const {return myForce;}
64  void setForce(int force){myForce = force;}
65 
67 
68  bool operator==(const DtEntityMapperKey& rhs) const;
69  virtual bool matchPattern(const DtEntityMapperKey &pat) const;
70 
72 
73  bool operator!=(const DtEntityMapperKey& rhs) const;
74 
76 
77  bool operator<(const DtEntityMapperKey& rhs) const;
78 
80 
81  bool operator>(const DtEntityMapperKey& rhs) const;
82 
83  int& operator[](int);
84  const int operator[](int) const;
85 
86  operator DtObjectType() const;
87 
89  virtual bool exactMatch(const DtEntityMapperKey&) const;
90 
91  protected:
92 
93  mutable std::string myStringRep;
94  int myForce;
95  };
96 
97  inline int& DtEntityMapperKey::operator[](int i)
98  {
99  switch (i)
100  {
101  case 0:
102  return DtEntityKind;
103  case 1:
104  return DtDomain;
105  case 2:
106  return DtCountry;
107  case 3:
108  return DtCategory;
109  case 4:
110  return DtSubCategory;
111  case 5:
112  return DtSpecific;
113  case 6:
114  return DtExtra;
115  case 7:
116  return myForce;
117  }
118 
119  return myForce;
120  }
121 
122  inline const int DtEntityMapperKey::operator[](int i) const
123  {
124  switch (i)
125  {
126  case 0:
127  return kind();
128  case 1:
129  return domain();
130  case 2:
131  return country();
132  case 3:
133  return category();
134  case 4:
135  return subCategory();
136  case 5:
137  return specific();
138  case 6:
139  return extra();
140  case 7:
141  return force();
142  }
143 
144  return force();
145  }
146 }

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)