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


C++ Messenger::fail方法代码示例

本文整理汇总了C++中Messenger::fail方法的典型用法代码示例。如果您正苦于以下问题:C++ Messenger::fail方法的具体用法?C++ Messenger::fail怎么用?C++ Messenger::fail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Messenger的用法示例。


在下文中一共展示了Messenger::fail方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Init

void DetectorDriver::Init(RawEvent& rawev) {
    for (vector<TraceAnalyzer *>::iterator it = vecAnalyzer.begin();
	 it != vecAnalyzer.end(); it++) {
        (*it)->Init();
        (*it)->SetLevel(20);
    }

    for (vector<EventProcessor *>::iterator it = vecProcess.begin();
         it != vecProcess.end(); it++) {
        (*it)->Init(rawev);
    }

    try {
        ReadCalXml();
        ReadWalkXml();
    } catch (GeneralException &e) {
        //! Any exception in reading calibration and walk correction
        //! will be intercepted here
        cout << endl;
        cout << "Exception caught at DetectorDriver::Init" << endl;
        cout << "\t" << e.what() << endl;
        Messenger m;
        m.fail();
        exit(EXIT_FAILURE);
    } catch (GeneralWarning &w) {
        cout << "Warning caught at DetectorDriver::Init" << endl;
        cout << "\t" << w.what() << endl;
    }
}
开发者ID:akeeler,项目名称:pixie_scan,代码行数:29,代码来源:DetectorDriver.cpp

示例2: histo

DetectorDriver::DetectorDriver() : histo(OFFSET, RANGE, "DetectorDriver") {
    Messenger m;
    try {
        m.start("Loading Processors");
        LoadProcessors(m);
    } catch (GeneralException &e) {
        /// Any exception in registering plots in Processors
        /// and possible other exceptions in creating Processors
        /// will be intercepted here
        m.fail();
        cout << "Exception caught at DetectorDriver::DetectorDriver" << endl;
        cout << "\t" << e.what() << endl;
        exit(EXIT_FAILURE);
    } catch (GeneralWarning &w) {
        cout << "Warning found at DetectorDriver::DetectorDriver" << endl;
        cout << "\t" << w.what() << endl;
    }
    m.done();
}
开发者ID:akeeler,项目名称:pixie_scan,代码行数:19,代码来源:DetectorDriver.cpp

示例3: buildTree

void TreeCorrelator::buildTree() {
    pugi::xml_document doc;

    Messenger m;
    m.start("Creating TreeCorrelator");
    pugi::xml_parse_result result = doc.load_file("Config.xml");
    if (!result) {
        stringstream ss;
        ss << "DetectorDriver: error parsing file Config.xml";
        ss << " : " << result.description();
        m.fail();
        throw IOException(ss.str());
    }

    pugi::xml_node tree = doc.child("Configuration").child("TreeCorrelator");
    bool verbose = tree.attribute("verbose").as_bool(false);

    Walker walker;
    walker.traverseTree(tree, string(tree.attribute("name").value()), verbose);

    m.done();
}
开发者ID:akeeler,项目名称:pixie_scan,代码行数:22,代码来源:TreeCorrelator.cpp

示例4: if

extern "C" void hissub_(unsigned short *ibuf[],unsigned short *nhw)
#endif
{
    static float hz = sysconf(_SC_CLK_TCK); // get the number of clock ticks per second
    static clock_t clockBegin; // initialization time
    static struct tms tmsBegin;

    vector<ChanEvent*> eventList; // vector to hold the events

    /* Pointer to singleton DetectorLibrary class */
    DetectorLibrary* modChan = DetectorLibrary::get();
    /* Pointer to singleton DetectorDriver class */
    DetectorDriver* driver = DetectorDriver::get();
    /* Screen messenger */
    Messenger messenger;
    stringstream ss;

    // local version of ibuf pointer
    word_t *lbuf;

    int retval = 0; // return value from various functions

    unsigned long bufLen;

    /*
      Various event counters
    */
    unsigned long numEvents = 0;
    static int counter = 0; // the number of times this function is called
    static int evCount;     // the number of times data is passed to ScanList
    static unsigned int lastVsn; // the last vsn read from the data
    time_t theTime = 0;

    /*
      Assign the local variable lbuf to the variable ibuf which is passed into
      the routine.  The difference between the new and old pixie16 readouts is
      the type of the variable and source of the variable ibuf.

      In the new readout ibuf is from a C++ function and is of type unsigned int*
      In the old readout ibuf is from a Fortran function and is of type
      unsigned short*

      This results in two different assignment statements depending on
      the readout.
    */
#ifdef newreadout
    lbuf=(word_t *)ibuf[0];
#else
    lbuf=(word_t *)ibuf; //old readout
#endif

    /* Initialize the scan program before the first event */
    if (counter==0) {
        /* Retrieve the current time for use later to determine the total
        * running time of the analysis.
        */
        messenger.start("Initializing scan");

        string revision = Globals::get()->revision();
        // Initialize function pointer to point to
        // correct version of ReadBuffData
        if (revision == "D" || revision == "F")
            ReadBuffData = ReadBuffDataDF;
        else if (revision == "A")
            ReadBuffData = ReadBuffDataA;

        clockBegin = times(&tmsBegin);

        ss << "First buffer at " << clockBegin << " sys time";
        messenger.detail(ss.str());
        ss.str("");

        /* After completion the descriptions of all channels are in the modChan
        * vector, the DetectorDriver and rawevent have been initialized with the
        * detectors that will be used in this analysis.
        */
        modChan->PrintUsedDetectors(rawev);
        driver->Init(rawev);

        /* Make a last check to see that everything is in order for the driver
        * before processing data. SanityCheck function throws exception if
        * something went wrong.
        */
        try {
            driver->SanityCheck();
        } catch (GeneralException &e) {
            messenger.fail();
            cout << "Exception caught while checking DetectorDriver"
                 << " sanity in PixieStd" << endl;
            cout << "\t" << e.what() << endl;
            exit(EXIT_FAILURE);
        } catch (GeneralWarning &w) {
            cout << "Warning caught during checking DetectorDriver"
                 << " at PixieStd" << endl;
            cout << "\t" << w.what() << endl;
        }

        lastVsn=-1; // set last vsn to -1 so we expect vsn 0 first

        ss << "Init at " << times(&tmsBegin) << " sys time.";
//.........这里部分代码省略.........
开发者ID:kmiernik,项目名称:pixie_scan,代码行数:101,代码来源:PixieStd.cpp


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