2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: FeatureValue.h /main/5 1996/08/21 15:50:29 drk $ */
24 #ifndef _FeatureValue_h
25 #define _FeatureValue_h
27 //#include "Feature.h"
32 #include "dti_cc/cc_pvect.h"
38 // SWM -- COMMENT THIS OUT -- MMDB utility/funcs.h defines this
40 extern "C" int strcasecmp(const char*, const char*);
48 ostream &operator << (ostream &, const FeatureValue &);
50 /* **************************************************************
52 * ************************************************************** */
54 class FeatureValueDimension;
55 class FeatureValueExpression;
56 class FeatureValueFeatureSet;
57 class FeatureValueInt;
58 class FeatureValueReal;
59 class FeatureValueString;
60 class FeatureValueSymbol;
61 class FeatureValueArray;
66 enum FeatureType { real, integer, string, symbol, expression, featureset, dimension, array } ;
67 enum Unit { INCH=0, PICA=1, POINT=2, CM=3, PIXEL=4, NONE=5 };
69 FeatureValue (FeatureType type) : f_type(type) {}
70 virtual ~FeatureValue();
72 const FeatureType type() const { return f_type ; }
74 virtual FeatureValue *clone() const = 0; /* deep copy */
76 virtual FeatureValue *evaluate() const;
78 virtual unsigned int operator==(const FeatureValue &) const;
79 virtual unsigned int operator==(const FeatureValueInt &) const;
80 virtual unsigned int operator==(const FeatureValueString &) const;
81 virtual unsigned int operator==(const FeatureValueReal &) const;
82 virtual unsigned int operator==(const FeatureValueSymbol &) const;
84 // produce a new object which is a merge with this object and the parameter
85 virtual FeatureValue *merge(const FeatureValue &);
87 // these should return a FeatureValue of the appropriate type
88 // the operations are resolved vi double dispatching
89 // all non-numeric types will use zero for their value unless they
90 // are the denominator in a division operation, then they will use a
92 virtual FeatureValue *operator+(const FeatureValue&) const ;
93 virtual FeatureValue *operator-(const FeatureValue&) const ;
94 virtual FeatureValue *operator*(const FeatureValue&) const ;
95 virtual FeatureValue *operator/(const FeatureValue&) const ;
97 virtual FeatureValue *operator+(const FeatureValueInt&) const ;
98 virtual FeatureValue *operator-(const FeatureValueInt&) const ;
99 virtual FeatureValue *operator*(const FeatureValueInt&) const ;
100 virtual FeatureValue *operator/(const FeatureValueInt&) const ;
102 virtual FeatureValue *operator+(const FeatureValueReal&) const ;
103 virtual FeatureValue *operator-(const FeatureValueReal&) const ;
104 virtual FeatureValue *operator*(const FeatureValueReal&) const ;
105 virtual FeatureValue *operator/(const FeatureValueReal&) const ;
107 virtual FeatureValue *operator+(const FeatureValueDimension&) const ;
108 virtual FeatureValue *operator-(const FeatureValueDimension&) const ;
109 virtual FeatureValue *operator*(const FeatureValueDimension&) const ;
110 virtual FeatureValue *operator/(const FeatureValueDimension&) const ;
112 virtual FeatureValue *operator+(const FeatureValueExpression&) const ;
113 virtual FeatureValue *operator-(const FeatureValueExpression&) const ;
114 virtual FeatureValue *operator*(const FeatureValueExpression&) const ;
115 virtual FeatureValue *operator/(const FeatureValueExpression&) const ;
117 virtual FeatureValue *operator+(const int i) const ; /* returns this + i */
118 virtual FeatureValue *operator-(const int i) const ; /* returns this - i */
119 virtual FeatureValue *operator*(const int i) const ; /* returns this * i */
120 virtual FeatureValue *operator/(const int i) const ; /* returns this / i */
122 virtual FeatureValue *operator+(const float f) const ; /* returns this + f */
123 virtual FeatureValue *operator-(const float f) const ; /* returns this - f */
124 virtual FeatureValue *operator*(const float f) const ; /* returns this * f */
125 virtual FeatureValue *operator/(const float f) const ; /* returns this / f */
127 virtual FeatureValue *rdiv(const FeatureValue &) const ;
128 virtual FeatureValue *rsub(const FeatureValue &) const ;
130 virtual FeatureValue *rdiv(const FeatureValueInt &) const ;
131 virtual FeatureValue *rsub(const FeatureValueInt &) const ;
133 virtual FeatureValue *rdiv(const FeatureValueReal &) const ;
134 virtual FeatureValue *rsub(const FeatureValueReal &) const ;
136 virtual FeatureValue *rdiv(const FeatureValueExpression &) const ;
137 virtual FeatureValue *rsub(const FeatureValueExpression &) const ;
139 virtual FeatureValue *rdiv(const FeatureValueDimension &) const ;
140 virtual FeatureValue *rsub(const FeatureValueDimension &) const ;
142 virtual FeatureValue *rdiv(const int) const ;
143 virtual FeatureValue *rsub(const int) const ;
145 virtual FeatureValue *rdiv(const float) const ;
146 virtual FeatureValue *rsub(const float) const ;
149 virtual operator float() const;
150 virtual operator int() const;
151 virtual operator const char *() const;
153 virtual operator const FeatureSet * () const ;
155 virtual ostream &print(ostream&) const = 0;
158 virtual FeatureValue *doConvert(Unit) const ;
159 virtual FeatureValue *convertTo(Unit) const ;
160 virtual FeatureValue *convertTo(Unit from,
170 class FeatureValueReal : public FeatureValue
173 FeatureValueReal(float value)
174 : FeatureValue(real), f_value(value)
177 FeatureValueReal(const FeatureValueReal &);
179 virtual FeatureValue *clone() const; /* deep copy */
182 virtual unsigned int operator==(const FeatureValue &) const;
183 virtual unsigned int operator==(const FeatureValueInt &) const;
184 virtual unsigned int operator==(const FeatureValueString &) const;
185 virtual unsigned int operator==(const FeatureValueReal &) const;
186 virtual unsigned int operator==(const FeatureValueSymbol &) const;
188 virtual FeatureValue *operator+(const FeatureValueInt&) const ;
189 virtual FeatureValue *operator-(const FeatureValueInt&) const ;
190 virtual FeatureValue *operator*(const FeatureValueInt&) const ;
191 virtual FeatureValue *operator/(const FeatureValueInt&) const ;
193 virtual FeatureValue *operator+(const FeatureValueReal&) const ;
194 virtual FeatureValue *operator-(const FeatureValueReal&) const ;
195 virtual FeatureValue *operator*(const FeatureValueReal&) const ;
196 virtual FeatureValue *operator/(const FeatureValueReal&) const ;
198 virtual FeatureValue *operator+(const FeatureValueDimension&) const ;
199 virtual FeatureValue *operator-(const FeatureValueDimension&) const ;
200 virtual FeatureValue *operator*(const FeatureValueDimension&) const ;
201 virtual FeatureValue *operator/(const FeatureValueDimension&) const ;
203 virtual FeatureValue *operator+(const FeatureValueExpression&) const ;
204 virtual FeatureValue *operator-(const FeatureValueExpression&) const ;
205 virtual FeatureValue *operator*(const FeatureValueExpression&) const ;
206 virtual FeatureValue *operator/(const FeatureValueExpression&) const ;
208 virtual FeatureValue *operator+(const FeatureValue&) const ;
209 virtual FeatureValue *operator-(const FeatureValue&) const ;
210 virtual FeatureValue *operator*(const FeatureValue&) const ;
211 virtual FeatureValue *operator/(const FeatureValue&) const ;
213 virtual FeatureValue *operator+(const int i) const ; /* returns this + i */
214 virtual FeatureValue *operator-(const int i) const ; /* returns this - i */
215 virtual FeatureValue *operator*(const int i) const ; /* returns this * i */
216 virtual FeatureValue *operator/(const int i) const ; /* returns this / i */
218 virtual FeatureValue *operator+(const float f) const ; /* returns this + f */
219 virtual FeatureValue *operator-(const float f) const ; /* returns this - f */
220 virtual FeatureValue *operator*(const float f) const ; /* returns this * f */
221 virtual FeatureValue *operator/(const float f) const ; /* returns this / f */
223 virtual FeatureValue *rdiv(const FeatureValue &) const ;
224 virtual FeatureValue *rsub(const FeatureValue &) const ;
226 virtual FeatureValue *rdiv(const FeatureValueInt &) const ;
227 virtual FeatureValue *rsub(const FeatureValueInt &) const ;
229 virtual FeatureValue *rdiv(const FeatureValueReal &) const ;
230 virtual FeatureValue *rsub(const FeatureValueReal &) const ;
232 virtual FeatureValue *rdiv(const FeatureValueExpression &) const ;
233 virtual FeatureValue *rsub(const FeatureValueExpression &) const ;
235 virtual FeatureValue *rdiv(const FeatureValueDimension &) const ;
236 virtual FeatureValue *rsub(const FeatureValueDimension &) const ;
238 virtual FeatureValue *rdiv(const int) const ;
239 virtual FeatureValue *rsub(const int) const ;
241 virtual FeatureValue *rdiv(const float) const ;
242 virtual FeatureValue *rsub(const float) const ;
243 virtual FeatureValue *convertTo(Unit) const ;
244 virtual FeatureValue *convertTo(Unit from,
246 virtual FeatureValue *doConvert(Unit) const ;
248 virtual operator float() const;
249 virtual operator int() const;
250 virtual operator const char *() const;
252 virtual ostream& print(ostream&) const;
259 class FeatureValueInt : public FeatureValue
262 FeatureValueInt(int value)
263 : FeatureValue(integer), f_value(value)
266 FeatureValueInt(const FeatureValueInt &);
268 virtual FeatureValue *clone() const; /* deep copy */
272 virtual unsigned int operator==(const FeatureValue &) const;
273 virtual unsigned int operator==(const FeatureValueInt &) const;
274 virtual unsigned int operator==(const FeatureValueString &) const;
275 virtual unsigned int operator==(const FeatureValueReal &) const;
276 virtual unsigned int operator==(const FeatureValueSymbol &) const;
278 virtual FeatureValue *operator+(const FeatureValue&) const ;
279 virtual FeatureValue *operator-(const FeatureValue&) const ;
280 virtual FeatureValue *operator*(const FeatureValue&) const ;
281 virtual FeatureValue *operator/(const FeatureValue&) const ;
283 virtual FeatureValue *operator+(const FeatureValueInt&) const ;
284 virtual FeatureValue *operator-(const FeatureValueInt&) const ;
285 virtual FeatureValue *operator*(const FeatureValueInt&) const ;
286 virtual FeatureValue *operator/(const FeatureValueInt&) const ;
288 virtual FeatureValue *operator+(const FeatureValueReal&) const ;
289 virtual FeatureValue *operator-(const FeatureValueReal&) const ;
290 virtual FeatureValue *operator*(const FeatureValueReal&) const ;
291 virtual FeatureValue *operator/(const FeatureValueReal&) const ;
293 virtual FeatureValue *operator+(const FeatureValueDimension&) const ;
294 virtual FeatureValue *operator-(const FeatureValueDimension&) const ;
295 virtual FeatureValue *operator*(const FeatureValueDimension&) const ;
296 virtual FeatureValue *operator/(const FeatureValueDimension&) const ;
298 virtual FeatureValue *operator+(const FeatureValueExpression&) const ;
299 virtual FeatureValue *operator-(const FeatureValueExpression&) const ;
300 virtual FeatureValue *operator*(const FeatureValueExpression&) const ;
301 virtual FeatureValue *operator/(const FeatureValueExpression&) const ;
303 virtual FeatureValue *operator+(const int i) const ; /* returns this + i */
304 virtual FeatureValue *operator-(const int i) const ; /* returns this - i */
305 virtual FeatureValue *operator*(const int i) const ; /* returns this * i */
306 virtual FeatureValue *operator/(const int i) const ; /* returns this / i */
308 virtual FeatureValue *operator+(const float f) const ; /* returns this + f */
309 virtual FeatureValue *operator-(const float f) const ; /* returns this - f */
310 virtual FeatureValue *operator*(const float f) const ; /* returns this * f */
311 virtual FeatureValue *operator/(const float f) const ; /* returns this / f */
313 virtual FeatureValue *rdiv(const FeatureValue &) const ;
314 virtual FeatureValue *rsub(const FeatureValue &) const ;
316 virtual FeatureValue *rdiv(const FeatureValueInt &) const ;
317 virtual FeatureValue *rsub(const FeatureValueInt &) const ;
319 virtual FeatureValue *rdiv(const FeatureValueReal &) const ;
320 virtual FeatureValue *rsub(const FeatureValueReal &) const ;
322 virtual FeatureValue *rdiv(const FeatureValueExpression &) const ;
323 virtual FeatureValue *rsub(const FeatureValueExpression &) const ;
325 virtual FeatureValue *rdiv(const FeatureValueDimension &) const ;
326 virtual FeatureValue *rsub(const FeatureValueDimension &) const ;
328 virtual FeatureValue *rdiv(const int) const ;
329 virtual FeatureValue *rsub(const int) const ;
331 virtual FeatureValue *rdiv(const float) const ;
332 virtual FeatureValue *rsub(const float) const ;
334 virtual FeatureValue *convertTo(Unit) const ;
335 virtual FeatureValue *convertTo(Unit from, Unit to) const ;
336 virtual FeatureValue *doConvert(Unit) const ;
338 virtual operator float() const;
339 virtual operator int() const;
340 virtual operator const char *() const;
342 virtual ostream& print(ostream&) const;
349 class FeatureValueString : public FeatureValue
352 FeatureValueString(const char *value)
353 : FeatureValue(string), f_value(value)
356 FeatureValueString(const FeatureValueString &);
357 ~FeatureValueString();
359 virtual FeatureValue *clone() const ; /* deep copy */
361 virtual unsigned int operator==(const FeatureValue &) const;
362 virtual unsigned int operator==(const FeatureValueInt &) const;
363 virtual unsigned int operator==(const FeatureValueString &) const;
364 virtual unsigned int operator==(const FeatureValueReal &) const;
365 virtual unsigned int operator==(const FeatureValueSymbol &) const;
367 // ops for string concatenation
368 // this -> operator+(const FeatureValueExpression&) evaluates
369 // the argument and then call this -> operator+(const FeatureValue&).
370 virtual FeatureValue *operator+(const FeatureValue&) const ;
371 virtual FeatureValue *operator+(const FeatureValueExpression&) const ;
373 // call FeatureValue::operator+ directly.
374 virtual FeatureValue *operator+(const FeatureValueInt&) const ;
375 virtual FeatureValue *operator+(const FeatureValueReal&) const ;
376 virtual FeatureValue *operator+(const FeatureValueDimension&) const ;
378 virtual FeatureValue *operator+(const int i) const ;
379 virtual FeatureValue *operator+(const float f) const ;
381 virtual operator float() const;
382 virtual operator int() const;
383 virtual operator const char *() const;
385 virtual ostream& print(ostream&) const;
396 class FeatureValueSymbol : public FeatureValue
399 FeatureValueSymbol(const Symbol &value)
400 : FeatureValue(symbol), f_value(value)
402 FeatureValueSymbol(const FeatureValueSymbol&);
404 virtual FeatureValue *clone() const ; /* deep copy */
406 virtual unsigned int operator==(const FeatureValue &) const;
407 virtual unsigned int operator==(const FeatureValueInt &) const;
408 virtual unsigned int operator==(const FeatureValueString &) const;
409 virtual unsigned int operator==(const FeatureValueReal &) const;
410 virtual unsigned int operator==(const FeatureValueSymbol &) const;
412 virtual operator float() const;
413 virtual operator int() const;
414 virtual operator const char *() const;
416 virtual ostream& print(ostream&) const;
423 class FeatureValueExpression : public FeatureValue
426 FeatureValueExpression(Expression *);
427 FeatureValueExpression(const FeatureValueExpression&);
428 ~FeatureValueExpression();
430 virtual FeatureValue *clone() const ; /* deep copy */
432 virtual FeatureValue *evaluate() const;
436 virtual FeatureValue *operator+(const FeatureValue&) const ;
437 virtual FeatureValue *operator-(const FeatureValue&) const ;
438 virtual FeatureValue *operator*(const FeatureValue&) const ;
439 virtual FeatureValue *operator/(const FeatureValue&) const ;
441 virtual FeatureValue *operator+(const FeatureValueInt&) const ;
442 virtual FeatureValue *operator-(const FeatureValueInt&) const ;
443 virtual FeatureValue *operator*(const FeatureValueInt&) const ;
444 virtual FeatureValue *operator/(const FeatureValueInt&) const ;
446 virtual FeatureValue *operator+(const FeatureValueReal&) const ;
447 virtual FeatureValue *operator-(const FeatureValueReal&) const ;
448 virtual FeatureValue *operator*(const FeatureValueReal&) const ;
449 virtual FeatureValue *operator/(const FeatureValueReal&) const ;
451 virtual FeatureValue *operator+(const FeatureValueDimension&) const ;
452 virtual FeatureValue *operator-(const FeatureValueDimension&) const ;
453 virtual FeatureValue *operator*(const FeatureValueDimension&) const ;
454 virtual FeatureValue *operator/(const FeatureValueDimension&) const ;
456 virtual FeatureValue *operator+(const FeatureValueExpression&) const ;
457 virtual FeatureValue *operator-(const FeatureValueExpression&) const ;
458 virtual FeatureValue *operator*(const FeatureValueExpression&) const ;
459 virtual FeatureValue *operator/(const FeatureValueExpression&) const ;
461 virtual FeatureValue *operator+(const int i) const ; /* returns this + i */
462 virtual FeatureValue *operator-(const int i) const ; /* returns this - i */
463 virtual FeatureValue *operator*(const int i) const ; /* returns this * i */
464 virtual FeatureValue *operator/(const int i) const ; /* returns this / i */
466 virtual FeatureValue *operator+(const float f) const ; /* returns this + f */
467 virtual FeatureValue *operator-(const float f) const ; /* returns this - f */
468 virtual FeatureValue *operator*(const float f) const ; /* returns this * f */
469 virtual FeatureValue *operator/(const float f) const ; /* returns this / f */
471 virtual FeatureValue *rdiv(const FeatureValue &) const ;
472 virtual FeatureValue *rsub(const FeatureValue &) const ;
474 virtual FeatureValue *rdiv(const FeatureValueInt &) const ;
475 virtual FeatureValue *rsub(const FeatureValueInt &) const ;
477 virtual FeatureValue *rdiv(const FeatureValueReal &) const ;
478 virtual FeatureValue *rsub(const FeatureValueReal &) const ;
480 virtual FeatureValue *rdiv(const FeatureValueExpression &) const ;
481 virtual FeatureValue *rsub(const FeatureValueExpression &) const ;
483 virtual FeatureValue *rdiv(const FeatureValueDimension &) const ;
484 virtual FeatureValue *rsub(const FeatureValueDimension &) const ;
486 virtual FeatureValue *rdiv(const int) const ;
487 virtual FeatureValue *rsub(const int) const ;
489 virtual FeatureValue *rdiv(const float) const ;
490 virtual FeatureValue *rsub(const float) const ;
492 virtual operator float() const;
493 virtual operator int() const;
494 virtual operator const char *() const;
496 virtual ostream& print(ostream&) const;
502 class FeatureValueFeatureSet : public FeatureValue
505 FeatureValueFeatureSet(FeatureSet *);
506 FeatureValueFeatureSet(const FeatureValueFeatureSet&);
507 ~FeatureValueFeatureSet();
509 const FeatureSet *value() const { return f_value ; }
511 virtual FeatureValue *evaluate() const;
513 virtual FeatureValue *clone() const; /* deep copy */
515 virtual FeatureValue *merge(const FeatureValue &f);
517 virtual ostream& print(ostream&) const;
519 virtual operator const FeatureSet *() const ;
526 typedef pointer_vector<FeatureValue> ArrayType;
528 typedef pointer_vector<FeatureValue> ArrayType;
531 class FeatureValueArray: public FeatureValue, public ArrayType
534 FeatureValueArray(const char* array_name, int size);
535 FeatureValueArray(const FeatureValueArray&);
536 ~FeatureValueArray();
538 virtual FeatureValue *evaluate() const;
540 virtual FeatureValue *clone() const
541 { return new FeatureValueArray(*this); }; /* deep copy */
543 virtual ostream& print(ostream&) const;
545 const char* name() { return f_name; };
552 class FeatureValueDimension : public FeatureValue
556 FeatureValueDimension(FeatureValue *value, const char* unit_string);
557 FeatureValueDimension(FeatureValue *value, Unit unit);
559 FeatureValueDimension(float value, const char* unit_string) ;
560 FeatureValueDimension(float value, Unit unit) :
561 FeatureValue(dimension), f_value(0),
562 f_cachedValue(value), f_unit(unit) {};
566 FeatureValueDimension(const FeatureValueDimension&);
567 ~FeatureValueDimension();
569 virtual FeatureValue *clone() const; /* deep copy */
571 virtual FeatureValue *evaluate() const ;
574 virtual FeatureValue *operator+(const FeatureValue&) const ;
575 virtual FeatureValue *operator-(const FeatureValue&) const ;
576 virtual FeatureValue *operator*(const FeatureValue&) const ;
577 virtual FeatureValue *operator/(const FeatureValue&) const ;
579 virtual FeatureValue *operator+(const FeatureValueInt&) const ;
580 virtual FeatureValue *operator-(const FeatureValueInt&) const ;
581 virtual FeatureValue *operator*(const FeatureValueInt&) const ;
582 virtual FeatureValue *operator/(const FeatureValueInt&) const ;
584 virtual FeatureValue *operator+(const FeatureValueReal&) const ;
585 virtual FeatureValue *operator-(const FeatureValueReal&) const ;
586 virtual FeatureValue *operator*(const FeatureValueReal&) const ;
587 virtual FeatureValue *operator/(const FeatureValueReal&) const ;
589 virtual FeatureValue *operator+(const FeatureValueDimension&) const ;
590 virtual FeatureValue *operator-(const FeatureValueDimension&) const ;
591 virtual FeatureValue *operator*(const FeatureValueDimension&) const ;
592 virtual FeatureValue *operator/(const FeatureValueDimension&) const ;
594 virtual FeatureValue *operator+(const FeatureValueExpression&) const ;
595 virtual FeatureValue *operator-(const FeatureValueExpression&) const ;
596 virtual FeatureValue *operator*(const FeatureValueExpression&) const ;
597 virtual FeatureValue *operator/(const FeatureValueExpression&) const ;
599 virtual FeatureValue *operator+(const int i) const ; /* returns this + i */
600 virtual FeatureValue *operator-(const int i) const ; /* returns this - i */
601 virtual FeatureValue *operator*(const int i) const ; /* returns this * i */
602 virtual FeatureValue *operator/(const int i) const ; /* returns this / i */
604 virtual FeatureValue *operator+(const float f) const ; /* returns this + f */
605 virtual FeatureValue *operator-(const float f) const ; /* returns this - f */
606 virtual FeatureValue *operator*(const float f) const ; /* returns this * f */
607 virtual FeatureValue *operator/(const float f) const ; /* returns this / f */
609 virtual FeatureValue *rdiv(const FeatureValue &) const ;
610 virtual FeatureValue *rsub(const FeatureValue &) const ;
612 virtual FeatureValue *rdiv(const FeatureValueInt &) const ;
613 virtual FeatureValue *rsub(const FeatureValueInt &) const ;
615 virtual FeatureValue *rdiv(const FeatureValueReal &) const ;
616 virtual FeatureValue *rsub(const FeatureValueReal &) const ;
618 virtual FeatureValue *rdiv(const FeatureValueExpression &) const ;
619 virtual FeatureValue *rsub(const FeatureValueExpression &) const ;
621 virtual FeatureValue *rdiv(const FeatureValueDimension &) const ;
622 virtual FeatureValue *rsub(const FeatureValueDimension &) const ;
624 virtual FeatureValue *rdiv(const int) const ;
625 virtual FeatureValue *rsub(const int) const ;
627 virtual FeatureValue *rdiv(const float) const ;
628 virtual FeatureValue *rsub(const float) const ;
630 virtual FeatureValue *convertTo(Unit) const ;
631 virtual FeatureValue *convertTo(Unit from, Unit to) const ;
632 virtual FeatureValue *doConvert(Unit) const ;
634 virtual operator float() const;
635 virtual operator int() const;
636 virtual operator const char *() const;
638 float getValue(Unit);
640 FeatureValue *value() { return f_value ; }
641 Unit unit() { return f_unit ; }
643 virtual ostream& print(ostream&) const;
646 FeatureValue *f_value ;
651 float convert(float y, Unit dimensionOfy, Unit dimensionOfReturn);
652 Unit convertToUnit(const char*);
655 #endif /* _FeatureValue_h */
656 /* DO NOT ADD ANY LINES AFTER THIS #endif */