Odil
A C++11 library for the DICOM standard
Exception.h
Go to the documentation of this file.
1/*************************************************************************
2 * odil - Copyright (C) Universite de Strasbourg
3 * Distributed under the terms of the CeCILL-B license, as published by
4 * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6 * for details.
7 ************************************************************************/
8
9#ifndef _9e106372_aca6_4551_a591_95695eb00e4c
10#define _9e106372_aca6_4551_a591_95695eb00e4c
11
12#include <dcmtk/config/osconfig.h>
13#include <dcmtk/ofstd/ofcond.h>
14
15#include "odil/Exception.h"
16#include "odil/odil.h"
17
18namespace odil
19{
20
21namespace dcmtk
22{
23
25{
26public:
31 enum class Source { Message, Condition };
32
34 Exception(std::string const & message);
35
37 Exception(OFCondition const & condition);
38
40 virtual ~Exception() noexcept;
41
43 Source get_source() const;
44
50 OFCondition const & get_condition() const;
51
58 virtual const char* what() const noexcept;
59private:
60 Source _source;
61 OFCondition _condition;
62};
63
64}
65
66}
67
68#endif // _9e106372_aca6_4551_a591_95695eb00e4c
69
Base class for odil exceptions.
Definition: Exception.h:22
Definition: Exception.h:25
Source
Source of the Exception: either a message string or an OFCondition.
Definition: Exception.h:31
virtual ~Exception() noexcept
Destructor.
Exception(OFCondition const &condition)
Condition constructor, set the source to Source::Condition.
Exception(std::string const &message)
Message string constructor, set the source to Source::Message.
Definition: Association.h:25
#define ODIL_API
Definition: odil.h:28