Ejemplo n.º 1
0
CConn_Streambuf::CConn_Streambuf(CONNECTOR                   connector,
                                 EIO_Status                  status,
                                 const STimeout*             timeout,
                                 size_t                      buf_size,
                                 CConn_IOStream::TConn_Flags flags,
                                 CT_CHAR_TYPE*               ptr,
                                 size_t                      size)
    : m_Conn(0), m_WriteBuf(0), m_ReadBuf(&x_Buf), m_BufSize(1),
      m_Status(status), m_Tie(false), m_Close(true), m_CbValid(false),
      x_Buf(), x_GPos((CT_OFF_TYPE)(ptr ? size : 0)), x_PPos((CT_OFF_TYPE)size)
{
    if (!connector) {
        if (m_Status == eIO_Success)
            m_Status  = eIO_InvalidArg;
        ERR_POST_X(2, x_Message("CConn_Streambuf():  NULL connector"));
        return;
    }
    if ((flags & (CConn_IOStream::fConn_Untie |
                  CConn_IOStream::fConn_WriteBuffered))
        == CConn_IOStream::fConn_WriteBuffered  &&  buf_size) {
        m_Tie = true;
    }
    if ((m_Status = CONN_CreateEx(connector, fCONN_Supplement
                                  | (m_Tie ? 0 : fCONN_Untie), &m_Conn))
        != eIO_Success) {
        ERR_POST_X(3, x_Message("CConn_Streambuf():  CONN_Create() failed"));
        _ASSERT(!connector->meta  &&  !connector->next);
        if (connector->destroy)
            connector->destroy(connector);
        return;
    }
    _ASSERT(m_Conn);
    x_Init(timeout, buf_size, flags, ptr, size);
}
Ejemplo n.º 2
0
CInvalidChoiceSelection::CInvalidChoiceSelection(
    const CDiagCompileInfo& diag_info,
    const CSerialObject* object,
    size_t currentIndex, size_t mustBeIndex,
    const char* const names[], size_t namesCount, 
    EDiagSev severity)
        : CSerialException(diag_info, 0,
          (CSerialException::EErrCode) CException::eInvalid,"")
{
    CNcbiOstrstream msg;
    const CChoiceTypeInfo* type = 0;
    if ( object ) {
        type = dynamic_cast<const CChoiceTypeInfo*>(object->GetThisTypeInfo());
    }
    const char* cur_name = GetName(currentIndex, names, namesCount);
    const char* req_name = GetName(mustBeIndex, names, namesCount);
    if ( type ) {
        msg << "C" << SPrintIdentifier(type->GetAccessName())
            << "::Get" << SPrintIdentifier(req_name) << "()";
        msg << ": Invalid choice selection: "
            << type->GetAccessModuleName() <<"::"<< type->GetAccessName()
            << '.' << cur_name;
    }
    else {
        msg << "Invalid choice selection: "
            << cur_name << ". Expected: " << req_name;
    }
    x_Init(diag_info, CNcbiOstrstreamToString(msg), 0, severity);
    x_InitErrCode((CException::EErrCode)(CInvalidChoiceSelection::eFail));
}
Ejemplo n.º 3
0
CTrackMgrClient::CTrackMgrClient(const string& host, unsigned int port)
    : m_HostType(eHost_port),
      m_Host(host),
      m_Port(port)
{
    SetFormat(eSerial_AsnBinary);
    x_Init();
}
Ejemplo n.º 4
0
 CGridRPCBaseClient(const string& NS_service,
                    const string& NS_queue,
                    const string& client_name,
                    const string& NC_registry_section
                   )
     : m_NS_api(NS_service, client_name, NS_queue),
       m_Timeout(DefaultTimeout)
 {
     x_Init(NC_registry_section);
 }
