DABC (Data Acquisition Backbone Core)
2.9.9
base
dabc
Exception.h
Go to the documentation of this file.
1
// $Id: Exception.h 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
#ifndef DABC_Exception
17
#define DABC_Exception
18
19
#include <exception>
20
21
#ifndef DABC_string
22
#include "
dabc/string.h
"
23
#endif
24
25
namespace
dabc
{
26
27
enum
ExceptionKind
{
28
ex_None
,
// type is undefined
29
ex_Stop
,
// stop exception
30
ex_Timeout
,
// timeout exception
31
ex_Input
,
// exception with input port
32
ex_Output
,
// exception with output port
33
ex_Connect
,
// connect for any port
34
ex_Disconnect
,
// disconnect for any port
35
ex_Command
,
// command error,
36
ex_Buffer
,
// buffer error,
37
ex_Pool
,
// memory pool error
38
ex_Object
,
// object error
39
ex_Hierarchy
,
// hierarchy error
40
ex_Pointer
,
// pointer error
41
ex_Generic
// generic exception, extra info is available
42
};
43
57
class
Exception
:
public
std::exception {
58
protected
:
59
60
ExceptionKind
fKind
;
61
std::string
fWhat
;
62
std::string
fItem
;
63
64
public
:
65
Exception
() throw();
66
67
Exception
(const std::
string
&info, const std::
string
&item = "") throw();
68
Exception
(
ExceptionKind
_kind, const std::
string
&info, const std::
string
&item) throw();
69
virtual ~
Exception
() throw();
70
71
virtual const
char
*
what
() const throw();
72
73
ExceptionKind
kind
()
const
{
return
fKind
; }
74
const
std::string
ItemName
()
const
throw() {
return
fItem
; }
75
76
bool
IsStop
()
const
{
return
kind
() ==
ex_Stop
; }
77
bool
IsTimeout
()
const
{
return
kind
() ==
ex_Timeout
; }
78
bool
IsInput
()
const
{
return
kind
() ==
ex_Input
; }
79
bool
IsOutput
()
const
{
return
kind
() ==
ex_Output
; }
80
bool
IsConnect
()
const
{
return
kind
() ==
ex_Connect
; }
81
bool
IsDisconnect
()
const
{
return
kind
() ==
ex_Disconnect
; }
82
bool
IsCommand
()
const
{
return
kind
() ==
ex_Command
; }
83
bool
IsBuffer
()
const
{
return
kind
() ==
ex_Buffer
; }
84
bool
IsPool
()
const
{
return
kind
() ==
ex_Pool
; }
85
bool
IsPointer
()
const
{
return
kind
() ==
ex_Pointer
; }
86
bool
IsObject
()
const
{
return
kind
() ==
ex_Object
; }
87
bool
IsHierarchy
()
const
{
return
kind
() ==
ex_Hierarchy
; }
88
};
89
90
};
91
92
#endif
dabc::Exception
DABC exception.
Definition:
Exception.h:57
dabc::Exception::IsTimeout
bool IsTimeout() const
Definition:
Exception.h:77
dabc::Exception::ItemName
const std::string ItemName() const
Definition:
Exception.h:74
dabc::Exception::IsObject
bool IsObject() const
Definition:
Exception.h:86
dabc::Exception::IsStop
bool IsStop() const
Definition:
Exception.h:76
dabc::Exception::IsHierarchy
bool IsHierarchy() const
Definition:
Exception.h:87
dabc::Exception::IsBuffer
bool IsBuffer() const
Definition:
Exception.h:83
dabc::Exception::fItem
std::string fItem
Definition:
Exception.h:62
dabc::Exception::IsPool
bool IsPool() const
Definition:
Exception.h:84
dabc::Exception::what
virtual const char * what() const
Definition:
Exception.cxx:53
dabc::Exception::IsCommand
bool IsCommand() const
Definition:
Exception.h:82
dabc::Exception::IsPointer
bool IsPointer() const
Definition:
Exception.h:85
dabc::Exception::fKind
ExceptionKind fKind
Definition:
Exception.h:60
dabc::Exception::IsDisconnect
bool IsDisconnect() const
Definition:
Exception.h:81
dabc::Exception::IsInput
bool IsInput() const
Definition:
Exception.h:78
dabc::Exception::IsOutput
bool IsOutput() const
Definition:
Exception.h:79
dabc::Exception::IsConnect
bool IsConnect() const
Definition:
Exception.h:80
dabc::Exception::kind
ExceptionKind kind() const
Definition:
Exception.h:73
dabc::Exception::Exception
Exception()
Definition:
Exception.cxx:20
dabc::Exception::fWhat
std::string fWhat
Definition:
Exception.h:61
dabc
Event manipulation API.
Definition:
api.h:23
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
string.h
Generated by
1.9.1