Refureku v2.2.0
C++17 runtime reflection library.
EnumValue.h
1
8#pragma once
9
10#include <type_traits>
11
12#include "Refureku/TypeInfo/Entity/Entity.h"
13#include "Refureku/Misc/FundamentalTypes.h"
14#include "Refureku/Containers/Vector.h"
15
16namespace rfk
17{
18 class EnumValue final : public Entity
19 {
20 public:
21 REFUREKU_INTERNAL EnumValue(char const* name,
22 std::size_t id,
23 int64 value,
24 Entity const* outerEntity = nullptr) noexcept;
25 REFUREKU_INTERNAL EnumValue(EnumValue&&) noexcept;
26 REFUREKU_INTERNAL ~EnumValue() noexcept;
27
35 template <typename T = int64>
36 RFK_NODISCARD T getValue() const noexcept;
37
43 RFK_NODISCARD REFUREKU_API int64 getValue() const noexcept;
44
45 protected:
46 //Forward declaration
47 class EnumValueImpl;
48
49 RFK_GEN_GET_PIMPL(EnumValueImpl, Entity::getPimpl())
50 };
51
52 REFUREKU_TEMPLATE_API(rfk::Allocator<EnumValue const*>);
53 REFUREKU_TEMPLATE_API(rfk::Vector<EnumValue const*, rfk::Allocator<EnumValue const*>>);
54
55 #include "Refureku/TypeInfo/Archetypes/EnumValue.inl"
56}
Definition: Allocator.h:19
Definition: Entity.h:29
Definition: EnumValue.h:19
RFK_NODISCARD T getValue() const noexcept
Cast the enum value as the provided template type.
Definition: Vector.h:19
Definition: Allocator.h:16