xref: /aosp_15_r20/external/icu/libicu/cts_headers/sharedpluralrules.h (revision 0e209d3975ff4a8c132096b14b0e9364a753506e)
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 * sharedpluralrules.h
9 */
10 
11 #ifndef __SHARED_PLURALRULES_H__
12 #define __SHARED_PLURALRULES_H__
13 
14 #include "unicode/utypes.h"
15 #include "sharedobject.h"
16 #include "unifiedcache.h"
17 
18 U_NAMESPACE_BEGIN
19 
20 class PluralRules;
21 
22 class U_I18N_API SharedPluralRules : public SharedObject {
23 public:
SharedPluralRules(PluralRules * prToAdopt)24     SharedPluralRules(PluralRules *prToAdopt) : ptr(prToAdopt) { }
25     virtual ~SharedPluralRules();
26     const PluralRules *operator->() const { return ptr; }
27     const PluralRules &operator*() const { return *ptr; }
28 private:
29     PluralRules *ptr;
30     SharedPluralRules(const SharedPluralRules &) = delete;
31     SharedPluralRules &operator=(const SharedPluralRules &) =delete;
32 };
33 
34 template<> U_I18N_API
35 const SharedPluralRules *LocaleCacheKey<SharedPluralRules>::createObject(
36         const void * /*unused*/, UErrorCode &status) const;
37 
38 U_NAMESPACE_END
39 
40 #endif
41