Browse Source

Refactored all exceptions to use the macro generator to remove all redundant base code.

tempestpy_adaptions
PBerger 12 years ago
parent
commit
2f05d035fe
  1. 10
      src/exceptions/FileIoException.h
  2. 10
      src/exceptions/InvalidArgumentException.h
  3. 10
      src/exceptions/InvalidSettingsException.h
  4. 10
      src/exceptions/InvalidStateException.h
  5. 10
      src/exceptions/NoConvergenceException.h
  6. 10
      src/exceptions/OutOfRangeException.h
  7. 10
      src/exceptions/WrongFileFormatException.h

10
src/exceptions/FileIoException.h

@ -14,15 +14,7 @@ namespace mrmc {
namespace exceptions {
class FileIoException : public BaseException<FileIoException> {
public:
FileIoException() : BaseException() {
}
FileIoException(const char* cstr) : BaseException(cstr) {
}
FileIoException(const FileIoException& cp) : BaseException(cp) {
}
};
MRMC_EXCEPTION_DEFINE_NEW(FileIoException)
}

10
src/exceptions/InvalidArgumentException.h

@ -10,15 +10,7 @@ namespace exceptions {
/*!
* @brief This exception is thrown when a parameter is invalid in this context
*/
class InvalidArgumentException : public BaseException<InvalidArgumentException> {
public:
InvalidArgumentException() {
}
InvalidArgumentException(const char* cstr) : BaseException(cstr) {
}
InvalidArgumentException(const InvalidArgumentException& cp) : BaseException(cp) {
}
};
MRMC_EXCEPTION_DEFINE_NEW(InvalidArgumentException)
} // namespace exceptions

10
src/exceptions/InvalidSettingsException.h

@ -6,15 +6,7 @@
namespace mrmc {
namespace exceptions {
class InvalidSettingsException : public BaseException<InvalidSettingsException> {
public:
InvalidSettingsException() {
}
InvalidSettingsException(const char* cstr) : BaseException(cstr) {
}
InvalidSettingsException(const InvalidSettingsException& cp) : BaseException(cp) {
}
};
MRMC_EXCEPTION_DEFINE_NEW(InvalidSettingsException)
} // namespace exceptions
} // namespace mrmc

10
src/exceptions/InvalidStateException.h

@ -11,15 +11,7 @@ namespace exceptions {
* @brief This exception is thrown when a memory request can't be
* fulfilled.
*/
class InvalidStateException : public BaseException<InvalidStateException> {
public:
InvalidStateException() {
}
InvalidStateException(const char* cstr) : BaseException(cstr) {
}
InvalidStateException(const InvalidStateException& cp) : BaseException(cp) {
}
};
MRMC_EXCEPTION_DEFINE_NEW(InvalidStateException)
} // namespace exceptions

10
src/exceptions/NoConvergenceException.h

@ -9,15 +9,7 @@ namespace exceptions {
/*!
* @brief This exception is thrown when an iterative solver failed to converge with the given maxIterations
*/
class NoConvergenceException : public BaseException<NoConvergenceException> {
public:
NoConvergenceException() {
}
NoConvergenceException(const char* cstr) : BaseException(cstr) {
}
NoConvergenceException(const NoConvergenceException& cp) : BaseException(cp) {
}
};
MRMC_EXCEPTION_DEFINE_NEW(NoConvergenceException)
} // namespace exceptions
} // namespace mrmc

10
src/exceptions/OutOfRangeException.h

@ -10,15 +10,7 @@ namespace exceptions {
/*
* @briefThis exception is thrown when a parameter is not in the range of valid values
*/
class OutOfRangeException : public BaseException<OutOfRangeException> {
public:
OutOfRangeException() {
}
OutOfRangeException(const char* cstr) : BaseException(cstr) {
}
OutOfRangeException(const OutOfRangeException& cp) : BaseException(cp) {
}
};
MRMC_EXCEPTION_DEFINE_NEW(OutOfRangeException)
} // namespace exceptions

10
src/exceptions/WrongFileFormatException.h

@ -18,15 +18,7 @@ namespace exceptions {
* @brief This exception is thrown when an input file
* contains invalid or missing keys.
*/
class WrongFileFormatException : public BaseException<WrongFileFormatException> {
public:
WrongFileFormatException() {
}
WrongFileFormatException(const char* cstr) : BaseException(cstr) {
}
WrongFileFormatException(const WrongFileFormatException& cp) : BaseException(cp) {
}
};
MRMC_EXCEPTION_DEFINE_NEW(WrongFileFormatException)
} //namespace exceptions

Loading…
Cancel
Save