当前位置: 首页>>代码示例>>C++>>正文


C++ CSafeStatic::Get方法代码示例

本文整理汇总了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;
}
开发者ID:swuecho,项目名称:igblast,代码行数:8,代码来源:serial.cpp

示例2: TConstUidIterator

CEntrez2_id_list::TConstUidIterator
CEntrez2_id_list::GetConstUidIterator() const
{
    if (CanGetUids()) {
        return TConstUidIterator(GetUids(), kUidSize);
    } else {
        return TConstUidIterator(s_EmptyList.Get(), kUidSize);
    }
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:9,代码来源:Entrez2_id_list.cpp

示例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();
}
开发者ID:swuecho,项目名称:igblast,代码行数:22,代码来源:dbapi_object_convert.cpp

示例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())
{
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:15,代码来源:objostr.cpp

示例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();
}
开发者ID:DmitrySigaev,项目名称:ncbi,代码行数:36,代码来源:request_ctx.cpp

示例6: s_GetDiagHandler

static int s_GetDiagHandler(void)
{
    static CSafeStatic<NCBI_PARAM_TYPE(VDB, DIAG_HANDLER)> s_Value;
    return s_Value->Get();
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:5,代码来源:vdbread.cpp

示例7: x_GetFixCharsMethodDefault

EFixNonPrint CObjectOStream::x_GetFixCharsMethodDefault(void) const
{
    static CSafeStatic<TSerialFixChars> s_SerialFixChars;
    return s_SerialFixChars->Get();
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:5,代码来源:objostr.cpp


注:本文中的CSafeStatic::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。