本文整理汇总了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;
}
}
示例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();
}
示例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();
}
示例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.";
//.........这里部分代码省略.........