Lunchbox  1.4.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 #    endif
00051 #  endif // Win32, Visual C++
00052 #endif // Win32
00053 
00054 #define LB_BIT1  (0x00000001u)
00055 #define LB_BIT2  (0x00000002u)
00056 #define LB_BIT3  (0x00000004u)
00057 #define LB_BIT4  (0x00000008u)
00058 #define LB_BIT5  (0x00000010u)
00059 #define LB_BIT6  (0x00000020u)
00060 #define LB_BIT7  (0x00000040u)
00061 #define LB_BIT8  (0x00000080u)
00062 
00063 #define LB_BIT9  (0x00000100u)
00064 #define LB_BIT10 (0x00000200u)
00065 #define LB_BIT11 (0x00000400u)
00066 #define LB_BIT12 (0x00000800u)
00067 #define LB_BIT13 (0x00001000u)
00068 #define LB_BIT14 (0x00002000u)
00069 #define LB_BIT15 (0x00004000u)
00070 #define LB_BIT16 (0x00008000u)
00071 
00072 #define LB_BIT17 (0x00010000u)
00073 #define LB_BIT18 (0x00020000u)
00074 #define LB_BIT19 (0x00040000u)
00075 #define LB_BIT20 (0x00080000u)
00076 #define LB_BIT21 (0x00100000u)
00077 #define LB_BIT22 (0x00200000u)
00078 #define LB_BIT23 (0x00400000u)
00079 #define LB_BIT24 (0x00800000u)
00080 
00081 #define LB_BIT25 (0x01000000u)
00082 #define LB_BIT26 (0x02000000u)
00083 #define LB_BIT27 (0x04000000u)
00084 #define LB_BIT28 (0x08000000u)
00085 #define LB_BIT29 (0x10000000u)
00086 #define LB_BIT30 (0x20000000u)
00087 #define LB_BIT31 (0x40000000u)
00088 #define LB_BIT32 (0x80000000u)
00089 
00090 #define LB_BIT33 (0x0000000100000000ull)
00091 #define LB_BIT34 (0x0000000200000000ull)
00092 #define LB_BIT35 (0x0000000400000000ull)
00093 #define LB_BIT36 (0x0000000800000000ull)
00094 #define LB_BIT37 (0x0000001000000000ull)
00095 #define LB_BIT38 (0x0000002000000000ull)
00096 #define LB_BIT39 (0x0000004000000000ull)
00097 #define LB_BIT40 (0x0000008000000000ull)
00098 
00099 #define LB_BIT41 (0x0000010000000000ull)
00100 #define LB_BIT42 (0x0000020000000000ull)
00101 #define LB_BIT43 (0x0000040000000000ull)
00102 #define LB_BIT44 (0x0000080000000000ull)
00103 #define LB_BIT45 (0x0000100000000000ull)
00104 #define LB_BIT46 (0x0000200000000000ull)
00105 #define LB_BIT47 (0x0000400000000000ull)
00106 #define LB_BIT48 (0x0000800000000000ull)
00107 
00108 #define LB_BIT_ALL_32  (0xffffffffu)
00109 #define LB_BIT_ALL_64  (0xffffffffffffffffull)
00110 #define LB_BIT_NONE (0)
00111 
00112 #define LB_1KB   (1024)
00113 #define LB_10KB  (10240)
00114 #define LB_100KB (102400)
00115 #define LB_1MB   (1048576)
00116 #define LB_10MB  (10485760)
00117 #define LB_100MB (104857600)
00118 
00119 #define LB_16KB  (16384)
00120 #define LB_32KB  (32768)
00121 #define LB_64KB  (65536)
00122 #define LB_128KB (131072)
00123 #define LB_48MB  (50331648)
00124 #define LB_64MB  (67108864)
00125 
00126 namespace lunchbox
00127 {
00129 typedef std::vector< std::string > Strings;
00130 typedef Strings::const_iterator StringsCIter;
00131 
00132 class Clock;
00133 class Lock;
00134 class NonCopyable;
00135 class Referenced;
00136 class RequestHandler;
00137 class Servus;
00138 class SpinLock;
00139 class UUID;
00140 class uint128_t;
00141 
00142 template< class > class Atomic;
00143 template< class > class Buffer;
00144 template< class > class Monitor;
00145 template< class, class> class Lockable;
00146 template< class T, int32_t > class LFVector;
00147 template< class T, class V > class LFVectorIterator;
00148 
00149 typedef Atomic< int32_t > a_int32_t; 
00150 typedef Atomic< ssize_t > a_ssize_t; 
00151 typedef Buffer< uint8_t > Bufferb; 
00152 
00153 }
00154 
00155 #endif //LUNCHBOX_TYPES_H