DABC (Data Acquisition Backbone Core)
2.9.9
base
src
Exception.cxx
Go to the documentation of this file.
1
// $Id: Exception.cxx 3862 2018-05-11 10:06:18Z linev $
2
3
/************************************************************
4
* The Data Acquisition Backbone Core (DABC) *
5
************************************************************
6
* Copyright (C) 2009 - *
7
* GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
8
* Planckstr. 1, 64291 Darmstadt, Germany *
9
* Contact: http://dabc.gsi.de *
10
************************************************************
11
* This software can be used under the GPL license *
12
* agreements as stated in LICENSE.txt file *
13
* which is part of the distribution. *
14
************************************************************/
15
16
#include "
dabc/Exception.h
"
17
18
#include "
dabc/logging.h
"
19
20
dabc::Exception::Exception
() throw() :
21
std::exception(),
22
fKind(
ex_None
),
23
fWhat(),
24
fItem()
25
{
26
DOUT2
(
"Generic exception"
);
27
}
28
29
dabc::Exception::Exception
(
const
std::string &info,
const
std::string &item)
throw
() :
30
std::exception(),
31
fKind(
ex_Generic
),
32
fWhat(info),
33
fItem(item)
34
{
35
DOUT2
(
"Exception %s from item %s"
, what(), item.c_str());
36
}
37
38
39
dabc::Exception::Exception
(
ExceptionKind
_kind,
const
std::string &info,
const
std::string &item)
throw
() :
40
std::exception(),
41
fKind(_kind),
42
fWhat(info),
43
fItem(item)
44
{
45
DOUT2
(
"Exception %s from item %s"
, what(), item.c_str());
46
}
47
48
49
dabc::Exception::~Exception
() throw()
50
{
51
}
52
53
const
char
*
dabc::Exception::what
()
const
throw()
54
{
55
switch
(kind()) {
56
case
ex_None
:
return
"undefined"
;
57
case
ex_Stop
:
return
"stop"
;
58
case
ex_Timeout
:
return
"timeout"
;
59
case
ex_Input
:
return
"input"
;
60
case
ex_Output
:
return
"output"
;
61
case
ex_Connect
:
return
"connect"
;
62
case
ex_Disconnect
:
return
"disconnect"
;
63
case
ex_Command
:
return
fWhat.c_str();
64
case
ex_Buffer
:
return
fWhat.c_str();
65
case
ex_Pool
:
return
fWhat.c_str();
66
case
ex_Object
:
return
fWhat.c_str();
67
case
ex_Hierarchy
:
return
fWhat.c_str();
68
case
ex_Pointer
:
return
fWhat.c_str();
69
case
ex_Generic
:
return
fWhat.c_str();
70
}
71
72
return
"uncknown"
;
73
}
Exception.h
dabc::Exception::what
virtual const char * what() const
Definition:
Exception.cxx:53
dabc::Exception::~Exception
virtual ~Exception()
Definition:
Exception.cxx:49
dabc::Exception::Exception
Exception()
Definition:
Exception.cxx:20
logging.h
DOUT2
#define DOUT2(args ...)
Definition:
logging.h:170
dabc::ExceptionKind
ExceptionKind
Definition:
Exception.h:27
dabc::ex_Generic
@ ex_Generic
Definition:
Exception.h:41
dabc::ex_Connect
@ ex_Connect
Definition:
Exception.h:33
dabc::ex_Pool
@ ex_Pool
Definition:
Exception.h:37
dabc::ex_Stop
@ ex_Stop
Definition:
Exception.h:29
dabc::ex_Input
@ ex_Input
Definition:
Exception.h:31
dabc::ex_Output
@ ex_Output
Definition:
Exception.h:32
dabc::ex_Command
@ ex_Command
Definition:
Exception.h:35
dabc::ex_Buffer
@ ex_Buffer
Definition:
Exception.h:36
dabc::ex_Disconnect
@ ex_Disconnect
Definition:
Exception.h:34
dabc::ex_Pointer
@ ex_Pointer
Definition:
Exception.h:40
dabc::ex_Hierarchy
@ ex_Hierarchy
Definition:
Exception.h:39
dabc::ex_None
@ ex_None
Definition:
Exception.h:28
dabc::ex_Timeout
@ ex_Timeout
Definition:
Exception.h:30
dabc::ex_Object
@ ex_Object
Definition:
Exception.h:38
Generated by
1.9.1