|
|
@@ -4,8 +4,6 @@
|
|
|
#include <algorithm>
|
|
|
#include <unordered_map>
|
|
|
|
|
|
-#include <boost/type_traits.hpp>
|
|
|
-#include <boost/static_assert.hpp>
|
|
|
#include <boost/preprocessor/punctuation/comma.hpp>
|
|
|
|
|
|
#include "CmPrerequisitesUtil.h"
|
|
|
@@ -102,7 +100,7 @@ namespace CamelotFramework
|
|
|
template <class ObjectType, class DataType>
|
|
|
void setReflectableValue(ObjectType* object, const String& name, DataType& value)
|
|
|
{
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
"Invalid data type for complex field. It needs to derive from CamelotFramework::IReflectable.");
|
|
|
|
|
|
RTTIField* genericField = findField(name);
|
|
|
@@ -115,7 +113,7 @@ namespace CamelotFramework
|
|
|
template <class ObjectType, class DataType>
|
|
|
void setReflectableArrayValue(ObjectType* object, const String& name, UINT32 index, DataType& value)
|
|
|
{
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
"Invalid data type for complex field. It needs to derive from CamelotFramework::IReflectable.");
|
|
|
|
|
|
RTTIField* genericField = findField(name);
|
|
|
@@ -139,7 +137,7 @@ namespace CamelotFramework
|
|
|
template <class ObjectType, class DataType>
|
|
|
void setReflectablePtrValue(ObjectType* object, const String& name, std::shared_ptr<DataType> value)
|
|
|
{
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
"Invalid data type for complex field. It needs to derive from CamelotFramework::IReflectable.");
|
|
|
|
|
|
RTTIField* genericField = findField(name);
|
|
|
@@ -152,7 +150,7 @@ namespace CamelotFramework
|
|
|
template <class ObjectType, class DataType>
|
|
|
void setReflectablePtrArrayValue(ObjectType* object, const String& name, UINT32 index, std::shared_ptr<DataType> value)
|
|
|
{
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
"Invalid data type for complex field. It needs to derive from CamelotFramework::IReflectable.");
|
|
|
|
|
|
RTTIField* genericField = findField(name);
|
|
|
@@ -525,10 +523,10 @@ namespace CamelotFramework
|
|
|
{
|
|
|
using namespace std::placeholders;
|
|
|
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::RTTIType<Type, BaseType, MyRTTIType>, InterfaceType>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::RTTIType<Type, BaseType, MyRTTIType>, InterfaceType>::value),
|
|
|
"Class with the get/set methods must derive from CamelotFramework::RTTIType.");
|
|
|
|
|
|
- BOOST_STATIC_ASSERT_MSG(!(boost::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
+ static_assert(!(std::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
"Data type derives from IReflectable but it is being added as a plain field.");
|
|
|
|
|
|
addPlainField<ObjectType, DataType>(name, uniqueId,
|
|
|
@@ -569,10 +567,10 @@ namespace CamelotFramework
|
|
|
{
|
|
|
using namespace std::placeholders;
|
|
|
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::RTTIType<Type, BaseType, MyRTTIType>, InterfaceType>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::RTTIType<Type, BaseType, MyRTTIType>, InterfaceType>::value),
|
|
|
"Class with the get/set methods must derive from CamelotFramework::RTTIType.");
|
|
|
|
|
|
- BOOST_STATIC_ASSERT_MSG(!(boost::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
+ static_assert(!(std::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
"Data type derives from IReflectable but it is being added as a plain field.");
|
|
|
|
|
|
addPlainArrayField<ObjectType, DataType>(name, uniqueId,
|
|
|
@@ -651,7 +649,7 @@ namespace CamelotFramework
|
|
|
template<class ObjectType, class DataType>
|
|
|
void addReflectableField(const String& name, UINT32 uniqueId, boost::any getter, boost::any setter, UINT64 flags)
|
|
|
{
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
"Invalid data type for complex field. It needs to derive from CamelotFramework::IReflectable.");
|
|
|
|
|
|
RTTIReflectableField<DataType, ObjectType>* newField =
|
|
|
@@ -663,7 +661,7 @@ namespace CamelotFramework
|
|
|
template<class ObjectType, class DataType>
|
|
|
void addReflectablePtrField(const String& name, UINT32 uniqueId, boost::any getter, boost::any setter, UINT64 flags)
|
|
|
{
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
"Invalid data type for complex field. It needs to derive from CamelotFramework::IReflectable.");
|
|
|
|
|
|
if((flags & RTTI_Flag_WeakRef) == 0)
|
|
|
@@ -689,7 +687,7 @@ namespace CamelotFramework
|
|
|
void addReflectableArrayField(const String& name, UINT32 uniqueId, boost::any getter, boost::any getSize,
|
|
|
boost::any setter, boost::any setSize, UINT64 flags)
|
|
|
{
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
"Invalid data type for complex field. It needs to derive from CamelotFramework::IReflectable.");
|
|
|
|
|
|
RTTIReflectableField<DataType, ObjectType>* newField =
|
|
|
@@ -702,7 +700,7 @@ namespace CamelotFramework
|
|
|
void addReflectablePtrArrayField(const String& name, UINT32 uniqueId, boost::any getter, boost::any getSize,
|
|
|
boost::any setter, boost::any setSize, UINT64 flags)
|
|
|
{
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::IReflectable, DataType>::value),
|
|
|
"Invalid data type for complex field. It needs to derive from CamelotFramework::IReflectable.");
|
|
|
|
|
|
if((flags & RTTI_Flag_WeakRef) == 0)
|
|
|
@@ -733,7 +731,7 @@ namespace CamelotFramework
|
|
|
template<class T>
|
|
|
bool rtti_is_of_type(IReflectable* object)
|
|
|
{
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::IReflectable, T>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::IReflectable, T>::value),
|
|
|
"Invalid data type for type checking. It needs to derive from CamelotFramework::IReflectable.");
|
|
|
|
|
|
return object->getTypeId() == T::getRTTIStatic()->getRTTIId();
|
|
|
@@ -745,7 +743,7 @@ namespace CamelotFramework
|
|
|
template<class T>
|
|
|
bool rtti_is_of_type(std::shared_ptr<IReflectable> object)
|
|
|
{
|
|
|
- BOOST_STATIC_ASSERT_MSG((boost::is_base_of<CamelotFramework::IReflectable, T>::value),
|
|
|
+ static_assert((std::is_base_of<CamelotFramework::IReflectable, T>::value),
|
|
|
"Invalid data type for type checking. It needs to derive from CamelotFramework::IReflectable.");
|
|
|
|
|
|
return object->getTypeId() == T::getRTTIStatic()->getRTTIId();
|