Example #1
0
int main(int argc, const char* argv[])
{
    int result;

    SetDiagStream(&NcbiCerr); // send all diagnostic messages to cerr
    SetDiagPostLevel(eDiag_Warning);   
    //    SetupCToolkitErrPost(); // reroute C-toolkit err messages to C++ err streams

    SetDiagTrace(eDT_Default);      // trace messages only when DIAG_TRACE env. var. is set
    //#ifdef _DEBUG
    //    SetDiagPostFlag(eDPF_File);
    //    SetDiagPostFlag(eDPF_Line);
    //#else
    UnsetDiagTraceFlag(eDPF_File);
    UnsetDiagTraceFlag(eDPF_Line);
    //#endif

    // C++ object verification
    CSerialObject::SetVerifyDataGlobal(eSerialVerifyData_Always);
    CObjectIStream::SetVerifyDataGlobal(eSerialVerifyData_Always);
    CObjectOStream::SetVerifyDataGlobal(eSerialVerifyData_Always);

    // Execute main application function
    const CTime start(CTime::eCurrent);
    CTime stop;
    CAlignmentRefiner refiner;
    result = refiner.AppMain(argc, argv, 0, eDS_Default, 0);

    //  Timing info
    stop.SetCurrent();
    cout << "\n\n****  Elapsed Time = " << stop.DiffSecond(start) << " sec  ****" << endl << endl;

    return result;
}
Example #2
0
void CTestConnectionHandler::OnOpen(void)
{
    CRandom rng;
    unsigned int delay = m_Server->GetRandomDelay();
    m_AlarmTime.SetCurrent();
    m_AlarmTime.AddTimeSpan(CTimeSpan(delay / 1000,
                                      (delay % 1000) * 1000 * 1000));
    m_State = Delay;
}