globally remove all trailing whitespace from .cpp and .hpp files missed by previous...
[ardour.git] / libs / backends / wavesaudio / wavesapi / akupara / basics.hpp
1 /*
2  *  basics.hpp
3  *  Akupara
4  *
5  *  Created by Udi on 12/19/06.
6  *  Copyright 2006 __MyCompanyName__. All rights reserved.
7  *
8  */
9 #if !defined(_AKUPARA_BASICS_HPP__INCLUDED_)
10 #define _AKUPARA_BASICS_HPP__INCLUDED_
11
12 #include "WavesPublicAPI/wstdint.h"
13
14 namespace Akupara
15 {
16         // The ultimate nothingness
17         // This is useful for writing constructors that nullify their object, and for testing nullness
18         struct null_type
19         {
20                 null_type() {}
21                 null_type(const null_type *) {} // this allows 0 to be implicitly converted to null_type
22         };
23         inline null_type null() { return null_type(); }
24         
25
26         // This is a byte, guaranteed to be unsigned regardless of your compiler's char signedness
27         typedef uint8_t byte_type;
28
29
30         // derive from this if your class needs to be noncopyable
31         class noncopyable_type
32         {
33         private:
34                 noncopyable_type(const noncopyable_type &);
35                 noncopyable_type &operator=(const noncopyable_type &);
36         public:
37                 noncopyable_type() {}
38         };
39
40
41 } // namespace Akupara
42
43
44 #if defined(__GNUC__)
45 #define AKUPARA_EXPECT_FALSE(x) __builtin_expect(x,false)
46 #define AKUPARA_EXPECT_TRUE(x)  __builtin_expect(x,true )
47 #else
48 #define AKUPARA_EXPECT_FALSE(x) x
49 #define AKUPARA_EXPECT_TRUE(x)  x
50 #endif // __GNUC__
51
52
53 #endif // _AKUPARA_BASICS_HPP__INCLUDED_