Odil
A C++11 library for the DICOM standard
Public Types | Public Member Functions | List of all members
odil::dcmtk::Exception Class Reference

#include <Exception.h>

Inheritance diagram for odil::dcmtk::Exception:
Inheritance graph
[legend]
Collaboration diagram for odil::dcmtk::Exception:
Collaboration graph
[legend]

Public Types

enum class  Source { Message , Condition }
 Source of the Exception: either a message string or an OFCondition. More...
 

Public Member Functions

 Exception (std::string const &message)
 Message string constructor, set the source to Source::Message. More...
 
 Exception (OFCondition const &condition)
 Condition constructor, set the source to Source::Condition. More...
 
virtual ~Exception () noexcept
 Destructor. More...
 
Source get_source () const
 Return the exception source. More...
 
OFCondition const & get_condition () const
 Return the condition that was used to create this exception. More...
 
virtual const char * what () const noexcept
 Return the reason for the exception. More...
 
- Public Member Functions inherited from odil::Exception
 Exception (std::string const &message="")
 Message string constructor. More...
 
virtual ~Exception () noexcept
 Destructor. More...
 
virtual const char * what () const noexcept
 Return the reason for the exception. More...
 

Additional Inherited Members

- Protected Attributes inherited from odil::Exception
std::string _message
 Message of the exception. More...
 

Member Enumeration Documentation

◆ Source

enum class odil::dcmtk::Exception::Source
strong

Source of the Exception: either a message string or an OFCondition.

Enumerator
Message 
Condition 

Constructor & Destructor Documentation

◆ Exception() [1/2]

odil::dcmtk::Exception::Exception ( std::string const &  message)

Message string constructor, set the source to Source::Message.

◆ Exception() [2/2]

odil::dcmtk::Exception::Exception ( OFCondition const &  condition)

Condition constructor, set the source to Source::Condition.

◆ ~Exception()

virtual odil::dcmtk::Exception::~Exception ( )
virtualnoexcept

Destructor.

Reimplemented from odil::Exception.

Member Function Documentation

◆ get_condition()

OFCondition const & odil::dcmtk::Exception::get_condition ( ) const

Return the condition that was used to create this exception.

If the source is not Source::Condition, throw an exception.

◆ get_source()

Source odil::dcmtk::Exception::get_source ( ) const

Return the exception source.

◆ what()

virtual const char * odil::dcmtk::Exception::what ( ) const
virtualnoexcept

Return the reason for the exception.

The reason for the exception is set to the message (for Source::Message) or to the text of the condition (for Source::Condition).

Reimplemented from odil::Exception.


The documentation for this class was generated from the following file: