ICU 73.2  73.2
measure.h
Go to the documentation of this file.
00001 // © 2016 and later: Unicode, Inc. and others.
00002 // License & terms of use: http://www.unicode.org/copyright.html
00003 /*
00004 **********************************************************************
00005 * Copyright (c) 2004-2015, International Business Machines
00006 * Corporation and others.  All Rights Reserved.
00007 **********************************************************************
00008 * Author: Alan Liu
00009 * Created: April 26, 2004
00010 * Since: ICU 3.0
00011 **********************************************************************
00012 */
00013 #ifndef __MEASURE_H__
00014 #define __MEASURE_H__
00015 
00016 #include "unicode/utypes.h"
00017 
00018 #if U_SHOW_CPLUSPLUS_API
00019 
00025 #if !UCONFIG_NO_FORMATTING
00026 
00027 #include "unicode/fmtable.h"
00028 
00029 U_NAMESPACE_BEGIN
00030 
00031 class MeasureUnit;
00032 
00045 class U_I18N_API Measure: public UObject {
00046  public:
00057     Measure(const Formattable& number, MeasureUnit* adoptedUnit,
00058             UErrorCode& ec);
00059 
00064     Measure(const Measure& other);
00065 
00070     Measure& operator=(const Measure& other);
00071 
00077     virtual Measure* clone() const;
00078 
00083     virtual ~Measure();
00084     
00090     bool operator==(const UObject& other) const;
00091 
00098     inline const Formattable& getNumber() const;
00099 
00104     inline const MeasureUnit& getUnit() const;
00105 
00117     static UClassID U_EXPORT2 getStaticClassID(void);
00118 
00130     virtual UClassID getDynamicClassID(void) const override;
00131 
00132  protected:
00137     Measure();
00138 
00139  private:
00143     Formattable number;
00144 
00149     MeasureUnit* unit;
00150 };
00151 
00152 inline const Formattable& Measure::getNumber() const {
00153     return number;
00154 }
00155 
00156 inline const MeasureUnit& Measure::getUnit() const {
00157     return *unit;
00158 }
00159 
00160 U_NAMESPACE_END
00161 
00162 #endif // !UCONFIG_NO_FORMATTING
00163 
00164 #endif /* U_SHOW_CPLUSPLUS_API */
00165 
00166 #endif // __MEASURE_H__