YSE sound engine  1.0
cross platform sound engine
 All Classes Namespaces Functions Pages
types.hpp
1 /*
2  ==============================================================================
3 
4  types.hpp
5  Created: 27 Jan 2014 7:16:37pm
6  Author: yvan
7 
8  ==============================================================================
9 */
10 
11 #ifndef TYPES_HPP_INCLUDED
12 #define TYPES_HPP_INCLUDED
13 
14 #include "defines.hpp"
15 #include <atomic>
16 
17 /* please use these variable types, at the very least within the library.
18 They make it easier to implement platform independent code later on.
19 */
20 
21 typedef bool Bool ;
22 typedef char Char8;
23 typedef wchar_t Char ;
24 typedef float Flt ;
25 typedef double Dbl ;
26 typedef PLATFORM(signed __int8 , int8_t ) I8 ;
27 typedef PLATFORM(unsigned __int8 , uint8_t ) U8 , Byte ;
28 typedef PLATFORM(signed __int16 , int16_t ) I16, Short ;
29 typedef PLATFORM(unsigned __int16, uint16_t) U16, UShort;
30 typedef PLATFORM(signed __int32 , int32_t ) I32, Int ;
31 typedef PLATFORM(unsigned __int32, uint32_t) U32, UInt ;
32 typedef PLATFORM(signed __int64 , int64_t ) I64, Long ;
33 typedef PLATFORM(unsigned __int64, uint64_t) U64, ULong ;
34 
35 
36 // thread safe versions of the most used variable types (a stands for atomic)
37 typedef std::atomic<Bool> aBool;
38 typedef std::atomic<Int > aInt ;
39 typedef std::atomic<UInt> aUInt;
40 typedef std::atomic<Flt > aFlt ;
41 typedef std::atomic<Byte> aByte;
42 
43 // shorthand macro for iterating a container object. Can be used if
44 // the container has a size function. All containers within YSE should
45 // be constructed so that this function works.
46 #define FOREACH(T) for (UInt i = 0; i < T.size(); i++)
47 #define FOREACH_D(D, T) for (UInt D = 0; D < T.size(); D++)
48 
49 #endif // TYPES_HPP_INCLUDED