这篇教程C++ umtx_initOnce函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中umtx_initOnce函数的典型用法代码示例。如果您正苦于以下问题:C++ umtx_initOnce函数的具体用法?C++ umtx_initOnce怎么用?C++ umtx_initOnce使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了umtx_initOnce函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: umtx_initOnceUDateEthiopicCalendar::defaultCenturyStart() const{ // lazy-evaluate systemDefaultCenturyStart umtx_initOnce(gSystemDefaultCenturyInit, &initializeSystemDefaultCentury); return gSystemDefaultCenturyStart;}
开发者ID:AlexanderPankiv,项目名称:node,代码行数:7,
示例2: umtx_initOnceint32_tCopticCalendar::defaultCenturyStartYear() const{ // lazy-evaluate systemDefaultCenturyStart umtx_initOnce(gSystemDefaultCenturyInit, &initializeSystemDefaultCentury); return gSystemDefaultCenturyStartYear;}
开发者ID:MIPS,项目名称:external-icu,代码行数:7,
示例3: umtx_initOnceint32_tChineseCalendar::internalGetDefaultCenturyStartYear() const{ // lazy-evaluate systemDefaultCenturyStartYear umtx_initOnce(gSystemDefaultCenturyInitOnce, &initializeSystemDefaultCentury); return gSystemDefaultCenturyStartYear;}
开发者ID:119120119,项目名称:node,代码行数:7,
示例4: umtx_initOnceU_CDECL_ENDUnicodeSet *SimpleDateFormatStaticSets::getIgnorables(UDateFormatField fieldIndex){ UErrorCode status = U_ZERO_ERROR; umtx_initOnce(gSimpleDateFormatStaticSetsInitOnce, &smpdtfmt_initSets, status); if (U_FAILURE(status)) { return NULL; } switch (fieldIndex) { case UDAT_YEAR_FIELD: case UDAT_MONTH_FIELD: case UDAT_DATE_FIELD: case UDAT_STANDALONE_DAY_FIELD: case UDAT_STANDALONE_MONTH_FIELD: return gStaticSets->fDateIgnorables; case UDAT_HOUR_OF_DAY1_FIELD: case UDAT_HOUR_OF_DAY0_FIELD: case UDAT_MINUTE_FIELD: case UDAT_SECOND_FIELD: case UDAT_HOUR1_FIELD: case UDAT_HOUR0_FIELD: return gStaticSets->fTimeIgnorables; default: return gStaticSets->fOtherIgnorables; }}
开发者ID:icu-project,项目名称:icu4c,代码行数:30,
示例5: uspoof_openFromSerializedU_CAPI USpoofChecker * U_EXPORT2uspoof_openFromSerialized(const void *data, int32_t length, int32_t *pActualLength, UErrorCode *status) { if (U_FAILURE(*status)) { return NULL; } umtx_initOnce(gSpoofInitOnce, &initializeStatics, *status); SpoofData *sd = new SpoofData(data, length, *status); SpoofImpl *si = new SpoofImpl(sd, *status); if (U_FAILURE(*status)) { delete sd; delete si; return NULL; } if (sd == NULL || si == NULL) { *status = U_MEMORY_ALLOCATION_ERROR; delete sd; delete si; return NULL; } if (pActualLength != NULL) { *pActualLength = sd->fRawData->fLength; } return reinterpret_cast<USpoofChecker *>(si);}
开发者ID:eyoung-father,项目名称:libicu_full,代码行数:26,
示例6: umtx_initOnce/** * Register two targets as being inverses of one another. For * example, calling registerSpecialInverse("NFC", "NFD", TRUE) causes * Transliterator to form the following inverse relationships: * * <pre>NFC => NFD * Any-NFC => Any-NFD * NFD => NFC * Any-NFD => Any-NFC</pre> * * (Without the special inverse registration, the inverse of NFC * would be NFC-Any.) Note that NFD is shorthand for Any-NFD, but * that the presence or absence of "Any-" is preserved. * * <p>The relationship is symmetrical; registering (a, b) is * equivalent to registering (b, a). * * <p>The relevant IDs must still be registered separately as * factories or classes. * * <p>Only the targets are specified. Special inverses always * have the form Any-Target1 <=> Any-Target2. The target should * have canonical casing (the casing desired to be produced when * an inverse is formed) and should contain no whitespace or other * extraneous characters. * * @param target the target against which to register the inverse * @param inverseTarget the inverse of target, that is * Any-target.getInverse() => Any-inverseTarget * @param bidirectional if TRUE, register the reverse relation * as well, that is, Any-inverseTarget.getInverse() => Any-target */void TransliteratorIDParser::registerSpecialInverse(const UnicodeString& target, const UnicodeString& inverseTarget, UBool bidirectional, UErrorCode &status) { umtx_initOnce(gSpecialInversesInitOnce, init, status); if (U_FAILURE(status)) { return; } // If target == inverseTarget then force bidirectional => FALSE if (bidirectional && 0==target.caseCompare(inverseTarget, U_FOLD_CASE_DEFAULT)) { bidirectional = FALSE; } Mutex lock(&LOCK); UnicodeString *tempus = new UnicodeString(inverseTarget); // Used for null pointer check before usage. if (tempus == NULL) { status = U_MEMORY_ALLOCATION_ERROR; return; } SPECIAL_INVERSES->put(target, tempus, status); if (bidirectional) { tempus = new UnicodeString(target); if (tempus == NULL) { status = U_MEMORY_ALLOCATION_ERROR; return; } SPECIAL_INVERSES->put(inverseTarget, tempus, status); }}
开发者ID:MIPS,项目名称:external-icu,代码行数:63,
示例7: umtx_initOnce/** * Returns an enumeration over the IDs of all the regions that are children of this region anywhere in the region * hierarchy and match the given type. This API may return an empty enumeration if this region doesn't have any * sub-regions that match the given type. For example, calling this method with region "150" (Europe) and type * "URGN_TERRITORY" returns a set containing all the territories in Europe ( "FR" (France) - "IT" (Italy) - "DE" (Germany) etc. ) */StringEnumeration*Region::getContainedRegions( URegionType type, UErrorCode &status ) const { umtx_initOnce(gRegionDataInitOnce, &loadRegionData, status); // returns immediately if U_FAILURE(status) if (U_FAILURE(status)) { return NULL; } UVector *result = new UVector(NULL, uhash_compareChars, status); StringEnumeration *cr = getContainedRegions(status); for ( int32_t i = 0 ; i < cr->count(status) ; i++ ) { const char *id = cr->next(NULL,status); const Region *r = Region::getInstance(id,status); if ( r->getType() == type ) { result->addElement((void *)&r->idStr,status); } else { StringEnumeration *children = r->getContainedRegions(type, status); for ( int32_t j = 0 ; j < children->count(status) ; j++ ) { const char *id2 = children->next(NULL,status); const Region *r2 = Region::getInstance(id2,status); result->addElement((void *)&r2->idStr,status); } delete children; } } delete cr; StringEnumeration* resultEnumeration = new RegionNameEnumeration(result,status); delete result; return resultEnumeration;}
开发者ID:Cyril2004,项目名称:proto-quic,代码行数:37,
示例8: umtx_initOnceconst UChar*ZoneMeta::findMetaZoneID(const UnicodeString& mzid) { umtx_initOnce(gMetaZoneIDsInitOnce, &initAvailableMetaZoneIDs); if (gMetaZoneIDTable == NULL) { return NULL; } return (const UChar*)uhash_get(gMetaZoneIDTable, &mzid);}
开发者ID:basti1302,项目名称:node,代码行数:8,
示例9: umtx_initOnceUnifiedCache *UnifiedCache::getInstance(UErrorCode &status) { umtx_initOnce(gCacheInitOnce, &cacheInit, status); if (U_FAILURE(status)) { return NULL; } U_ASSERT(gCache != NULL); return gCache;}
开发者ID:Mikhaska,项目名称:node,代码行数:8,
示例10: umtx_initOnceU_CDECL_ENDconst Norm2AllModes *Norm2AllModes::getNFKCInstance(UErrorCode &errorCode) { if(U_FAILURE(errorCode)) { return NULL; } umtx_initOnce(nfkcInitOnce, &initSingletons, "nfkc", errorCode); return nfkcSingleton;}
开发者ID:AaronNGray,项目名称:texlive-libs,代码行数:8,
示例11: umtx_initOnceU_CDECL_END#if !NORM2_HARDCODE_NFC_DATAconst Norm2AllModes *Norm2AllModes::getNFCInstance(UErrorCode &errorCode) { if(U_FAILURE(errorCode)) { return NULL; } umtx_initOnce(nfcInitOnce, &initSingletons, "nfc", errorCode); return nfcSingleton;}
开发者ID:JoeDoyle23,项目名称:node,代码行数:9,
示例12: initstatic UBoolinit() { UErrorCode sts = U_ZERO_ERROR; umtx_initOnce(gLocExtKeyMapInitOnce, &initFromResourceBundle, sts); if (U_FAILURE(sts)) { return FALSE; } return TRUE;}
开发者ID:MoonchildProductions,项目名称:Pale-Moon,代码行数:9,
示例13: umtx_lockU_CAPI void U_EXPORT2umtx_lock(UMutex *mutex) { if (mutex == NULL) { mutex = &globalMutex; } CRITICAL_SECTION *cs = &mutex->fCS; umtx_initOnce(mutex->fInitOnce, winMutexInit, cs); EnterCriticalSection(cs);}
开发者ID:MIPS,项目名称:external-icu,代码行数:9,
示例14: u_initU_NAMESPACE_ENDU_NAMESPACE_USE/* * ICU Initialization Function. Need not be called. */U_CAPI void U_EXPORT2u_init(UErrorCode *status) { UTRACE_ENTRY_OC(UTRACE_U_INIT); umtx_initOnce(gICUInitOnce, &initData, *status); UTRACE_EXIT_STATUS(*status);}
开发者ID:Acorld,项目名称:WinObjC-Heading,代码行数:13,
示例15: uspoof_openU_CAPI USpoofChecker * U_EXPORT2uspoof_open(UErrorCode *status) { if (U_FAILURE(*status)) { return NULL; } umtx_initOnce(gSpoofInitOnce, &initializeStatics, *status); SpoofImpl *si = new SpoofImpl(SpoofData::getDefault(*status), *status); if (U_FAILURE(*status)) { delete si; si = NULL; } return reinterpret_cast<USpoofChecker *>(si);}
开发者ID:eyoung-father,项目名称:libicu_full,代码行数:13,
示例16: umtx_initOnceconst DayPeriodRules *DayPeriodRules::getInstance(const Locale &locale, UErrorCode &errorCode) { umtx_initOnce(initOnce, DayPeriodRules::load, errorCode); // If the entire day period rules data doesn't conform to spec (even if the part we want // does), return NULL. if(U_FAILURE(errorCode)) { return NULL; } const char *localeCode = locale.getName(); char name[ULOC_FULLNAME_CAPACITY]; char parentName[ULOC_FULLNAME_CAPACITY]; if (uprv_strlen(localeCode) < ULOC_FULLNAME_CAPACITY) { uprv_strcpy(name, localeCode); // Treat empty string as root. if (*name == '/0') { uprv_strcpy(name, "root"); } } else { errorCode = U_BUFFER_OVERFLOW_ERROR; return NULL; } int32_t ruleSetNum = 0; // NB there is no rule set 0 and 0 is returned upon lookup failure. while (*name != '/0') { ruleSetNum = uhash_geti(data->localeToRuleSetNumMap, name); if (ruleSetNum == 0) { // name and parentName can't be the same pointer, so fill in parent then copy to child. uloc_getParent(name, parentName, ULOC_FULLNAME_CAPACITY, &errorCode); if (*parentName == '/0') { // Saves a lookup in the hash table. break; } uprv_strcpy(name, parentName); } else { break; } } if (ruleSetNum <= 0 || data->rules[ruleSetNum].getDayPeriodForHour(0) == DAYPERIOD_UNKNOWN) { // If day period for hour 0 is UNKNOWN then day period for all hours are UNKNOWN. // Data doesn't exist even with fallback. return NULL; } else { return &data->rules[ruleSetNum]; }}
开发者ID:DavidCai1993,项目名称:node,代码行数:47,
示例17: uspoof_openU_CAPI USpoofChecker * U_EXPORT2uspoof_open(UErrorCode *status) { umtx_initOnce(gSpoofInitStaticsOnce, &initializeStatics, *status); if (U_FAILURE(*status)) { return NULL; } SpoofImpl *si = new SpoofImpl(*status); if (si == NULL) { *status = U_MEMORY_ALLOCATION_ERROR; return NULL; } if (U_FAILURE(*status)) { delete si; return NULL; } return si->asUSpoofChecker();}
开发者ID:basti1302,项目名称:node,代码行数:17,
示例18: uspoof_openFromSerializedU_CAPI USpoofChecker * U_EXPORT2uspoof_openFromSerialized(const void *data, int32_t length, int32_t *pActualLength, UErrorCode *status) { if (U_FAILURE(*status)) { return NULL; } if (data == NULL) { *status = U_ILLEGAL_ARGUMENT_ERROR; return NULL; } umtx_initOnce(gSpoofInitStaticsOnce, &initializeStatics, *status); if (U_FAILURE(*status)) { return NULL; } SpoofData *sd = new SpoofData(data, length, *status); if (sd == NULL) { *status = U_MEMORY_ALLOCATION_ERROR; return NULL; } if (U_FAILURE(*status)) { delete sd; return NULL; } SpoofImpl *si = new SpoofImpl(sd, *status); if (si == NULL) { *status = U_MEMORY_ALLOCATION_ERROR; delete sd; // explicit delete as the destructor for si won't be called. return NULL; } if (U_FAILURE(*status)) { delete si; // no delete for sd, as the si destructor will delete it. return NULL; } if (pActualLength != NULL) { *pActualLength = sd->size(); } return si->asUSpoofChecker();}
开发者ID:basti1302,项目名称:node,代码行数:46,
示例19: umtx_initOnceconst UnicodeSet *DecimalFormatStaticSets::getSimilarDecimals(UChar32 decimal, UBool strictParse){ UErrorCode status = U_ZERO_ERROR; umtx_initOnce(gStaticSetsInitOnce, initSets, status); if (U_FAILURE(status)) { return NULL; } if (gStaticSets->fDotEquivalents->contains(decimal)) { return strictParse ? gStaticSets->fStrictDotEquivalents : gStaticSets->fDotEquivalents; } if (gStaticSets->fCommaEquivalents->contains(decimal)) { return strictParse ? gStaticSets->fStrictCommaEquivalents : gStaticSets->fCommaEquivalents; } // if there is no match, return NULL return NULL;}
开发者ID:MIPS,项目名称:external-icu,代码行数:19,
示例20: umtx_initOnceU_CDECL_ENDdoubleDigitList::decimalStrToDouble(char *decstr, char **end) { umtx_initOnce(gCLocaleInitOnce, &initCLocale);#if U_USE_STRTOD_L return strtod_l(decstr, end, gCLocale);#else char *decimalPt = strchr(decstr, '.'); if (decimalPt) { // We need to know the decimal separator character that will be used with strtod(). // Depends on the C runtime global locale. // Most commonly is '.' char rep[MAX_DIGITS]; sprintf(rep, "%+1.1f", 1.0); *decimalPt = rep[2]; } return uprv_strtod(decstr, end);#endif}
开发者ID:TestOrgPleaseIgnore,项目名称:node,代码行数:20,
示例21: fIdentifierU_CDECL_ENDIdentifierInfo::IdentifierInfo(UErrorCode &status): fIdentifier(NULL), fRequiredScripts(NULL), fScriptSetSet(NULL), fCommonAmongAlternates(NULL), fNumerics(NULL), fIdentifierProfile(NULL) { umtx_initOnce(gIdentifierInfoInitOnce, &IdentifierInfo_init, status); if (U_FAILURE(status)) { return; } fIdentifier = new UnicodeString(); fRequiredScripts = new ScriptSet(); fScriptSetSet = uhash_open(uhash_hashScriptSet, uhash_compareScriptSet, NULL, &status); uhash_setKeyDeleter(fScriptSetSet, uhash_deleteScriptSet); fCommonAmongAlternates = new ScriptSet(); fNumerics = new UnicodeSet(); fIdentifierProfile = new UnicodeSet(0, 0x10FFFF); if (U_SUCCESS(status) && (fIdentifier == NULL || fRequiredScripts == NULL || fScriptSetSet == NULL || fCommonAmongAlternates == NULL || fNumerics == NULL || fIdentifierProfile == NULL)) { status = U_MEMORY_ALLOCATION_ERROR; }}
开发者ID:icu-project,项目名称:icu4c,代码行数:24,
注:本文中的umtx_initOnce函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ umtx_lock函数代码示例 C++ umove_or_printaddr函数代码示例 |