Shuto Naruse
/
Eurobot2012_Secondary
Eurobot2012_Secondary
Fork of Eurobot_2012_Secondary by
tvmet/RunTimeError.h@1:cc2a9eb0bd55, 2012-10-17 (annotated)
- Committer:
- narshu
- Date:
- Wed Oct 17 22:25:31 2012 +0000
- Revision:
- 1:cc2a9eb0bd55
Commit before publishing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
narshu | 1:cc2a9eb0bd55 | 1 | /* |
narshu | 1:cc2a9eb0bd55 | 2 | * Tiny Vector Matrix Library |
narshu | 1:cc2a9eb0bd55 | 3 | * Dense Vector Matrix Libary of Tiny size using Expression Templates |
narshu | 1:cc2a9eb0bd55 | 4 | * |
narshu | 1:cc2a9eb0bd55 | 5 | * Copyright (C) 2001 - 2007 Olaf Petzold <opetzold@users.sourceforge.net> |
narshu | 1:cc2a9eb0bd55 | 6 | * |
narshu | 1:cc2a9eb0bd55 | 7 | * This library is free software; you can redistribute it and/or |
narshu | 1:cc2a9eb0bd55 | 8 | * modify it under the terms of the GNU Lesser General Public |
narshu | 1:cc2a9eb0bd55 | 9 | * License as published by the Free Software Foundation; either |
narshu | 1:cc2a9eb0bd55 | 10 | * version 2.1 of the License, or (at your option) any later version. |
narshu | 1:cc2a9eb0bd55 | 11 | * |
narshu | 1:cc2a9eb0bd55 | 12 | * This library is distributed in the hope that it will be useful, |
narshu | 1:cc2a9eb0bd55 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
narshu | 1:cc2a9eb0bd55 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
narshu | 1:cc2a9eb0bd55 | 15 | * Lesser General Public License for more details. |
narshu | 1:cc2a9eb0bd55 | 16 | * |
narshu | 1:cc2a9eb0bd55 | 17 | * You should have received a copy of the GNU Lesser General Public |
narshu | 1:cc2a9eb0bd55 | 18 | * License along with this library; if not, write to the Free Software |
narshu | 1:cc2a9eb0bd55 | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
narshu | 1:cc2a9eb0bd55 | 20 | * |
narshu | 1:cc2a9eb0bd55 | 21 | * $Id: RunTimeError.h,v 1.13 2007-06-23 15:58:58 opetzold Exp $ |
narshu | 1:cc2a9eb0bd55 | 22 | */ |
narshu | 1:cc2a9eb0bd55 | 23 | |
narshu | 1:cc2a9eb0bd55 | 24 | #ifndef TVMET_RUN_TIME_ERROR_H |
narshu | 1:cc2a9eb0bd55 | 25 | #define TVMET_RUN_TIME_ERROR_H |
narshu | 1:cc2a9eb0bd55 | 26 | |
narshu | 1:cc2a9eb0bd55 | 27 | #include <cassert> |
narshu | 1:cc2a9eb0bd55 | 28 | |
narshu | 1:cc2a9eb0bd55 | 29 | |
narshu | 1:cc2a9eb0bd55 | 30 | namespace tvmet { |
narshu | 1:cc2a9eb0bd55 | 31 | |
narshu | 1:cc2a9eb0bd55 | 32 | |
narshu | 1:cc2a9eb0bd55 | 33 | /** |
narshu | 1:cc2a9eb0bd55 | 34 | * \def TVMET_RT_CONDITION(XPR, MSG) |
narshu | 1:cc2a9eb0bd55 | 35 | * \brief If TVMET_DEBUG is defined it checks the condition XPR and prints |
narshu | 1:cc2a9eb0bd55 | 36 | * an error message MSG at runtime. |
narshu | 1:cc2a9eb0bd55 | 37 | */ |
narshu | 1:cc2a9eb0bd55 | 38 | #if defined(TVMET_DEBUG) |
narshu | 1:cc2a9eb0bd55 | 39 | |
narshu | 1:cc2a9eb0bd55 | 40 | #define TVMET_RT_CONDITION(XPR, MSG) { \ |
narshu | 1:cc2a9eb0bd55 | 41 | if(!(XPR)) { \ |
narshu | 1:cc2a9eb0bd55 | 42 | std::cerr << "[tvmet] Precondition failure in " << __FILE__ \ |
narshu | 1:cc2a9eb0bd55 | 43 | << ", line " << __LINE__ << ": " \ |
narshu | 1:cc2a9eb0bd55 | 44 | << MSG << std::endl; \ |
narshu | 1:cc2a9eb0bd55 | 45 | std::cerr.flush(); \ |
narshu | 1:cc2a9eb0bd55 | 46 | assert(0); \ |
narshu | 1:cc2a9eb0bd55 | 47 | } \ |
narshu | 1:cc2a9eb0bd55 | 48 | } |
narshu | 1:cc2a9eb0bd55 | 49 | |
narshu | 1:cc2a9eb0bd55 | 50 | #else |
narshu | 1:cc2a9eb0bd55 | 51 | |
narshu | 1:cc2a9eb0bd55 | 52 | #define TVMET_RT_CONDITION(XPR, MSG) |
narshu | 1:cc2a9eb0bd55 | 53 | |
narshu | 1:cc2a9eb0bd55 | 54 | #endif |
narshu | 1:cc2a9eb0bd55 | 55 | |
narshu | 1:cc2a9eb0bd55 | 56 | |
narshu | 1:cc2a9eb0bd55 | 57 | } // namespace tvmet |
narshu | 1:cc2a9eb0bd55 | 58 | |
narshu | 1:cc2a9eb0bd55 | 59 | |
narshu | 1:cc2a9eb0bd55 | 60 | #endif // TVMET_RUN_TIME_ERROR_H |
narshu | 1:cc2a9eb0bd55 | 61 | |
narshu | 1:cc2a9eb0bd55 | 62 | |
narshu | 1:cc2a9eb0bd55 | 63 | // Local Variables: |
narshu | 1:cc2a9eb0bd55 | 64 | // mode:C++ |
narshu | 1:cc2a9eb0bd55 | 65 | // tab-width:8 |
narshu | 1:cc2a9eb0bd55 | 66 | // End: |