ICU 50.1.2  50.1.2
measure.h
Go to the documentation of this file.
1 /*
2 **********************************************************************
3 * Copyright (c) 2004-2006, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * Author: Alan Liu
7 * Created: April 26, 2004
8 * Since: ICU 3.0
9 **********************************************************************
10 */
11 #ifndef __MEASURE_H__
12 #define __MEASURE_H__
13 
14 #include "unicode/utypes.h"
15 
21 #if !UCONFIG_NO_FORMATTING
22 
23 #include "unicode/fmtable.h"
24 
26 
27 class MeasureUnit;
28 
45 class U_I18N_API Measure: public UObject {
46  public:
57  Measure(const Formattable& number, MeasureUnit* adoptedUnit,
58  UErrorCode& ec);
59 
64  Measure(const Measure& other);
65 
70  Measure& operator=(const Measure& other);
71 
77  virtual UObject* clone() const = 0;
78 
83  virtual ~Measure();
84 
90  UBool operator==(const UObject& other) const;
91 
98  inline const Formattable& getNumber() const;
99 
104  inline const MeasureUnit& getUnit() const;
105 
106  protected:
111  Measure();
112 
113  private:
117  Formattable number;
118 
123  MeasureUnit* unit;
124 };
125 
126 inline const Formattable& Measure::getNumber() const {
127  return number;
128 }
129 
130 inline const MeasureUnit& Measure::getUnit() const {
131  return *unit;
132 }
133 
135 
136 #endif // !UCONFIG_NO_FORMATTING
137 #endif // __MEASURE_H__