From 89b96cb79cbe75ba8c1afea61b3caca37a083f62 Mon Sep 17 00:00:00 2001 From: harpreet Date: Fri, 1 Jul 2016 00:11:55 +0530 Subject: Windows Included --- thirdparty/windows/include/coin/CoinError.hpp | 257 ++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 thirdparty/windows/include/coin/CoinError.hpp (limited to 'thirdparty/windows/include/coin/CoinError.hpp') diff --git a/thirdparty/windows/include/coin/CoinError.hpp b/thirdparty/windows/include/coin/CoinError.hpp new file mode 100644 index 0000000..704cfea --- /dev/null +++ b/thirdparty/windows/include/coin/CoinError.hpp @@ -0,0 +1,257 @@ +/* $Id: CoinError.hpp 1372 2011-01-03 23:31:00Z lou $ */ +// Copyright (C) 2000, International Business Machines +// Corporation and others. All Rights Reserved. +// This code is licensed under the terms of the Eclipse Public License (EPL). + +#ifndef CoinError_H +#define CoinError_H + +#include +#include +#include +#include + +#include "CoinUtilsConfig.h" +#include "CoinPragma.hpp" + +/** A function to block the popup windows that windows creates when the code + crashes */ +void WindowsErrorPopupBlocker(); + +//------------------------------------------------------------------- +// +// Error class used to throw exceptions +// +// Errors contain: +// +//------------------------------------------------------------------- + +/** Error Class thrown by an exception + +This class is used when exceptions are thrown. +It contains: +
    +
  • message text +
  • name of method throwing exception +
  • name of class throwing exception or hint +
  • name of file if assert +
  • line number +
+ For asserts class=> optional hint +*/ +class CoinError { + friend void CoinErrorUnitTest(); + +private: + CoinError() + : + message_(), + method_(), + class_(), + file_(), + lineNumber_() + { + // nothing to do here + } + +public: + + //------------------------------------------------------------------- + // Get methods + //------------------------------------------------------------------- + /**@name Get error attributes */ + //@{ + /// get message text + inline const std::string & message() const + { return message_; } + /// get name of method instantiating error + inline const std::string & methodName() const + { return method_; } + /// get name of class instantiating error (or hint for assert) + inline const std::string & className() const + { return class_; } + /// get name of file for assert + inline const std::string & fileName() const + { return file_; } + /// get line number of assert (-1 if not assert) + inline int lineNumber() const + { return lineNumber_; } + /// Just print (for asserts) + inline void print(bool doPrint = true) const + { + if (! doPrint) + return; + if (lineNumber_<0) { + std::cout<