本文整理汇总了C++中CSafeStatic::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ CSafeStatic::Get方法的具体用法?C++ CSafeStatic::Get怎么用?C++ CSafeStatic::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSafeStatic
的用法示例。
在下文中一共展示了CSafeStatic::Get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GUARD
static const string& GetModuleName(const char* moduleName)
{
CFastMutexGuard GUARD(s_ModuleNameMutex);
static CSafeStatic< set<string> > s_ModuleNames;
const string& s = *s_ModuleNames.Get().insert(moduleName).first;
CClassTypeInfoBase::RegisterModule(s);
return s;
}
示例2: TConstUidIterator
CEntrez2_id_list::TConstUidIterator
CEntrez2_id_list::GetConstUidIterator() const
{
if (CanGetUids()) {
return TConstUidIterator(GetUids(), kUidSize);
} else {
return TConstUidIterator(s_EmptyList.Get(), kUidSize);
}
}
示例3: CheckType
CValueConvert<SSafeSqlCP, CDB_Object>::operator const CTime&(void) const
{
static CSafeStatic<CTime> value;
if (m_Value.IsNULL()) {
return value.Get();
}
CheckType(m_Value, eDB_SmallDateTime, eDB_DateTime);
EDB_Type cur_type = m_Value.GetType();
if (cur_type == eDB_SmallDateTime) {
return static_cast<const CDB_SmallDateTime&>(m_Value).Value();
} else if (cur_type == eDB_DateTime) {
return static_cast<const CDB_DateTime&>(m_Value).Value();
} else {
ReportTypeConvError(cur_type, "CTime");
}
return value.Get();
}
示例4:
CObjectOStream::CObjectOStream(ESerialDataFormat format,
CNcbiOstream& out, EOwnership edeleteOut)
: m_Output(out, edeleteOut == eTakeOwnership), m_Fail(fNoError), m_Flags(fFlagNone),
m_Separator(""),
m_DataFormat(format),
m_ParseDelayBuffers(eDelayBufferPolicyNotSet),
m_SpecialCaseWrite(eWriteAsNormal),
m_AutoSeparator(false),
m_WriteNamedIntegersByValue(false),
m_FastWriteDouble(s_FastWriteDouble->Get()),
m_EnforceWritingDefaults(false),
m_FixMethod(x_GetFixCharsMethodDefault()),
m_VerifyData(x_GetVerifyDataDefault())
{
}
示例5: SetHitID
void CRequestContext::SetHitID(const string& hit)
{
if ( m_LoggedHitID ) {
// Show warning when changing hit id after is has been logged.
ERR_POST_X(28, Warning << "Changing hit ID after one has been logged. "
"New hit id is: " << hit);
}
static CSafeStatic<TOnBadHitId> action;
if ( !IsValidHitID(hit) ) {
switch ( action->Get() ) {
case eOnBadPHID_Ignore:
return;
case eOnBadPHID_AllowAndReport:
// Use Warning if bad hit id is acceptable.
ERR_POST_X(27, Warning << "Bad hit ID format: " << hit);
break;
case eOnBadPHID_IgnoreAndReport:
ERR_POST_X(27, "Bad hit ID format: " << hit);
return;
case eOnBadPHID_Throw:
NCBI_THROW(CRequestContextException, eBadHit,
"Bad hit ID format: " + hit);
break;
case eOnBadPHID_Allow:
break;
}
}
x_SetProp(eProp_HitID);
if (m_HitID != hit) {
m_SubHitID = 0;
m_SubHitIDCache.clear();
}
m_HitID = hit;
m_LoggedHitID = false;
x_LogHitID();
}
示例6: s_GetDiagHandler
static int s_GetDiagHandler(void)
{
static CSafeStatic<NCBI_PARAM_TYPE(VDB, DIAG_HANDLER)> s_Value;
return s_Value->Get();
}
示例7: x_GetFixCharsMethodDefault
EFixNonPrint CObjectOStream::x_GetFixCharsMethodDefault(void) const
{
static CSafeStatic<TSerialFixChars> s_SerialFixChars;
return s_SerialFixChars->Get();
}