Lunchbox  1.6.0
types.h
Go to the documentation of this file.
00001 
00002 /* Copyright (c) 2007-2012, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00023 #ifndef LUNCHBOX_TYPES_H
00024 #define LUNCHBOX_TYPES_H
00025 
00026 #include <string>
00027 #include <vector>
00028 #include <sys/types.h>
00029 
00030 #ifndef _MSC_VER
00031 #  include <stdint.h>
00032 #endif
00033 
00034 #ifdef _WIN32
00035 #  include <basetsd.h>
00036 
00037 typedef int        socklen_t;
00038 
00039 #  ifdef _MSC_VER
00040 typedef UINT64     uint64_t;
00041 typedef INT64      int64_t;
00042 typedef UINT32     uint32_t;
00043 typedef INT32      int32_t;
00044 typedef UINT16     uint16_t;
00045 typedef INT16      int16_t;
00046 typedef UINT8      uint8_t;
00047 typedef INT8       int8_t;
00048 #    ifndef HAVE_SSIZE_T
00049 typedef SSIZE_T    ssize_t;
00050 #      define HAVE_SSIZE_T
00051 #    endif
00052 #  endif // Win32, Visual C++
00053 #endif // Win32
00054 
00055 #define LB_BIT1  (0x00000001u)
00056 #define LB_BIT2  (0x00000002u)
00057 #define LB_BIT3  (0x00000004u)
00058 #define LB_BIT4  (0x00000008u)
00059 #define LB_BIT5  (0x00000010u)
00060 #define LB_BIT6  (0x00000020u)
00061 #define LB_BIT7  (0x00000040u)
00062 #define LB_BIT8  (0x00000080u)
00063 
00064 #define LB_BIT9  (0x00000100u)
00065 #define LB_BIT10 (0x00000200u)
00066 #define LB_BIT11 (0x00000400u)
00067 #define LB_BIT12 (0x00000800u)
00068 #define LB_BIT13 (0x00001000u)
00069 #define LB_BIT14 (0x00002000u)
00070 #define LB_BIT15 (0x00004000u)
00071 #define LB_BIT16 (0x00008000u)
00072 
00073 #define LB_BIT17 (0x00010000u)
00074 #define LB_BIT18 (0x00020000u)
00075 #define LB_BIT19 (0x00040000u)
00076 #define LB_BIT20 (0x00080000u)
00077 #define LB_BIT21 (0x00100000u)
00078 #define LB_BIT22 (0x00200000u)
00079 #define LB_BIT23 (0x00400000u)
00080 #define LB_BIT24 (0x00800000u)
00081 
00082 #define LB_BIT25 (0x01000000u)
00083 #define LB_BIT26 (0x02000000u)
00084 #define LB_BIT27 (0x04000000u)
00085 #define LB_BIT28 (0x08000000u)
00086 #define LB_BIT29 (0x10000000u)
00087 #define LB_BIT30 (0x20000000u)
00088 #define LB_BIT31 (0x40000000u)
00089 #define LB_BIT32 (0x80000000u)
00090 
00091 #define LB_BIT33 (0x0000000100000000ull)
00092 #define LB_BIT34 (0x0000000200000000ull)
00093 #define LB_BIT35 (0x0000000400000000ull)
00094 #define LB_BIT36 (0x0000000800000000ull)
00095 #define LB_BIT37 (0x0000001000000000ull)
00096 #define LB_BIT38 (0x0000002000000000ull)
00097 #define LB_BIT39 (0x0000004000000000ull)
00098 #define LB_BIT40 (0x0000008000000000ull)
00099 
00100 #define LB_BIT41 (0x0000010000000000ull)
00101 #define LB_BIT42 (0x0000020000000000ull)
00102 #define LB_BIT43 (0x0000040000000000ull)
00103 #define LB_BIT44 (0x0000080000000000ull)
00104 #define LB_BIT45 (0x0000100000000000ull)
00105 #define LB_BIT46 (0x0000200000000000ull)
00106 #define LB_BIT47 (0x0000400000000000ull)
00107 #define LB_BIT48 (0x0000800000000000ull)
00108 
00109 #define LB_BIT49 (0x0001000000000000ull)
00110 #define LB_BIT50 (0x0002000000000000ull)
00111 #define LB_BIT51 (0x0004000000000000ull)
00112 #define LB_BIT52 (0x0008000000000000ull)
00113 #define LB_BIT53 (0x0010000000000000ull)
00114 #define LB_BIT54 (0x0020000000000000ull)
00115 #define LB_BIT55 (0x0040000000000000ull)
00116 #define LB_BIT56 (0x0080000000000000ull)
00117 
00118 #define LB_BIT57 (0x0100000000000000ull)
00119 #define LB_BIT58 (0x0200000000000000ull)
00120 #define LB_BIT59 (0x0400000000000000ull)
00121 #define LB_BIT60 (0x0800000000000000ull)
00122 #define LB_BIT61 (0x1000000000000000ull)
00123 #define LB_BIT62 (0x2000000000000000ull)
00124 #define LB_BIT63 (0x4000000000000000ull)
00125 #define LB_BIT64 (0x8000000000000000ull)
00126 
00127 #define LB_BIT_ALL_32  (0xffffffffu)
00128 #define LB_BIT_ALL_64  (0xffffffffffffffffull)
00129 #define LB_BIT_NONE (0)
00130 
00131 #define LB_1KB   (1024)
00132 #define LB_10KB  (10240)
00133 #define LB_100KB (102400)
00134 #define LB_1MB   (1048576)
00135 #define LB_10MB  (10485760)
00136 #define LB_100MB (104857600)
00137 
00138 #define LB_16KB  (16384)
00139 #define LB_32KB  (32768)
00140 #define LB_64KB  (65536)
00141 #define LB_128KB (131072)
00142 #define LB_48MB  (50331648)
00143 #define LB_64MB  (67108864)
00144 
00145 namespace lunchbox
00146 {
00148 typedef std::vector< std::string > Strings;
00149 typedef Strings::const_iterator StringsCIter;
00150 
00151 class Clock;
00152 class Lock;
00153 class NonCopyable;
00154 class Referenced;
00155 class RequestHandler;
00156 class Servus;
00157 class SpinLock;
00158 class UUID;
00159 class uint128_t;
00160 
00161 template< class > class Atomic;
00162 template< class > class Buffer;
00163 template< class > class Monitor;
00164 template< class, class> class Lockable;
00165 template< class T, int32_t > class LFVector;
00166 template< class T, class V > class LFVectorIterator;
00167 
00168 typedef Atomic< int32_t > a_int32_t; 
00169 typedef Atomic< ssize_t > a_ssize_t; 
00170 typedef Buffer< uint8_t > Bufferb; 
00171 
00172 }
00173 
00174 #endif //LUNCHBOX_TYPES_H