GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4UserException.cxx
Go to the documentation of this file.
1 // $Id: TGo4UserException.cxx 2742 2020-04-16 07:35:11Z linev $
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 
22  fxMessage(),
23  fiPriority(0)
24 {
25 }
26 
27 TGo4UserException::TGo4UserException (Int_t prio, const char* text,...) :
29  fxMessage(),
30  fiPriority(prio)
31 {
32  GO4TRACE((14,"TGo4UserException:TGo4UserException (TGo4TaskHandler*)", __LINE__, __FILE__));
33  fxDescription= "!!!-- Go4 User Exception --!!!";
34  // put potential printf arguments in text:
35  char txtbuf[TGo4Log::fguMESLEN];
36  va_list args;
37  va_start(args, text);
38  vsnprintf(txtbuf, TGo4Log::fguMESLEN, text, args);
39  va_end(args);
40  fxMessage = txtbuf;
41 }
42 
44 {
45  GO4TRACE((14,"TGo4UserException:~TGo4UserException", __LINE__, __FILE__));
46 }
47 
49 {
50  GO4TRACE((14,"TGo4UserException:operator=",__LINE__, __FILE__));
51  if (&right!=this)
52  {
53  TGo4RuntimeException::operator=(right); // copy base class members
54  // put additional member copies here...
55  fxMessage=right.fxMessage;
56  fiPriority=right.fiPriority;
57  return *this;
58  }
59  else
60  {
61  // copy is already source object
62  return *this;
63  }
64 }
65 
67  :TGo4RuntimeException(right)
68 {
69  GO4TRACE((14,"TGo4UserException:TGo4UserException(right)", __LINE__, __FILE__));
70  fxMessage=right.fxMessage;
71  fiPriority=right.fiPriority;
72 }
73 
75 {
76  GO4TRACE((12,"TGo4UserException::Handle()", __LINE__, __FILE__));
78 
79  return 0;
80 }
TGo4UserException & operator=(const TGo4UserException &right)
Int_t GetPriority() const
static const char * Message(Int_t prio, const char *text,...)
Definition: TGo4Log.cxx:207
TGo4RuntimeException & operator=(const TGo4RuntimeException &right)
#define GO4TRACE(X)
Definition: TGo4Log.h:26
TString fxDescription
Definition: TGo4Exception.h:38
const char * GetMessage() const