Ejemplo n.º 5
0
CSraMgr::CSraMgr(const string& rep_path, const string& vol_path,
                 ETrim trim)
    : m_Path(null),
      m_Trim(trim == eTrim)
{
    if ( !rep_path.empty() || !vol_path.empty() ) {
        m_Path = CSraPath(rep_path, vol_path);
    }
    x_Init();
}
Ejemplo n.º 6
0
CBlastPrelimSearch::CBlastPrelimSearch(CRef<IQueryFactory> query_factory,
                                       CRef<CBlastOptions> options,
                                       CRef<CLocalDbAdapter> db)
    : m_QueryFactory(query_factory), m_InternalData(new SInternalData),
    m_Options(options), m_DbAdapter(db), m_DbInfo(NULL)
{
    BlastSeqSrc* seqsrc = db->MakeSeqSrc();
    x_Init(query_factory, options, CRef<CPssmWithParameters>(), seqsrc);
    m_InternalData->m_SeqSrc.Reset(new TBlastSeqSrc(seqsrc, 0));
}
Ejemplo n.º 7
0
CBlastPrelimSearch::CBlastPrelimSearch(CRef<IQueryFactory> query_factory,
                               CRef<CBlastOptions> options,
                               BlastSeqSrc* seqsrc,
                               CConstRef<objects::CPssmWithParameters> pssm)
    : m_QueryFactory(query_factory), m_InternalData(new SInternalData),
    m_Options(options),  m_DbAdapter(NULL), m_DbInfo(NULL)
{
    x_Init(query_factory, options, pssm, seqsrc);
    m_InternalData->m_SeqSrc.Reset(new TBlastSeqSrc(seqsrc, 0));
}
Ejemplo n.º 8
0
CGumbelParamsOptions::CGumbelParamsOptions(
                                   const CGeneralScoreMatrix* matrix,
                                   const vector<double>& seq1_probs,
                                   const vector<double>& seq2_probs)
{
    x_Init();
    m_ScoreMatrix.Reset(matrix);
    m_NumResidues = (*m_ScoreMatrix).GetNumResidues();
    m_Seq1ResidueProbs = seq1_probs;
    m_Seq2ResidueProbs = seq2_probs;
}
Ejemplo n.º 9
0
BEGIN_NCBI_SCOPE
BEGIN_objects_SCOPE


CTrackMgrClient::CTrackMgrClient(const string& service)
    : m_HostType(eNamed_service)
{
    SetService(service);
    SetFormat(eSerial_AsnBinary);
    x_Init();
}
Ejemplo n.º 10
0
CBlastPrelimSearch::CBlastPrelimSearch(CRef<IQueryFactory> query_factory,
                                       CRef<CBlastOptions> options,
                                       const CSearchDatabase& dbinfo)
    : m_QueryFactory(query_factory), m_InternalData(new SInternalData),
    m_Options(options), m_DbAdapter(NULL), m_DbInfo(&dbinfo)
{
    BlastSeqSrc* seqsrc = CSetupFactory::CreateBlastSeqSrc(dbinfo);
    x_Init(query_factory, options, CRef<CPssmWithParameters>(), seqsrc);

    m_InternalData->m_SeqSrc.Reset(new TBlastSeqSrc(seqsrc, BlastSeqSrcFree));
}
Ejemplo n.º 11
0
void CException::AddBacklog(const CDiagCompileInfo& info,
                            const string& message,
                            EDiagSev severity)
{
    const CException* prev = m_Predecessor;
    m_Predecessor = x_Clone();
    if (prev) {
        delete prev;
    }
    x_Init(info, message, 0, severity);
    m_MainText = false;
}
Ejemplo n.º 12
0
CInvalidChoiceSelection::CInvalidChoiceSelection(
    size_t currentIndex, size_t mustBeIndex,
    const char* const names[], size_t namesCount,
    EDiagSev severity)
        : CSerialException(CDiagCompileInfo("unknown", 0), 0,
          (CSerialException::EErrCode) CException::eInvalid,"")
{
    x_Init(CDiagCompileInfo("unknown", 0),
           string("Invalid choice selection: ")+
           GetName(currentIndex, names, namesCount)+". "
           "Expected: "+
           GetName(mustBeIndex, names, namesCount),0, severity);
    x_InitErrCode((CException::EErrCode)(CInvalidChoiceSelection::eFail));
}
Ejemplo n.º 13
0
 CGridRPCBaseClient(const string& NS_registry_section = "netschedule_api",
                    const string& NC_registry_section = kEmptyStr
                   )
     : m_NS_api(CNetScheduleAPI::eAppRegistry, NS_registry_section),
       m_Timeout(DefaultTimeout)
 {
     LOG_POST(Trace << "NS: " << NS_registry_section);
     static const CNcbiRegistry& cfg = CNcbiApplication::Instance()->GetConfig();
     const string nc_reg(
         NStr::IsBlank(NC_registry_section)
             ? cfg.GetString(NS_registry_section, "netcache_api", "netcache_api")
             : NC_registry_section
     );
     x_Init(nc_reg);
 }
Ejemplo n.º 14
0
CException::CException(const CDiagCompileInfo& info,
                       const CException* prev_exception,
                       EErrCode err_code,
                       const string& message,
                       EDiagSev severity,
                       TFlags flags)
