sharednumberformat.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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. #ifndef __SHARED_NUMBERFORMAT_H__
  11. #define __SHARED_NUMBERFORMAT_H__
  12. #include "unicode/utypes.h"
  13. #include "sharedobject.h"
  14. U_NAMESPACE_BEGIN
  15. class NumberFormat;
  16. class U_I18N_API SharedNumberFormat : public SharedObject {
  17. public:
  18. SharedNumberFormat(NumberFormat *nfToAdopt) : ptr(nfToAdopt) { }
  19. virtual ~SharedNumberFormat();
  20. const NumberFormat *get() const { return ptr; }
  21. const NumberFormat *operator->() const { return ptr; }
  22. const NumberFormat &operator*() const { return *ptr; }
  23. private:
  24. NumberFormat *ptr;
  25. SharedNumberFormat(const SharedNumberFormat &);
  26. SharedNumberFormat &operator=(const SharedNumberFormat &);
  27. };
  28. U_NAMESPACE_END
  29. #endif