sharedcalendar.h 1022 B

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