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()
Generated on Mon May 6 2013 04:04:10 for CLHEP by
1.8.1.2