Browse Source

JacobiDecomposition Copy Constructor should throw exception: Now it throws an InvalidAccessException.

This closes #40
tempestpy_adaptions
PBerger 12 years ago
parent
commit
aea711b9f7
  1. 19
      src/exceptions/InvalidAccessException.h
  2. 6
      src/storage/JacobiDecomposition.h

19
src/exceptions/InvalidAccessException.h

@ -0,0 +1,19 @@
#ifndef STORM_EXCEPTIONS_INVALIDACCESSEXCEPTION_H_
#define STORM_EXCEPTIONS_INVALIDACCESSEXCEPTION_H_
#include "src/exceptions/BaseException.h"
namespace storm {
namespace exceptions {
/*!
* @brief This exception is thrown when a function is used/accessed that is forbidden to use (e.g. Copy Constructors)
*/
STORM_EXCEPTION_DEFINE_NEW(InvalidAccessException)
} // namespace exceptions
} // namespace storm
#endif // STORM_EXCEPTIONS_INVALIDACCESSEXCEPTION_H_

6
src/storage/JacobiDecomposition.h

@ -6,6 +6,8 @@
#include "log4cplus/logger.h"
#include "log4cplus/loggingmacros.h"
#include "src/exceptions/InvalidAccessException.h"
extern log4cplus::Logger logger;
namespace storm {
@ -76,7 +78,9 @@ private:
* The copy constructor is disabled for this class.
*/
//JacobiDecomposition(const JacobiDecomposition<T>& that) = delete; // not possible in VS2012
JacobiDecomposition(const JacobiDecomposition<T>& that) {}
JacobiDecomposition(const JacobiDecomposition<T>& that) {
throw new storm::exceptions::InvalidAccessException() << "The copy constructor of JacobiDecomposition is explicitly disabled.";
}
/*!
* Pointer to the LU Matrix

Loading…
Cancel
Save