tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

sharedcalendar.h (1233B)


      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 
     11 #ifndef __SHARED_CALENDAR_H__
     12 #define __SHARED_CALENDAR_H__
     13 
     14 #include "unicode/utypes.h"
     15 #include "sharedobject.h"
     16 #include "unifiedcache.h"
     17 
     18 U_NAMESPACE_BEGIN
     19 
     20 class Calendar;
     21 
     22 class U_I18N_API SharedCalendar : public SharedObject {
     23 public:
     24    SharedCalendar(Calendar *calToAdopt) : ptr(calToAdopt) { }
     25    virtual ~SharedCalendar();
     26    const Calendar *get() const { return ptr; }
     27    const Calendar *operator->() const { return ptr; }
     28    const Calendar &operator*() const { return *ptr; }
     29 private:
     30    Calendar *ptr;
     31    SharedCalendar(const SharedCalendar &) = delete;
     32    SharedCalendar &operator=(const SharedCalendar &) = delete;
     33 };
     34 
     35 template<> U_I18N_API
     36 const SharedCalendar *LocaleCacheKey<SharedCalendar>::createObject(
     37        const void * /*unusedCreationContext*/, UErrorCode &status) const;
     38 
     39 
     40 U_NAMESPACE_END
     41 
     42 #endif