Reflection stub
This commit is contained in:
15
src/include/Reflection/Reflection.h
Normal file
15
src/include/Reflection/Reflection.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
namespace B3D{
|
||||
namespace Reflection{
|
||||
enum ReflectionType {
|
||||
TYPE_INT = 0,
|
||||
TYPE_FLOAT = 1,
|
||||
TYPE_STRING = 2,
|
||||
TYPE_VECTOR3 = 3,
|
||||
TYPE_COLOR3 = 4,
|
||||
TYPE_CFRAME = 5,
|
||||
TYPE_BOOLEAN = 6,
|
||||
TYPE_ENUM = 7
|
||||
};
|
||||
}
|
||||
}
|
||||
26
src/include/Reflection/ReflectionDataTable.h
Normal file
26
src/include/Reflection/ReflectionDataTable.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "ReflectionProperty.h"
|
||||
namespace B3D{
|
||||
namespace Instance{
|
||||
class Instance;
|
||||
}
|
||||
namespace Reflection{
|
||||
class ReflectionDataTable
|
||||
{
|
||||
public:
|
||||
ReflectionDataTable(Instance::Instance * parentInstance, std::string className);
|
||||
ReflectionDataTable::ReflectionDataTable(void);
|
||||
~ReflectionDataTable(void);
|
||||
|
||||
std::string ReflectionDataTable::getClassName(void);
|
||||
private:
|
||||
//Perhaps not stored here?
|
||||
std::string className;
|
||||
std::map<std::string, B3D::Reflection::ReflectionProperty<void*>*> propertyTable;
|
||||
Instance::Instance * parentInstance;
|
||||
};
|
||||
}
|
||||
}
|
||||
28
src/include/Reflection/ReflectionProperty.h
Normal file
28
src/include/Reflection/ReflectionProperty.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#include "Reflection.h"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <typeinfo>
|
||||
|
||||
namespace B3D{
|
||||
namespace Reflection{
|
||||
class ReflectionDataTable;
|
||||
|
||||
template<typename T>
|
||||
class ReflectionProperty
|
||||
{
|
||||
public:
|
||||
T * value;
|
||||
ReflectionType type;
|
||||
ReflectionProperty(T * value, ReflectionType type, ReflectionDataTable * containerTable, bool archivable = true, bool locked = false, bool propertyHidden = false);
|
||||
ReflectionProperty(void);
|
||||
~ReflectionProperty(void);
|
||||
private:
|
||||
std::string propertyName;
|
||||
bool archivable;
|
||||
bool locked;
|
||||
bool propertyHidden;
|
||||
ReflectionDataTable * containerTable;
|
||||
};
|
||||
}
|
||||
}
|
||||
22
src/source/Reflection/ReflectionDataTable.cpp
Normal file
22
src/source/Reflection/ReflectionDataTable.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "Reflection\ReflectionDataTable.h"
|
||||
|
||||
using namespace B3D::Reflection;
|
||||
|
||||
ReflectionDataTable::ReflectionDataTable(B3D::Instance::Instance * parentInstance, std::string className)
|
||||
{
|
||||
this->parentInstance = parentInstance;
|
||||
this->className = className;
|
||||
}
|
||||
|
||||
ReflectionDataTable::ReflectionDataTable(void)
|
||||
{
|
||||
}
|
||||
|
||||
ReflectionDataTable::~ReflectionDataTable(void)
|
||||
{
|
||||
}
|
||||
|
||||
std::string ReflectionDataTable::getClassName(void)
|
||||
{
|
||||
return className;
|
||||
}
|
||||
23
src/source/Reflection/ReflectionProperty.cpp
Normal file
23
src/source/Reflection/ReflectionProperty.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "Reflection\ReflectionProperty.h"
|
||||
using namespace B3D::Reflection;
|
||||
|
||||
template<typename T>
|
||||
ReflectionProperty<T>::ReflectionProperty(T * value, ReflectionType type, ReflectionDataTable * containerTable, bool archivable = true, bool locked = false, bool propertyHidden = false)
|
||||
{
|
||||
this->value = value;
|
||||
this->type = type;
|
||||
this->containerTable = containerTable;
|
||||
this->locked = locked;
|
||||
this->archivable = archivable;
|
||||
this->propertyHidden = propertyHidden;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
ReflectionProperty<T>::ReflectionProperty(void)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
ReflectionProperty<T>::~ReflectionProperty(void)
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user