ICU 56.1: measure.h Source File

ICU 56.1 56.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

measure.h
Go to the documentation of this file.
1 /*
2 **********************************************************************
3 * Copyright (c) 2004-2015, 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
25 U_NAMESPACE_BEGIN
26
27 class MeasureUnit;
28
41 class U_I18N_API Measure: public UObject {
42 public:
53 Measure(const Formattable& number, MeasureUnit* adoptedUnit,
54 UErrorCode& ec);
55
60 Measure(const Measure& other);
61
66 Measure& operator=(const Measure& other);
67
73 virtual UObject* clone() const;
74
79 virtual ~Measure();
80
86 UBool operator==(const UObject& other) const;
87
94 inline const Formattable& getNumber() const;
95
100 inline const MeasureUnit& getUnit() const;
101
113 static UClassID U_EXPORT2 getStaticClassID(void);
114
126 virtual UClassID getDynamicClassID(void) const;
127
128 protected:
133 Measure();
134
135 private:
139 Formattable number;
140
145 MeasureUnit* unit;
146 };
147
148 inline const Formattable& Measure::getNumber() const {
149 return number;
150 }
151
152 inline const MeasureUnit& Measure::getUnit() const {
153 return *unit;
154 }
155
156 U_NAMESPACE_END
157
158 #endif // !UCONFIG_NO_FORMATTING
159 #endif // __MEASURE_H__
icu::MeasureUnit
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:36
icu::Measure
An amount of a specified unit, consisting of a number and a Unit.
Definition: measure.h:41
icu::UObject::getDynamicClassID
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
icu::operator==
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:91
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:358
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:66
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:221
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234
fmtable.h
C++ API: Formattable is a thin wrapper for primitive types used for formatting and parsing...