: m_Severity(severity),
  m_ErrCode(err_code),
  m_Predecessor(0),
  m_InReporter(false),
  m_MainText(true),
  m_Flags(0)
{
    if (CompareDiagPostLevel(severity, eDiag_Critical) >= 0  &&
        s_AbortIfCritical.Get()) {
        abort();
    }
    x_Init(info, message, prev_exception, severity);
    if (prev_exception)
        prev_exception->m_MainText = false;
}
Ejemplo n.º 15
0
CException::CException(const CDiagCompileInfo& info,
                       const CException* prev_exception,
                       const CExceptionArgs<EErrCode>& args,
                       const string& message)
: m_Severity(args.GetSeverity()),
  m_ErrCode(args.GetErrCode()),
  m_Predecessor(0),
  m_InReporter(false),
  m_MainText(true),
  m_Flags(args.GetFlags())
{
    if (CompareDiagPostLevel(m_Severity, eDiag_Critical) >= 0  &&
        s_AbortIfCritical.Get()) {
        abort();
    }
    x_Init(info, message, prev_exception, m_Severity);
    x_InitArgs(args);

    if (prev_exception)
        prev_exception->m_MainText = false;
}
Ejemplo n.º 16
0
CConn_Streambuf::CConn_Streambuf(CONN                        conn,
                                 bool                        close,
                                 const STimeout*             timeout,
                                 size_t                      buf_size,
                                 CConn_IOStream::TConn_Flags flags,
                                 CT_CHAR_TYPE*               ptr,
                                 size_t                      size)
    : m_Conn(conn), m_WriteBuf(0), m_ReadBuf(&x_Buf), m_BufSize(1),
      m_Status(eIO_Success), m_Tie(false), m_Close(close), m_CbValid(false),
      x_Buf(), x_GPos((CT_OFF_TYPE)(ptr ? size : 0)), x_PPos((CT_OFF_TYPE)size)
{
    if (!m_Conn) {
        m_Status = eIO_InvalidArg;
        ERR_POST_X(1, x_Message("CConn_Streambuf():  NULL connection"));
        return;
    }
    if ((flags & (CConn_IOStream::fConn_Untie |
                  CConn_IOStream::fConn_WriteBuffered))
        == CConn_IOStream::fConn_WriteBuffered  &&  buf_size) {
        m_Tie = true;
    }
    x_Init(timeout, buf_size, flags, ptr, size);
}
Ejemplo n.º 17
0
CVPath::CVPath(const CVFSManager& mgr, const string& path, EType type)
{
    x_Init(mgr, path, type);
}
 CNcbipnaBase( const CNcbi8naBase& b ) { x_Init( b ); }
Ejemplo n.º 19
0
CSraPath::CSraPath(void)
{
    x_Init();
    AddRepPath(GetDefaultRepPath());
    AddVolPath(GetDefaultVolPath());
}
Ejemplo n.º 20
0
CSraPath::CSraPath(const string& rep_path, const string& vol_path)
{
    x_Init();
    AddRepPath(rep_path.empty()? GetDefaultRepPath(): rep_path);
    AddVolPath(vol_path.empty()? GetDefaultVolPath(): vol_path);
}
Ejemplo n.º 21
0
CSraMgr::CSraMgr(void)
    : m_Path(null),
      m_Trim(false)
{
    x_Init();
}
Ejemplo n.º 22
0
CGumbelParamsOptions::CGumbelParamsOptions(void) 
{
    x_Init();
}
Ejemplo n.º 23
0
CBlastRPSInfo::CBlastRPSInfo(const string& rps_dbname, int flags)
{
    x_Init(rps_dbname, flags);
}
Ejemplo n.º 24
0
CBlastRPSInfo::CBlastRPSInfo(const string& rps_dbname)
{
    x_Init(rps_dbname, fRpsBlast);
}
Ejemplo n.º 25
0
CVPath::CVPath(const string& path, EType type)
{
    x_Init(CVFSManager(CVFSManager::eCreateNew), path, type);
}
Ejemplo n.º 26
0
 CSofaMap() {
     x_Init();
 };
Ejemplo n.º 27
0
CVDBMgr::CVDBMgr(void)
    : m_Resolver(null)
{
    x_Init();
}
Ejemplo n.º 28
0
 /// Constructor which allows the specification of a BLAST database to use
 /// to initialize the BLAST DB data loader, without the option to override
 /// this at runtime via the configuration file
 /// @param dbname name of BLAST database [in]
 /// @param protein_data is this object going to load/read proteins only
 /// [in]
 /// @param options configuration options [in]
 SDataLoaderConfig(const string& dbname, bool protein_data,
                   EConfigOpts options = eDefault)
 {
     x_Init(options, dbname, protein_data);
 }