CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
Exceptions
test
exctest4.cc
Go to the documentation of this file.
1
#include <iostream>
2
using
std::cerr;
3
using
std::endl;
4
5
6
#include "
CLHEP/Exceptions/ZMexception.h
"
7
#include "
CLHEP/Exceptions/ZMthrow.h
"
8
using namespace
zmex;
9
10
11
ZMexStandardDefinition
(
ZMexception
,
Oops
);
12
ZMexClassInfo
Oops::_classInfo(
"Oops"
,
"exctest4"
,
ZMexERROR
13
,
ZMexHandler
(
ZMexThrowAlways
() )
14
,
ZMexLogger
(
ZMexLogNever
() )
15
);
16
17
18
int
main
() {
19
20
cerr <<
"Starting main() ..."
<< endl;
21
22
#ifndef DEFECT_NO_EXCEPTIONS
23
try
{
24
#endif
25
//cerr << "About to: Oops::setHandler( ZMexHandler( ZMexIgnoreAlways() ) );
26
//Oops::setHandler( ZMexHandler( ZMexIgnoreAlways() ) );
27
28
cerr <<
"About to: ZMthrow( Oops(\"Ouch\") )"
<< endl;
29
ZMthrow
(
Oops
(
"Ouch"
) );
30
// unreachable statement:
31
cerr <<
"Got past: ZMthrow( Oops(\"Ouch\") ) -- not good!"
<< endl;
32
#ifndef DEFECT_NO_EXCEPTIONS
33
}
34
catch
(
const
Oops
egad ) {
35
cerr <<
"Caught: Oops"
<< endl;
36
}
37
catch
(
const
ZMexception
egad ) {
38
cerr <<
"Caught: ZMexception"
<< endl;
39
}
40
catch
( ... ) {
41
cerr <<
"Caught: don't know what"
<< endl;
42
}
43
#endif
44
45
cerr <<
"Done."
<< endl;
46
return
0;
47
48
}
// main()
Oops
Definition:
exctest2.cc:14
ZMexStandardDefinition
ZMexStandardDefinition(ZMexception, Oops)
main
int main()
Definition:
exctest4.cc:18
zmex::ZMexThrowAlways
Definition:
CLHEP/Exceptions/ZMexHandler.h:132
zmex::ZMexHandler
Definition:
CLHEP/Exceptions/ZMexHandler.h:96
ZMexception.h
zmex::ZMexClassInfo
Definition:
CLHEP/Exceptions/ZMexClassInfo.h:94
zmex::ZMexERROR
Definition:
CLHEP/Exceptions/ZMexSeverity.h:46
ZMthrow
#define ZMthrow(userExcept)
Definition:
CLHEP/Exceptions/ZMthrow.h:97
zmex::ZMexLogNever
Definition:
CLHEP/Exceptions/ZMexLogger.h:100
zmex::ZMexLogger
Definition:
CLHEP/Exceptions/ZMexLogger.h:256
ZMthrow.h
zmex::ZMexception
Definition:
CLHEP/Exceptions/ZMexception.h:163
Generated on Sat Apr 26 2014 07:58:33 for CLHEP by
1.8.6