Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lib4neuro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MolDyn
lib4neuro
Commits
80341032
Commit
80341032
authored
6 years ago
by
Martin Beseda
Browse files
Options
Downloads
Patches
Plain Diff
ENH + DEL + NEW: Exceptions rewritten as macros. Now located only in exceptions.h header.
parent
90512183
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
exceptions.h
+22
-0
22 additions, 0 deletions
exceptions.h
src/CMakeLists.txt
+0
-2
0 additions, 2 deletions
src/CMakeLists.txt
src/Exception/Exceptions.h
+0
-67
0 additions, 67 deletions
src/Exception/Exceptions.h
with
22 additions
and
69 deletions
exceptions.h
0 → 100644
+
22
−
0
View file @
80341032
//
// Created by martin on 9/17/18.
//
#ifndef LIB4NEURO_EXCEPTIONS_H
#define LIB4NEURO_EXCEPTIONS_H
#include
<stdexcept>
#include
<boost/type_index.hpp>
//TODO Can Boost be included here?
#ifdef L4N_DEBUG
#define ERR_MSG(msg) std::string(boost::typeindex::type_id_with_cvr<decltype(*this)>().pretty_name()) + "::" + __func__ + "(): " + msg + " (" +__FILE__ + ":" + std::to_string(__LINE__) + ")"
#else
#define ERR_MSG(msg) std::string(boost::typeindex::type_id_with_cvr<decltype(*this)>().pretty_name()) + "::" + __func__ + "(): " + msg
#endif // L4N_DEBUG
#define THROW_RUNTIME_ERROR(msg) std::runtime_error(ERR_MSG(msg)) // Errors, that can't be detected by looking at the code
#define THROW_LOGIC_ERROR(msg) std::logic_error(ERR_MSG(msg)) // Errors, that can be detected by looking at the code
#define THROW_INVALID_ARGUMENT_ERROR(msg) std::invalid_argument(ERR_MSG(msg))
#define THROW_NOT_IMPLEMENTED_ERROR(msg) std::logic_error(ERR_MSG("This function is not implemented." + msg))
#endif //LIB4NEURO_EXCEPTIONS_H
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
0
−
2
View file @
80341032
...
...
@@ -19,7 +19,6 @@ if ("${BUILD_LIB}" STREQUAL "yes")
${
LIB_TYPE
}
General/ExprtkWrapper.cpp
Exception/Exceptions.cpp
)
target_include_directories
(
...
...
@@ -56,7 +55,6 @@ if ("${BUILD_LIB}" STREQUAL "yes")
DataSet/DataSet.cpp
ErrorFunction/ErrorFunctions.cpp
Solvers/DESolver.cpp
Exception/Exceptions.cpp
CSVReader/CSVReader.cpp
CrossValidator/CrossValidator.cpp
NormalizationStrategy/NormalizationStrategy.cpp
...
...
This diff is collapsed.
Click to expand it.
src/Exception/Exceptions.h
deleted
100644 → 0
+
0
−
67
View file @
90512183
//
// Created by martin on 9/17/18.
//
#ifndef LIB4NEURO_EXCEPTIONS_H
#define LIB4NEURO_EXCEPTIONS_H
#include
<stdexcept>
namespace
lib4neuro
{
/**
* Class representing an error caused by an incorrect
* input/output dimension specification
*/
class
InvalidDimension
:
public
std
::
runtime_error
{
public:
/**
* Constructor with the general error message
*/
InvalidDimension
();
/**
* Constructor with specific error message
* @param msg Specific error message
*/
explicit
InvalidDimension
(
std
::
string
msg
);
};
//TODO implement NotImplementedException according to C++17
/**
*
*/
class
NotImplementedException
:
public
std
::
runtime_error
{
public:
/**
*
*/
NotImplementedException
();
/**
*
* @param msg
*/
explicit
NotImplementedException
(
std
::
string
msg
);
};
class
FileNotFoundException
:
public
std
::
runtime_error
{
public:
/**
*
*/
FileNotFoundException
();
/**
*
* @param msg
*/
FileNotFoundException
(
std
::
string
msg
);
};
}
#endif //LIB4NEURO_EXCEPTIONS_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment