Lunchbox  1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
types.h
Go to the documentation of this file.
1 
2 /* Copyright (c) 2007-2014, Stefan Eilemann <eile@equalizergraphics.com>
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
58 #ifndef LUNCHBOX_TYPES_H
59 #define LUNCHBOX_TYPES_H
60 
61 #include <lunchbox/defines.h>
62 
63 #include <boost/foreach.hpp>
64 #include <string>
65 #include <vector>
66 #include <sys/types.h>
67 
68 #ifndef _MSC_VER
69 # include <stdint.h>
70 #endif
71 
72 #ifdef _WIN32
73 # include <basetsd.h>
74 
75 typedef int socklen_t;
76 
77 # ifdef _MSC_VER
78 typedef UINT64 uint64_t;
79 typedef INT64 int64_t;
80 typedef UINT32 uint32_t;
81 typedef INT32 int32_t;
82 typedef UINT16 uint16_t;
83 typedef INT16 int16_t;
84 typedef UINT8 uint8_t;
85 typedef INT8 int8_t;
86 # ifndef HAVE_SSIZE_T
87 typedef SSIZE_T ssize_t;
88 # define HAVE_SSIZE_T
89 # endif
90 # endif // Win32, Visual C++
91 #endif // Win32
92 
94 #define LB_UNDEFINED_UINT16 (0xffffu)
95 
97 #define LB_UNDEFINED_UINT32 (0xffffffffu)
98 
100 #define LB_UNDEFINED_UINT64 (0xffffffffffffffffull)
101 
103 #define LB_MAX_UINT32 (0xfffffff0u)
104 
106 #define LB_TIMEOUT_INDEFINITE 0xffffffffu // Attn: identical to Win32 INFINITE!
107 
109 #define LB_TIMEOUT_DEFAULT 0xfffffffeu
110 
111 // Defining our own min/max macros seems to be the only sane way to get this
112 // functionality across platforms thanks to some screwup in the MS header files.
113 #define LB_MAX(a,b) ((a)>(b)?(a):(b))
114 #define LB_MIN(a,b) ((a)<(b)?(a):(b))
115 
116 #define LB_BIT1 (0x00000001u)
117 #define LB_BIT2 (0x00000002u)
118 #define LB_BIT3 (0x00000004u)
119 #define LB_BIT4 (0x00000008u)
120 #define LB_BIT5 (0x00000010u)
121 #define LB_BIT6 (0x00000020u)
122 #define LB_BIT7 (0x00000040u)
123 #define LB_BIT8 (0x00000080u)
124 
125 #define LB_BIT9 (0x00000100u)
126 #define LB_BIT10 (0x00000200u)
127 #define LB_BIT11 (0x00000400u)
128 #define LB_BIT12 (0x00000800u)
129 #define LB_BIT13 (0x00001000u)
130 #define LB_BIT14 (0x00002000u)
131 #define LB_BIT15 (0x00004000u)
132 #define LB_BIT16 (0x00008000u)
133 
134 #define LB_BIT17 (0x00010000u)
135 #define LB_BIT18 (0x00020000u)
136 #define LB_BIT19 (0x00040000u)
137 #define LB_BIT20 (0x00080000u)
138 #define LB_BIT21 (0x00100000u)
139 #define LB_BIT22 (0x00200000u)
140 #define LB_BIT23 (0x00400000u)
141 #define LB_BIT24 (0x00800000u)
142 
143 #define LB_BIT25 (0x01000000u)
144 #define LB_BIT26 (0x02000000u)
145 #define LB_BIT27 (0x04000000u)
146 #define LB_BIT28 (0x08000000u)
147 #define LB_BIT29 (0x10000000u)
148 #define LB_BIT30 (0x20000000u)
149 #define LB_BIT31 (0x40000000u)
150 #define LB_BIT32 (0x80000000u)
151 
152 #define LB_BIT33 (0x0000000100000000ull)
153 #define LB_BIT34 (0x0000000200000000ull)
154 #define LB_BIT35 (0x0000000400000000ull)
155 #define LB_BIT36 (0x0000000800000000ull)
156 #define LB_BIT37 (0x0000001000000000ull)
157 #define LB_BIT38 (0x0000002000000000ull)
158 #define LB_BIT39 (0x0000004000000000ull)
159 #define LB_BIT40 (0x0000008000000000ull)
160 
161 #define LB_BIT41 (0x0000010000000000ull)
162 #define LB_BIT42 (0x0000020000000000ull)
163 #define LB_BIT43 (0x0000040000000000ull)
164 #define LB_BIT44 (0x0000080000000000ull)
165 #define LB_BIT45 (0x0000100000000000ull)
166 #define LB_BIT46 (0x0000200000000000ull)
167 #define LB_BIT47 (0x0000400000000000ull)
168 #define LB_BIT48 (0x0000800000000000ull)
169 
170 #define LB_BIT49 (0x0001000000000000ull)
171 #define LB_BIT50 (0x0002000000000000ull)
172 #define LB_BIT51 (0x0004000000000000ull)
173 #define LB_BIT52 (0x0008000000000000ull)
174 #define LB_BIT53 (0x0010000000000000ull)
175 #define LB_BIT54 (0x0020000000000000ull)
176 #define LB_BIT55 (0x0040000000000000ull)
177 #define LB_BIT56 (0x0080000000000000ull)
178 
179 #define LB_BIT57 (0x0100000000000000ull)
180 #define LB_BIT58 (0x0200000000000000ull)
181 #define LB_BIT59 (0x0400000000000000ull)
182 #define LB_BIT60 (0x0800000000000000ull)
183 #define LB_BIT61 (0x1000000000000000ull)
184 #define LB_BIT62 (0x2000000000000000ull)
185 #define LB_BIT63 (0x4000000000000000ull)
186 #define LB_BIT64 (0x8000000000000000ull)
187 
188 #define LB_BIT_ALL_32 (0xffffffffu)
189 #define LB_BIT_ALL_64 (0xffffffffffffffffull)
190 #define LB_BIT_NONE (0)
191 
192 #define LB_1KB (1024)
193 #define LB_10KB (10240)
194 #define LB_100KB (102400)
195 #define LB_1MB (1048576)
196 #define LB_10MB (10485760)
197 #define LB_100MB (104857600)
198 
199 #define LB_16KB (16384)
200 #define LB_32KB (32768)
201 #define LB_64KB (65536)
202 #define LB_128KB (131072)
203 #define LB_48MB (50331648)
204 #define LB_64MB (67108864)
205 
207 struct EqCompressorInfo;
208 typedef std::vector< EqCompressorInfo > EqCompressorInfos;
209 typedef EqCompressorInfos::const_iterator EqCompressorInfosCIter;
210 struct GLEWContextStruct;
211 struct WGLEWContextStruct;
212 typedef struct GLEWContextStruct GLEWContext;
213 typedef struct WGLEWContextStruct WGLEWContext;
214 #define LB_DLLEXPORT LUNCHBOX_DLLEXPORT
215 #define LB_DLLIMPORT LUNCHBOX_DLLIMPORT
216 
218 namespace lunchbox
219 {
221 typedef std::vector< std::string > Strings;
222 typedef Strings::const_iterator StringsCIter;
223 typedef Strings::iterator StringsIter;
224 
225 class Clock;
226 class Lock;
227 class NonCopyable;
228 class Plugin;
229 class PluginRegistry;
230 class Referenced;
231 class RequestHandler;
232 class Servus;
233 class SpinLock;
234 class Uploader;
235 class URI;
236 class uint128_t;
237 
238 struct CompressorResult;
239 
240 template< class > class Array;
241 template< class > class Atomic;
242 template< class > class Buffer;
243 template< class > class Future;
244 template< class > class Monitor;
245 template< class > class Request;
246 template< class, class > class LFVectorIterator;
247 template< class, class > class Lockable;
248 template< class, class > class PluginVisitorT;
249 template< class, int32_t > class LFVector;
250 
254 
259 
261 typedef std::vector< CompressorChunk > CompressorChunks;
262 typedef std::vector< Plugin* > Plugins;
263 typedef Plugins::const_iterator PluginsCIter;
264 
266 typedef PluginVisitorT< const Plugin,
268 
269 #ifdef LUNCHBOX_USE_V1_API
270 typedef uint128_t UUID;
271 #endif
272 
274 struct CompressorInfo;
275 typedef std::vector< CompressorInfo > CompressorInfos;
276 typedef CompressorInfos::const_iterator CompressorInfosCIter;
277 typedef CompressorInfos::iterator CompressorInfosIter;
279 }
280 
281 #endif //LUNCHBOX_TYPES_H
A wrapper for C arrays without any memory management.
Definition: array.h:29
A registry for loaded plugins.
An iterator for LFVector.
Future< void > f_void_t
A future signed size promise.
Definition: types.h:258
A variable with atomic semantics and standalone atomic operations.
Definition: atomic.h:87
A fast lock for uncontended memory access.
Definition: spinLock.h:38
A class for time measurements.
Definition: clock.h:31
STL-like vector implementation providing certain thread-safety guarantees.
Definition: lfVector.h:53
std::vector< std::string > Strings
A vector of std::strings.
Definition: types.h:221
Future< uint32_t > f_uint32_t
A future 32 bit unsigned promise.
Definition: types.h:256
Future template specialization for void.
Definition: future.h:124
A monitor primitive.
Definition: monitor.h:42
Information about one compressor.
A convenience structure to hold data together with a lock for access.
Definition: lockable.h:32
Visitor for all plugins and compressors of a Plugin or PluginRegistry.
Definition: pluginVisitor.h:31
The URI class parses the given uri string according to the regex given in RFC3986.
Definition: uri.h:55
A Future implementation for a RequestHandler request.
Definition: request.h:32
Buffer< uint8_t > Bufferb
a byte buffer
Definition: types.h:253
Base class to make objects non-copyable.
Definition: nonCopyable.h:30
A future represents a asynchronous operation.
Definition: future.h:60
Atomic< int32_t > a_int32_t
An atomic 32 bit integer variable.
Definition: types.h:249
Future< ssize_t > f_ssize_t
A future signed size promise.
Definition: types.h:257
Base class for referenced objects.
Definition: referenced.h:45
Atomic< ssize_t > a_ssize_t
An atomic signed size variable.
Definition: types.h:252
Holder for all functions and information of one compression plugin DSO.
Definition: plugin.h:38
A thread-safe request handler.
A base type for 128 bit unsigned integer values.
Definition: uint128_t.h:46
A lock (mutex) primitive.
Definition: lock.h:36
A C++ class to handle one uploader plugin instance.
Definition: uploader.h:32
Simple wrapper for ZeroConf key/value pairs.
Definition: servus.h:43
A simple memory buffer with some helper functions.
Definition: buffer.h:43
A structure to hold the results from one compress operation.
Future< bool > f_bool_t
A future with a boolean return value.
Definition: types.h:255