| 1 | // © 2016 and later: Unicode, Inc. and others. | 
|---|---|
| 2 | // License & terms of use: http://www.unicode.org/copyright.html | 
| 3 | /* | 
| 4 | ****************************************************************************** | 
| 5 | * Copyright (C) 2014, International Business Machines | 
| 6 | * Corporation and others. All Rights Reserved. | 
| 7 | ****************************************************************************** | 
| 8 | * sharednumberformat.h | 
| 9 | */ | 
| 10 | |
| 11 | #ifndef __SHARED_NUMBERFORMAT_H__ | 
| 12 | #define __SHARED_NUMBERFORMAT_H__ | 
| 13 | |
| 14 | #include "unicode/utypes.h" | 
| 15 | #include "sharedobject.h" | 
| 16 | |
| 17 | U_NAMESPACE_BEGIN | 
| 18 | |
| 19 | class NumberFormat; | 
| 20 | |
| 21 | class U_I18N_API SharedNumberFormat : public SharedObject { | 
| 22 | public: | 
| 23 | SharedNumberFormat(NumberFormat *nfToAdopt) : ptr(nfToAdopt) { } | 
| 24 | virtual ~SharedNumberFormat(); | 
| 25 | const NumberFormat *get() const { return ptr; } | 
| 26 | const NumberFormat *operator->() const { return ptr; } | 
| 27 | const NumberFormat &operator*() const { return *ptr; } | 
| 28 | private: | 
| 29 | NumberFormat *ptr; | 
| 30 | SharedNumberFormat(const SharedNumberFormat &); | 
| 31 | SharedNumberFormat &operator=(const SharedNumberFormat &); | 
| 32 | }; | 
| 33 | |
| 34 | U_NAMESPACE_END | 
| 35 | |
| 36 | #endif | 
| 37 | 
