1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
5 * Copyright (C) 2008-2013, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 *******************************************************************************
12 * Modification History:*
13 * Date Name Description
15 ********************************************************************************
21 #include "unicode/utypes.h"
23 #if !UCONFIG_NO_FORMATTING
25 #include "unicode/locid.h"
26 #include "unicode/ugender.h"
27 #include "unicode/uobject.h"
33 // Forward Declaration
34 void U_CALLCONV GenderInfo_initCache(UErrorCode &status);
37 * GenderInfo computes the gender of a list as a whole given the gender of
41 class U_I18N_API GenderInfo : public UObject {
45 * Provides access to the predefined GenderInfo object for a given
48 * @param locale The locale for which a <code>GenderInfo</code> object is
50 * @param status Output param set to success/failure code on exit, which
51 * must not indicate a failure before the function call.
52 * @return The predefined <code>GenderInfo</code> object pointer for
53 * this locale. The returned object is immutable, so it is
54 * declared as const. Caller does not own the returned
55 * pointer, so it must not attempt to free it.
58 static const GenderInfo* U_EXPORT2 getInstance(const Locale& locale, UErrorCode& status);
61 * Determines the gender of a list as a whole given the gender of each
64 * @param genders the gender of each element in the list.
65 * @param length the length of gender array.
66 * @param status Output param set to success/failure code on exit, which
67 * must not indicate a failure before the function call.
68 * @return the gender of the whole list.
71 UGender getListGender(const UGender* genders, int32_t length, UErrorCode& status) const;
78 virtual ~GenderInfo();
84 * Copy constructor. One object per locale invariant. Clients
85 * must never copy GenderInfo objects.
87 GenderInfo(const GenderInfo& other);
90 * Assignment operator. Not applicable to immutable objects.
92 GenderInfo& operator=(const GenderInfo&);
96 static const GenderInfo* getNeutralInstance();
98 static const GenderInfo* getMixedNeutralInstance();
100 static const GenderInfo* getMaleTaintsInstance();
102 static const GenderInfo* loadInstance(const Locale& locale, UErrorCode& status);
104 friend class ::GenderInfoTest;
105 friend void U_CALLCONV GenderInfo_initCache(UErrorCode &status);
110 #endif /* #if !UCONFIG_NO_FORMATTING */