| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #include "Reflection/BsRTTIField.h"
- #include "Error/BsException.h"
- namespace bs
- {
- void RTTIField::checkIsPlain(bool array)
- {
- if(!isPlainType())
- {
- BS_EXCEPT(InternalErrorException,
- "Invalid field type. Needed: Plain type. Got: " + toString(mIsVectorType) + ", " +
- toString(isPlainType()) + ", " + toString(isReflectableType()) + ", " + toString(isDataBlockType()) + ", " + toString(isReflectablePtrType()));
- }
- checkIsArray(array);
- }
- void RTTIField::checkIsDataBlock()
- {
- if(!isDataBlockType())
- {
- BS_EXCEPT(InternalErrorException,
- "Invalid field type. Needed: Data block. Got: " + toString(mIsVectorType) + ", " +
- toString(isPlainType()) + ", " + toString(isReflectableType()) + ", " + toString(isDataBlockType()) + ", " + toString(isReflectablePtrType()));
- }
- }
- void RTTIField::checkIsComplex(bool array)
- {
- if(!isReflectableType())
- {
- BS_EXCEPT(InternalErrorException,
- "Invalid field type. Needed: Complex type. Got: " + toString(mIsVectorType) + ", " +
- toString(isPlainType()) + ", " + toString(isReflectableType()) + ", " + toString(isDataBlockType()) + ", " + toString(isReflectablePtrType()));
- }
- checkIsArray(array);
- }
- void RTTIField::checkIsComplexPtr(bool array)
- {
- if(!isReflectablePtrType())
- {
- BS_EXCEPT(InternalErrorException,
- "Invalid field type. Needed: Complex ptr type. Got: " + toString(mIsVectorType) + ", " +
- toString(isPlainType()) + ", " + toString(isReflectableType()) + ", " + toString(isDataBlockType()) + ", " + toString(isReflectablePtrType()));
- }
- checkIsArray(array);
- }
- void RTTIField::checkIsArray(bool array)
- {
- if(array && !mIsVectorType)
- {
- BS_EXCEPT(InternalErrorException,
- "Invalid field type. Needed an array type but got a single type.");
- }
- if(!array && mIsVectorType)
- {
- BS_EXCEPT(InternalErrorException,
- "Invalid field type. Needed a single type but got an array type.");
- }
- }
- }
|