CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
ZMexHandler.icc
Go to the documentation of this file.
1#ifndef ZMEXHANDLER_ICC
2#error "Exceptions/ZMexHandler.icc included without Exceptions/ZMexHandler.h"
3#endif
4
5
6// ----------------------------------------------------------------------
7//
8// ZMexHandler.icc -- inline implementations for the standard handlers.
9//
10//
11// The following methods are defined here:
12// takeCareOf() and clone() for each provided handler:
13// ZMexThrowAlways ::takeCareOf() and ::clone()
14// ZMexIgnoreAlways ::takeCareOf() and ::clone()
15// ZMexIgnoreNextN ::takeCareOf() and ::clone()
16// ZMexThrowErrors and ::clone()
17// ZMexParentHandler::takeCareOf() and ::clone()
18//
19// Other implementations are in ZMexHandler.cc
20//
21// Revision History:
22// 970910 MF Initial version
23// 970917 WEB Updated per code review 2
24// 980617 WEB Added namespace support
25//
26// ----------------------------------------------------------------------
27
28
29namespace zmex {
30
31
32//*******************************************
33//
34// takeCareOf() for various standard exceptions
35//
36// This operator provides the handler's functionality; in general, it must:
37// record the handler's name
38// obtain (via x.OKtoLog() ) permission, from the exception, to log;
39// if granted, invoke the exception's logger (via x.logMe() )
40// decide on an action
41// record (via x.wasThrown() ) the determined action
42// return the determined action
43//
44//*******************************************
45
46
47
48//******************************
49//
50// ZMexThrowAlways::takeCareOf()
51//
52//******************************
53
55 //DEBUG cerr << "ThrowAlways::takeCareOf" << endl;
56 return standardHandling( x, true );
57}
58
59
60//*******************************
61//
62// ZMexIgnoreAlways::takeCareOf()
63//
64//*******************************
65
67 //DEBUG cerr << "IgnoreAlways::takeCareOf" << endl;
68 return standardHandling( x, false );
69}
70
71
72
73//******************************
74//
75// ZMexIgnoreNextN::takeCareOf()
76//
77//******************************
78
80
81 return standardHandling( x, ( countDown_ <= 0 ) ? true
82 : (--countDown_, false)
83 );
84}
85
86
87//********************************
88//
89// ZMexParentHandler::takeCareOf()
90//
91//********************************
92
94 //DEBUG cerr << "HandleViaParent::takeCareOf" << endl;
96}
97
98
99//*******************************************
100//
101// clone() for various standard exceptions
102//
103//*******************************************
104
105
106
107//*************************
108//
109// ZMexThrowAlways::clone()
110//
111//*************************
112
114
115 return new ZMexThrowAlways( *this );
116}
117
118
119//**************************
120//
121// ZMexIgnoreAlways::clone()
122//
123//**************************
124
126
127 return new ZMexIgnoreAlways( *this );
128}
129
130
131
132//**************************
133//
134// ZMexThrowErrors::clone()
135//
136//**************************
137
139
140 return new ZMexThrowErrors( *this );
141}
142
143
144//*************************
145//
146// ZMexIgnoreNextN::clone()
147//
148//*************************
149
151
152 return new ZMexIgnoreNextN( *this );
153}
154
155
156//***************************
157//
158// ZMexParentHandler::clone()
159//
160//***************************
161
163
164 return new ZMexHandleViaParent( *this );
165}
166
167
168} // namespace zmex
virtual ZMexHandleViaParent * clone() const
virtual ZMexAction takeCareOf(const ZMexception &x)
ZMexAction standardHandling(const ZMexception &x, bool willThrow)
virtual ZMexAction takeCareOf(const ZMexception &x)
virtual ZMexIgnoreAlways * clone() const
virtual ZMexIgnoreNextN * clone() const
virtual ZMexAction takeCareOf(const ZMexception &x)
virtual ZMexAction takeCareOf(const ZMexception &x)
virtual ZMexThrowAlways * clone() const
virtual ZMexThrowErrors * clone() const
Definition ZMerrno.h:52
ZMexAction
Definition ZMexAction.h:20
@ ZMexHANDLEVIAPARENT
Definition ZMexAction.h:20