OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
aException.h
Go to the documentation of this file.
1/*
2 * File: aException.h
3 * Package: akCore
4 *
5 * Created on: January 29, 2020
6 * Author: Alexander Kuester
7 * Copyright (c) 2022 Alexander Kuester
8 * This file is part of the uiCore component.
9 * This file is subject to the terms and conditions defined in
10 * file 'LICENSE', which is part of this source code package.
11 */
12
13#pragma once
14
15 // AK header
17
18// C++ header
19#include <exception> // Base class
20#include <string> // std::string
21
22namespace ak {
23
34 class UICORE_API_EXPORT aException : public std::exception {
35 public:
36
50
52 aException();
53
59 const char * _exWhat,
60 const char * _exWhere,
61 exceptionType _exType = exceptionType::Undefined
62 );
63
69 const std::string & _exWhat,
70 const char * _exWhere,
71 exceptionType _exType = exceptionType::Undefined
72 );
73
79 const std::string & _exWhat,
80 const std::string & _exWhere,
81 exceptionType _exType = exceptionType::Undefined
82 );
83
89 const char * _exWhat,
90 const std::string & _exWhere,
91 exceptionType _exType = exceptionType::Undefined
92 );
93
97 const aException & _other
98 );
99
105 const aException & _other,
106 const char * _exWhere
107 );
108
110 virtual ~aException() throw();
111
113 virtual const char * what() const throw() override;
114
116 std::string getWhat(void) const;
117
119 std::string getWhere(void) const;
120
122 exceptionType getType(void) const;
123
124 protected:
125 std::string m_what;
126 std::string m_where;
128
129 void buildOut(void);
130
131 private:
132 std::string m_out;
133 };
134
136 public:
137 InvalidObjectTypeException() noexcept : std::exception("Invalid object type") {};
138 };
139
140 class UICORE_API_EXPORT ItemNotFoundException : public std::exception {
141 public:
142 ItemNotFoundException() noexcept : std::exception("Item not found") {};
143 };
144
145} // namespace ak
#define UICORE_API_EXPORT
Definition globalDataTypes.h:20
Definition aException.h:135
InvalidObjectTypeException() noexcept
Definition aException.h:137
Definition aException.h:140
ItemNotFoundException() noexcept
Definition aException.h:142
The ak::Exception class can be used as an universal exception which may used to provide nicely readab...
Definition aException.h:34
exceptionType
Used to determine the type of the exception.
Definition aException.h:38
@ FileNotFound
Definition aException.h:42
@ NumberFormat
Definition aException.h:45
@ ArrayOutOfBounds
Definition aException.h:41
@ IO
Definition aException.h:43
@ Arithmetic
Definition aException.h:40
@ UnknownCommand
Definition aException.h:47
@ InvalidInput
Definition aException.h:46
@ Nullptr
Definition aException.h:44
Definition uiAPI.h:45
STL namespace.