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