aboutsummaryrefslogtreecommitdiffstats
path: root/al/eax_fx_slot_index.h
blob: 95ff93133bd812919202b59e8b95f69492c052ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef EAX_FX_SLOT_INDEX_INCLUDED
#define EAX_FX_SLOT_INDEX_INCLUDED


#include <cstddef>

#include "eax_api.h"


using EaxFxSlotIndexValue = std::size_t;


class EaxFxSlotIndex
{
public:
    EaxFxSlotIndex() noexcept = default;

    EaxFxSlotIndex(
        EaxFxSlotIndexValue index);

    EaxFxSlotIndex(
        const EaxFxSlotIndex& rhs) noexcept;

    void operator=(
        EaxFxSlotIndexValue index);

    void operator=(
        const GUID& guid);

    void operator=(
        const EaxFxSlotIndex& rhs) noexcept;


    bool has_value() const noexcept;

    EaxFxSlotIndexValue get() const;

    void reset() noexcept;

    void set(
        EaxFxSlotIndexValue index);

    void set(
        const GUID& guid);

    operator EaxFxSlotIndexValue() const;


private:
    [[noreturn]]
    static void fail(
        const char* message);


    bool has_value_{};
    EaxFxSlotIndexValue value_{};
}; // EaxFxSlotIndex


bool operator==(
    const EaxFxSlotIndex& lhs,
    const EaxFxSlotIndex& rhs) noexcept;

bool operator!=(
    const EaxFxSlotIndex& lhs,
    const EaxFxSlotIndex& rhs) noexcept;


#endif // !EAX_FX_SLOT_INDEX_INCLUDED