Move EAX files to their own sub-directory
[openal-soft.git] / al / eax / fx_slot_index.h
blob63dba0372a1b890d17b32435a17666800c5d7682
1 #ifndef EAX_FX_SLOT_INDEX_INCLUDED
2 #define EAX_FX_SLOT_INDEX_INCLUDED
5 #include <cstddef>
7 #include "aloptional.h"
8 #include "api.h"
11 using EaxFxSlotIndexValue = std::size_t;
13 class EaxFxSlotIndex : public al::optional<EaxFxSlotIndexValue>
15 public:
16 using al::optional<EaxFxSlotIndexValue>::optional;
18 EaxFxSlotIndex& operator=(const EaxFxSlotIndexValue &value) { set(value); return *this; }
19 EaxFxSlotIndex& operator=(const GUID &guid) { set(guid); return *this; }
21 void set(EaxFxSlotIndexValue index);
22 void set(const GUID& guid);
24 private:
25 [[noreturn]]
26 static void fail(const char *message);
27 }; // EaxFxSlotIndex
29 inline bool operator==(const EaxFxSlotIndex& lhs, const EaxFxSlotIndex& rhs) noexcept
31 if(lhs.has_value() != rhs.has_value())
32 return false;
33 if(lhs.has_value())
34 return *lhs == *rhs;
35 return true;
38 inline bool operator!=(const EaxFxSlotIndex& lhs, const EaxFxSlotIndex& rhs) noexcept
39 { return !(lhs == rhs); }
41 #endif // !EAX_FX_SLOT_INDEX_INCLUDED