CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
Exceptions
test
exctest1.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"
,
"exctest1"
,
ZMexERROR
);
13
14
15
int
main
() {
16
17
cerr <<
"Starting main() ..."
<< endl;
18
19
#ifndef DEFECT_NO_EXCEPTIONS
20
try
{
21
#endif
22
//cerr << "About to: Oops::setHandler( ZMexHandler( ZMexIgnoreAlways() ) );
23
//Oops::setHandler( ZMexHandler( ZMexIgnoreAlways() ) );
24
25
cerr <<
"About to: ZMthrow( Oops(\"Ouch\") )"
<< endl;
26
ZMthrow
(
Oops
(
"Ouch"
) );
27
// unreachable statement:
28
cerr <<
"Got past: ZMthrow( Oops(\"Ouch\") ) -- not good!"
<< endl;
29
#ifndef DEFECT_NO_EXCEPTIONS
30
}
31
catch
(
const
Oops
egad ) {
32
cerr <<
"Caught: Oops"
<< endl;
33
}
34
catch
(
const
ZMexception
egad ) {
35
cerr <<
"Caught: ZMexception"
<< endl;
36
}
37
catch
( ... ) {
38
cerr <<
"Caught: don't know what"
<< endl;
39
}
40
#endif
41
42
cerr <<
"Done."
<< endl;
43
return
0;
44
45
}
// main()
Generated on Sun Jun 17 2012 08:08:26 for CLHEP by
1.8.1.1