HyperspaceExplorer 0.7.1
Log.h
00001 /*
00002 Hyperspace Explorer - visualizing higher-dimensional geometry
00003 Copyright (C) 2010  Lene Preuss <lene.preuss@gmail.com>
00004 
00005 This program is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2 of the License, or
00008 (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License along
00016 with this program; if not, write to the Free Software Foundation, Inc.,
00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018 
00019 */
00020 
00021 #ifndef LOG_H
00022 #define LOG_H
00023 
00024 #include <iostream>
00025 #include <string>
00026 
00027 #include "SingletonHolder.h"
00028 #include "Globals.h"
00029 #include "Vector.h"
00030 #include "Rotation.h"
00031 
00033 
00036 class Log{
00037     public:
00040         void log(std::string
00041 #           ifdef DEBUG
00042                 message
00043 #           endif
00044                 ) {
00045 #           ifdef DEBUG
00046                 std::cerr << message << std::endl;
00047 #           endif
00048         }
00049 
00052         template <typename T> Log &operator<<(const T &
00053 #           ifdef DEBUG
00054                 out
00055 #           endif
00056         ) {
00057 #           ifdef DEBUG
00058                 std::cerr << out;
00059                 std::cerr.flush();
00060 #           endif
00061             return *this;
00062 }
00063 
00064     private:
00066         Log() { }
00068         Log(const Log &);
00070         Log &operator=(const Log &);
00072         ~Log() { }
00073 
00074     friend class Loki::CreateUsingNew<Log>;
00075 };
00076 
00077 typedef Loki::SingletonHolder<Log> SingletonLog;
00078 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:16 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo