SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
HasRtti.h
1#pragma once
2
3#include "spark/rtti/Export.h"
4#include "spark/rtti/RttiBase.h"
5#include "spark/rtti/details/Rtti.h"
6
7// ReSharper disable once CppUnusedIncludeDirective : Used by the macros. We don't want the client to include it each time.
8#include "spark/rtti/Rtti.h"
9
10namespace spark::rtti
11{
15 class SPARK_RTTI_EXPORT HasRtti
16 {
17 public:
18 HasRtti() = default;
19 virtual ~HasRtti() = default;
20
21 HasRtti(const HasRtti& other) = default;
22 HasRtti(HasRtti&& other) noexcept = default;
23 HasRtti& operator=(const HasRtti& other) = default;
24 HasRtti& operator=(HasRtti&& other) noexcept = default;
25
29 [[nodiscard]] virtual RttiBase& rttiInstance() const = 0;
30 };
31}
32
38#define DECLARE_SPARK_RTTI(...) DETAILS_DECLARE_SPARK_RTTI(__VA_ARGS__)
39
44#define IMPLEMENT_SPARK_RTTI(ClassName) DETAILS_SPARK_RTTI_REGISTER_NAME(ClassName)
45
51#define IMPLEMENT_SPARK_RTTI_TPL(ClassName, ...) DETAILS_SPARK_RTTI_REGISTER_TPL(ClassName, __VA_ARGS__)
The class anything using the RTTI should implement.
Definition HasRtti.h:16
virtual RttiBase & rttiInstance() const =0
The abstract class used as base for the RTTI data.
Definition RttiBase.h:16