GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4UserException.cxx
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
14#include "TGo4UserException.h"
15
16#include <stdarg.h>
17
18#include "TGo4Log.h"
19
20TGo4UserException::TGo4UserException (Int_t prio, const char *text,...) :
22 fxMessage(),
23 fiPriority(prio)
24{
25 GO4TRACE((14,"TGo4UserException:TGo4UserException (TGo4TaskHandler *)", __LINE__, __FILE__));
26 fxDescription = "!!!-- Go4 User Exception --!!!";
27 // put potential printf arguments in text:
28 char txtbuf[TGo4Log::fguMESLEN];
29 va_list args;
30 va_start(args, text);
31 vsnprintf(txtbuf, TGo4Log::fguMESLEN, text, args);
32 va_end(args);
33 fxMessage = txtbuf;
34}
35
37{
38 GO4TRACE((14,"TGo4UserException:~TGo4UserException", __LINE__, __FILE__));
39}
40
42{
43 GO4TRACE((14,"TGo4UserException:operator=",__LINE__, __FILE__));
44 if (&right != this) {
45 TGo4RuntimeException::operator=(right); // copy base class members
46 fxMessage = right.fxMessage;
47 fiPriority = right.fiPriority;
48 }
49 return *this;
50}
51
54{
55 GO4TRACE((14,"TGo4UserException:TGo4UserException(right)", __LINE__, __FILE__));
56 fxMessage = right.fxMessage;
57 fiPriority = right.fiPriority;
58}
59
61{
62 GO4TRACE((12,"TGo4UserException::Handle()", __LINE__, __FILE__));
64
65 return 0;
66}
#define GO4TRACE(X)
Definition TGo4Log.h:25
TString fxDescription
static const char * Message(Int_t prio, const char *text,...) GO4_PRINTF2_ARGS
Display a message.
Definition TGo4Log.cxx:206
@ fguMESLEN
Definition TGo4Log.h:172
TGo4RuntimeException & operator=(const TGo4RuntimeException &right)
TString fxMessage
User defined description of the exception reason.
TGo4UserException(Int_t prio, const char *text,...)
TGo4UserException & operator=(const TGo4UserException &right)
TGo4UserException()=delete
Int_t Handle() override
This is a default handler function for the respective exception type.
Int_t fiPriority
Priority of message.
Int_t GetPriority() const
Message priority.
const char * GetMessage() const
Status message of last Process() call.