CSEngine
Loading...
Searching...
No Matches
ReflectionRef.h
1#pragma once
2
3#include <string>
4#include <cstring>
5#include "ReflectionObject.h"
6
7namespace CSE {
8 template<class T>
10 public:
11 explicit ReflectionRef(std::string type) : m_class(std::move(type)) {}
12 explicit ReflectionRef() {
13 const char* type = T::GetClassStaticType();
14 m_class = type;
15 }
16
17 ~ReflectionRef() = default;
18
19 bool IsSameClass(const ReflectionObject* object) const {
20 if(object == nullptr) return false;
21 return std::strcmp(m_class.c_str(), object->GetClassType()) == 0;
22 }
23
24 private:
25 std::string m_class;
26 };
27}