Refureku v2.2.0
C++17 runtime reflection library.
ClassTemplateInstantiation.h
1
8#pragma once
9
10#include "Refureku/TypeInfo/Archetypes/Struct.h"
11
12namespace rfk
13{
14 //Forward declarations
15 class ClassTemplate;
16 class TemplateArgument;
17 class ClassTemplateInstantiation;
18
19 /* A struct template instantiation and a class template instantiation contain exactly the same data. Alias for convenience. */
20 using StructTemplateInstantiation = ClassTemplateInstantiation;
21
23 {
24 public:
25 REFUREKU_API ClassTemplateInstantiation(char const* name,
26 std::size_t id,
27 std::size_t memorySize,
28 bool isClass,
29 Archetype const& classTemplate) noexcept;
30 REFUREKU_API ~ClassTemplateInstantiation() noexcept;
31
37 RFK_NODISCARD REFUREKU_API ClassTemplate const& getClassTemplate() const noexcept;
38
47 RFK_NODISCARD REFUREKU_API TemplateArgument const& getTemplateArgumentAt(std::size_t index) const noexcept;
48
54 RFK_NODISCARD REFUREKU_API std::size_t getTemplateArgumentsCount() const noexcept;
55
68 void* userData) const;
69
75 REFUREKU_API void addTemplateArgument(TemplateArgument const& argument) noexcept;
76
77 private:
78 //Forward declaration
79 class ClassTemplateInstantiationImpl;
80
81 RFK_GEN_GET_PIMPL(ClassTemplateInstantiationImpl, Entity::getPimpl())
82 };
83}
Definition: Archetype.h:16
Definition: ClassTemplate.h:24
Definition: ClassTemplateInstantiation.h:23
RFK_NODISCARD REFUREKU_API ClassTemplate const & getClassTemplate() const noexcept
Get the class template this instantiation is based on.
RFK_NODISCARD REFUREKU_API TemplateArgument const & getTemplateArgumentAt(std::size_t index) const noexcept
Retrieve the template argument at the given index. If index is greater or equal to getTemplateArgumen...
REFUREKU_API bool foreachTemplateArgument(Visitor< TemplateArgument > visitor, void *userData) const
Execute the given visitor on all template arguments of this class.
REFUREKU_API void addTemplateArgument(TemplateArgument const &argument) noexcept
Add a template argument to this instantiation.
RFK_NODISCARD REFUREKU_API std::size_t getTemplateArgumentsCount() const noexcept
Get the total number of template arguments in this instantiation.
Definition: Entity.h:29
Definition: Struct.h:40
Definition: TemplateArgument.h:19
Definition: Allocator.h:16
bool(*)(T const &value, void *userData) Visitor
Visitor function.
Definition: Visitor.h:21