1 /* 2 Copyright 2009-2012 Andreas Biegert, Christof Angermueller 3 4 This file is part of the CS-BLAST package. 5 6 The CS-BLAST package is free software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 The CS-BLAST package is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef CS_GLOBALS_H_ 21 #define CS_GLOBALS_H_ 22 23 #include <limits> 24 25 namespace cs { 26 27 const int KB = 1024; 28 const int MB = KB * KB; 29 const int GB = KB * KB * KB; 30 const int kMaxInt = 0x7FFFFFFF; 31 const int kMinInt = -kMaxInt - 1; 32 const int kScale = 1000; // scaling factor for serialization 33 const double kNormalize = 1e-6; 34 35 const int kCharSize = sizeof(char); 36 const int kShortSize = sizeof(short); 37 const int kIntSize = sizeof(int); 38 const int kFloatSize = sizeof(float); 39 const int kDoubleSize = sizeof(double); 40 const int kPointerSize = sizeof(void*); 41 42 #ifdef _WIN32 43 const char kDirSep = '\\'; 44 #else 45 const char kDirSep = '/'; 46 #endif 47 48 // A macro to disallow the evil copy constructor and operator= functions 49 // This should be used in the private: declarations for a class 50 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ 51 TypeName(const TypeName&); \ 52 void operator=(const TypeName&) 53 54 // A macro to disallow all the implicit constructors, namely the 55 // default constructor, copy constructor and operator= functions. 56 // 57 // This should be used in the private: declarations for a class 58 // that wants to prevent anyone from instantiating it. This is 59 // especially useful for classes containing only static methods. 60 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ 61 TypeName(); \ 62 DISALLOW_COPY_AND_ASSIGN(TypeName) 63 64 } // namespace cs 65 66 #endif // CS_GLOBALS_H_ 67 68 69 70