/* ---- This file is part of SECONDO. Copyright (C) 2012, University in Hagen Faculty of Mathematic and Computer Science, Database Systems for New Applications. SECONDO is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SECONDO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SECONDO; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ---- */ #ifndef PGRAPH_UTILS_H_ #define PGRAPH_UTILS_H_ #include "../MainMemory2/MainMemoryExt.h" #include "MPointer.h" #include "Mem.h" #include "MemoryObject.h" #include "MemCatalog.h" #include "../Relation-C++/RelationAlgebra.h" #include "AlgebraTypes.h" #include //------------------------------------------------------------------ namespace pgraph { const bool LOG_COLORED=true; const std::string LOGOP_COL = LOG_COLORED?"\033[32m":""; const std::string LOGOP_COL_ERR = LOG_COLORED?"\033[91m":""; const std::string LOG_COL_OFF = LOG_COLORED?"\033[0m":""; extern int debugLevel; void setDebugLevel(int level); //------------------------------------------------------------------ inline void LOG_() {}; template void LOG_(const Head& head, const Args&... args ) { std::cout << head << " "; LOG_(args...); } //------------------------------------------------------------------ template void LOGERR(const Args&... args ) { if (LOG_COLORED) std::cout < void LOG(int level, const Args&... args ) { if (level>debugLevel) return; //std::cout << "PGRAPH | "; LOG_(args...); if (LOG_COLORED) std::cout << LOG_COL_OFF<<"\n"; else std::cout << "\n"; } //------------------------------------------------------------------ template void LOGOP(int level, const std::string source, const Args&... args ) { if (level>debugLevel) return; //std::cout << "PGRAPH | "; if (LOG_COLORED) std::cout <