26 #ifndef INTEGRA_VALUE_PRIVATE_H
27 #define INTEGRA_VALUE_PRIVATE_H
29 #include <unordered_map>
65 virtual type get_type()
const = 0;
74 virtual operator int()
const;
80 virtual operator float()
const;
86 virtual operator const string &()
const;
92 virtual CValue *clone()
const = 0;
98 virtual void convert(
CValue &conversion_target )
const = 0;
105 virtual bool is_equal(
const CValue &other )
const = 0;
116 virtual float get_distance(
const CValue &other )
const = 0;
120 virtual string get_as_string()
const = 0;
125 virtual void set_from_string(
const string &source ) = 0;
133 CValue *transmogrify( type new_type )
const;
140 static CValue *factory( type new_type );
144 static const char *get_type_name( type value_type );
151 static int type_to_ixd_code( type value_type );
158 static type ixd_code_to_type(
int ixd_code );
162 void handle_incorrect_cast( type cast_target )
const;
177 type get_type()
const;
179 operator int()
const;
183 void convert(
CValue &conversion_target )
const;
185 bool is_equal(
const CValue &other )
const;
186 float get_distance(
const CValue &other )
const;
188 string get_as_string()
const;
189 void set_from_string(
const string &source );
208 type get_type()
const;
210 operator float()
const;
214 void convert(
CValue &conversion_target )
const;
216 bool is_equal(
const CValue &other )
const;
217 float get_distance(
const CValue &other )
const;
219 string get_as_string()
const;
220 void set_from_string(
const string &source );
239 type get_type()
const;
241 operator const string &()
const;
245 void convert(
CValue &conversion_target )
const;
247 bool is_equal(
const CValue &other )
const;
248 float get_distance(
const CValue &other )
const;
250 string get_as_string()
const;
251 void set_from_string(
const string &source );
256 static int levenshtein_distance(
const char *string1,
const char *string2 );
263 typedef std::unordered_map<string, CValue *> value_map;
266 typedef std::unordered_set<CValue *> value_set;
type
Definition: value.h:52
Base class for the concrete value classes CIntegerValue, CFloatValue and CStringValue.
Definition: value.h:42
Represents a float value.
Definition: value.h:200
Represents a string value.
Definition: value.h:231
Represents an integer value.
Definition: value.h:169
#defines and typedefs used throughout the application