VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stringIntMapper.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2001 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: strIntMapper.h,v $ $Revision: 1.10 $ $State: Exp $
7 *******************************************************************************/
13 
16 
17 
18 #ifndef DtStringIntMapper_H_
19 #define DtStringIntMapper_H_
20 
21 #include <vlutil/vlHashlist.h>
22 #include <vlutil/vlString.h>
23 
72 
73 #include "vrfutil/vrfutilDefines.h"
75 {
76 public:
78  DtStringIntMapper(unsigned mapSize = 0, int offset = 0,
79  bool useStringHashlist = true);
80 
81 protected:
84  DtStringIntMapper & operator=(const DtStringIntMapper &orig) { return *this; }
85 
86 public:
87 
89  virtual ~DtStringIntMapper();
90 
91 protected:
95  virtual bool createIntToStringMap();
96 
100  virtual bool createStringToIntMap();
101 
102 public:
103 
111  virtual bool addMapping(const DtString& stringVal,
112  int intVal);
113 
116  virtual bool removeMapping(const DtString& stringVal,
117  int intVal);
118 
122  virtual bool getStringFromInt(int intVal, DtString& stringVal) const;
123 
127  virtual bool getIntFromString(const DtString& stringVal, int& intVal) const;
128 
129 protected:
130 
134  void emptyIntToStringArray();
135  void emptyStringToIntHashlist();
136  void emptyIntToStringHashlist();
138 
144  virtual bool checkString(const DtString& stringVal, int intVal) const;
148  virtual bool checkInteger(int intVal, const DtString& stringVal) const;
149 
151  bool checkMapArrayInit(const DtString& caller) const;
152  bool checkStringToIntHashlistInit(const DtString& caller) const;
153  bool checkIntToStringHashlistInit(const DtString& caller) const;
154  bool checkMapArrayIndexRange(int index, int intVal,
155  const DtString& caller) const;
156 
157 protected:
158 
162  unsigned myMapSize;
163 
168 
171  int myOffset;
172 
179 
184 
188 
189 };
190 
191 
192 
193 #endif
194 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)