Kaynağa Gözat

More documentation

Marko Pintera 11 yıl önce
ebeveyn
işleme
fa58173211

+ 50 - 7
CamelotUtility/Include/CmRTTIField.h

@@ -18,15 +18,20 @@ namespace CamelotFramework
 	/**
 	 * @brief	Types of fields we can serialize:
 	 * 			
-	 * - Plain - Native data types, POD (Plain old data) structures, or in general types we don't want to (or can't) inherit from IReflectable. 
+	 * - Plain - Native data types, POD (Plain old data) structures, or in general types we don't want to (or can't) inherit from IReflectable.   
+	 *			 Type must be copyable by memcpy.
 	 *			  
 	 * - DataBlock - Array of bytes of a certain size. When returning a data block you may specify if its managed or unmanaged.  
 	 *				 Managed data blocks have their buffers deleted after they go out of scope. This is useful if you need to return some
 	 *				 temporary data. On the other hand if the data in the block belongs to your class, and isn't temporary, keep the data unmanaged.
 	 *				 
-	 * - Reflectable - Field that is of IReflectable type. Cannot be a pointer to IReflectable and must be actual value type. 
+	 * - Reflectable - Field that is of IReflectable type. Cannot be a pointer to IReflectable and must be actual value type.   
+	 *				   Type and its fields are serialized recursively. Supports versioning so you may add/remove fields from the type
+	 *				   without breaking previously serialized data.
 	 * 
-	 * - ReflectablePtr - A pointer to IReflectable.
+	 * - ReflectablePtr - A pointer to IReflectable. Same as "Reflectable" except that data isn't serialized as a value type,  
+	 *					  but as a pointer, which may be referenced by multiple other instances. All references are saved upon
+	 *					  serialization and restored upon deserialization.
 	 */
 	enum SerializableFieldType
 	{
@@ -55,7 +60,16 @@ namespace CamelotFramework
 	};
 
 	/**
-	 * @brief	Structure that keeps meta-data concerning a single class field. 
+	 * @brief	Structure that keeps meta-data concerning a single class field. You can use
+	 * 			this data for setting and getting values for that field on a specific class instance.
+	 * 			
+	 *			Class also contains an unique field name, and an unique field ID. Fields may contain
+	 *			single types or an array of types. See "SerializableFieldType" for information about 
+	 *			specific field types.
+	 * 			
+	 * @note	Most of the methods for retrieving and setting data accept "void *" for both
+	 * 			the data and the owning class instance. It is up to the caller to ensure that
+	 * 			pointer is of proper type.
 	 */
 	struct CM_UTILITY_EXPORT RTTIField
 	{
@@ -76,32 +90,61 @@ namespace CamelotFramework
 		bool isReflectableType() { return mType == SerializableFT_Reflectable; }
 		bool isReflectablePtrType() { return mType == SerializableFT_ReflectablePtr; }
 		
+		/**
+		 * @brief	Returns flags that were set in the field meta-data.
+		 */
 		UINT64 getFlags() const { return mFlags; }
 
+		/**
+		 * @brief	Gets the size of an array contained by the field, if the field
+		 * 			represents an array. Throws exception if field is not an array.
+		 */
 		virtual UINT32 getArraySize(void* object) = 0;
+
+		/**
+		 * @brief	Changes the size of an array contained by the field, if the field
+		 * 			represents an array. Throws exception if field is not an array.
+		 */
 		virtual void setArraySize(void* object, UINT32 size) = 0;
 
+		/**
+		 * @brief	Returns the type id for the type used in this field.
+		 */
 		virtual UINT32 getTypeSize() = 0;
+
+		/**
+		 * @brief	Query if the field has dynamic size. 
+		 *
+		 * @note	Field should have dynamic size if:
+		 * 			 - The field can have varying size  
+		 * 			 - The field size is over 255  
+		 * 			 
+		 * 			Types like integers, floats, bools, POD structs dont have dynamic size.
+		 * 			Types like strings, vectors, maps do.
+		 * 			
+		 *			If your type has a static size but that size exceeds 255 bytes you also need to
+		 *			use dynamic field size. (You will be warned during compilation if you don't follow this rule)
+		 */
 		virtual bool hasDynamicSize() = 0;
 
 		/**
 		 * @brief	Throws an exception if this field doesn't contain a plain value.
 		 *
-		 * @param	array	If true then the field must support plain array types.
+		 * @param	array	If true then the field must support plain array type.
 		 */
 		void checkIsPlain(bool array);
 
 		/**
 		 * @brief	Throws an exception if this field doesn't contain a complex value.
 		 *
-		 * @param	array	If true then the field must support complex array types.
+		 * @param	array	If true then the field must support complex array type.
 		 */
 		void checkIsComplex(bool array);
 
 		/**
 		 * @brief	Throws an exception if this field doesn't contain a complex pointer value.
 		 *
-		 * @param	array	If true then the field must support complex array types.
+		 * @param	array	If true then the field must support complex pointer array type.
 		 */
 		void checkIsComplexPtr(bool array);
 

+ 45 - 3
CamelotUtility/Include/CmRTTIManagedDataBlockField.h

@@ -6,16 +6,37 @@
 
 namespace CamelotFramework
 {
+	/**
+	 * @brief	Base class containing common functionality for a managed data block class field. 
+	 * 			
+	 * @note	Managed data blocks are just blocks of memory that may, or may not be released
+	 * 			automatically when they are no longer referenced. They are useful when wanting to
+	 * 			return some temporary data only for serialization purposes.
+	 */
 	struct RTTIManagedDataBlockFieldBase : public RTTIField
 	{
 		boost::any mCustomAllocator;
 
+		/**
+		 * @brief	Retrieves a managed data block from the specified instance.
+		 */
 		virtual ManagedDataBlock getValue(void* object) = 0;
+
+		/**
+		 * @brief	Sets a managed data block on the specified instance.
+		 */
 		virtual void setValue(void* object, ManagedDataBlock value) = 0;
 
+		/**
+		 * @brief	Allocate memory for the managed data block. Used primarily
+		 * 			to allocate memory before sending it to "setValue" method.
+		 */
 		virtual UINT8* allocate(void* object, UINT32 bytes) = 0;
 	};
 
+	/**
+	 * @brief	Class containing a managed data block field containing a specific type.
+	 */
 	template <class DataType, class ObjectType>
 	struct RTTIManagedDataBlockField : public RTTIManagedDataBlockFieldBase
 	{
@@ -27,9 +48,9 @@ namespace CamelotFramework
 		 * 						identifier we want a small data type that can be used for efficiently
 		 * 						serializing data to disk and similar. It is primarily used for compatibility
 		 * 						between different versions of serialized data.
-		 * @param	getter  	The getter method for the field. Cannot be null. Must be a specific signature: SerializableDataBlock(ObjectType*)
-		 * @param	setter  	The setter method for the field. Can be null. Must be a specific signature: void(ObjectType*, SerializableDataBlock)	
-		 * @param	flags		Various flags you can use to specialize how systems handle this field
+		 * @param	getter  	The getter method for the field. Must be a specific signature: SerializableDataBlock(ObjectType*)
+		 * @param	setter  	The setter method for the field. Must be a specific signature: void(ObjectType*, SerializableDataBlock)	
+		 * @param	flags		Various flags you can use to specialize how systems handle this field. See "RTTIFieldFlag".
 		 * @param	customAllocator (optional) Custom allocator that will be used when de-serializing DataBlock memory.
 		 */
 		void initSingle(const String& name, UINT16 uniqueId, boost::any getter, boost::any setter, UINT64 flags, boost::any customAllocator = boost::any())
@@ -38,28 +59,43 @@ namespace CamelotFramework
 			mCustomAllocator = customAllocator;
 		}
 
+		/**
+		 * @copydoc RTTIField::getTypeSize
+		 */
 		virtual UINT32 getTypeSize()
 		{
 			return 0; // Data block types don't store size the conventional way
 		}
 
+		/**
+		 * @copydoc RTTIField::hasDynamicSize
+		 */
 		virtual bool hasDynamicSize()
 		{
 			return true;
 		}
 
+		/**
+		 * @copydoc RTTIField::getArraySize
+		 */
 		virtual UINT32 getArraySize(void* object)
 		{
 			CM_EXCEPT(InternalErrorException, 
 				"Data block types don't support arrays.");
 		}
 
+		/**
+		 * @copydoc RTTIField::setArraySize
+		 */
 		virtual void setArraySize(void* object, UINT32 size)
 		{
 			CM_EXCEPT(InternalErrorException, 
 				"Data block types don't support arrays.");
 		}
 
+		/**
+		 * @copydoc RTTIManagedDataBlockFieldBase::getValue
+		 */
 		virtual ManagedDataBlock getValue(void* object)
 		{
 			ObjectType* castObj = static_cast<ObjectType*>(object);
@@ -67,6 +103,9 @@ namespace CamelotFramework
 			return f(castObj);
 		}
 
+		/**
+		 * @copydoc RTTIManagedDataBlockFieldBase::setValue
+		 */
 		virtual void setValue(void* object, ManagedDataBlock value)
 		{
 			ObjectType* castObj = static_cast<ObjectType*>(object);
@@ -74,6 +113,9 @@ namespace CamelotFramework
 			f(castObj, value);
 		}
 
+		/**
+		 * @copydoc RTTIManagedDataBlockFieldBase::allocate
+		 */
 		virtual UINT8* allocate(void* object, UINT32 bytes)
 		{
 			if(mCustomAllocator.empty())

+ 66 - 20
CamelotUtility/Include/CmRTTIPlainField.h

@@ -6,6 +6,12 @@
 
 namespace CamelotFramework
 {
+	/**
+	 * @brief	Base class containing common functionality for a plain class field. 
+	 * 			
+	 * @note	Plain fields are considered those that may be serialized directly by copying their memory.
+	 * 			(All built-in types, strings, etc.)
+	 */
 	struct RTTIPlainFieldBase : public RTTIField
 	{
 		/**
@@ -24,22 +30,36 @@ namespace CamelotFramework
 					"SerializableSimpleTypeFieldBase::checkType()");
 			}*/
 		}
-
+		
+		/**
+		 * @copydoc RTTIField::getTypeId
+		 */
 		virtual UINT32 getTypeId()
 		{
 			return 0;
 		}
 
+		/**
+		 * @copydoc RTTIField::hasDynamicSize
+		 */
 		virtual bool hasDynamicSize()
 		{
 			return false;
 		}
 
+		/**
+		 * @brief	Gets the dynamic size of the object. If object has no dynamic size,
+		 * 			static size of the object is returned.
+		 */
 		virtual UINT32 getDynamicSize(void* object)
 		{
 			return 0;
 		}
 
+		/**
+		 * @brief	Gets the dynamic size of an array element. If the element has no dynamic size,
+		 * 			static size of the element is returned.
+		 */
 		virtual UINT32 getArrayElemDynamicSize(void* object, int index)
 		{
 			return 0;
@@ -48,8 +68,6 @@ namespace CamelotFramework
 		/**
 		 * @brief	Retrieves the value from the provided field of the provided object, and copies
 		 * 			it into the buffer. WARNING - It does not check if buffer is large enough.
-		 * 			
-		 * @note	Size of the data copied to buffer is mType.size
 		 */
 		virtual void toBuffer(void* object, void* buffer) = 0;
 
@@ -57,8 +75,6 @@ namespace CamelotFramework
 		 * @brief	Retrieves the value at the specified array index on the provided field of the
 		 * 			provided object, and copies it into the buffer. WARNING - It does not check if buffer
 		 * 			is large enough.
-		 * 			
-		 * @note	Size of the data copied to buffer is mType.size
 		 */
 		virtual void arrayElemToBuffer(void* object, int index, void* buffer) = 0;
 
@@ -66,8 +82,6 @@ namespace CamelotFramework
 		 * @brief	Sets the value on the provided field of the provided object. Value is copied from the buffer. 
 		 * 			WARNING - It does not check the value in the buffer in any way. You must make sure buffer points
 		 * 			to the proper location and contains the proper type.
-		 * 			
-		 * @note	Size of the data copied from buffer is mType.size
 		 */
 		virtual void fromBuffer(void* object, void* buffer) = 0;
 
@@ -76,27 +90,27 @@ namespace CamelotFramework
 		 * 			object. Value is copied from the buffer. WARNING - It does not check the value in the
 		 * 			buffer in any way. You must make sure buffer points to the proper location and
 		 * 			contains the proper type.
-		 * 			
-		 * 	@note	Size of the data copied from buffer is mType.size.
 		 */
 		virtual void arrayElemFromBuffer(void* object, int index, void* buffer) = 0;
 	};
 
+	/**
+	 * @brief	Represents a plain class field containing a specific type.
+	 */
 	template <class DataType, class ObjectType>
 	struct RTTIPlainField : public RTTIPlainFieldBase
 	{
 		/**
-		 * @brief	Initializes a field with one of the built-in types. You may provide your own type ID,
-		 * 			just make sure it doesn't conflict with any standard types.
+		 * @brief	Initializes a plain field containing a single value.
 		 *
 		 * @param	name		Name of the field.
 		 * @param	uniqueId	Unique identifier for this field. Although name is also a unique
 		 * 						identifier we want a small data type that can be used for efficiently
 		 * 						serializing data to disk and similar. It is primarily used for compatibility
 		 * 						between different versions of serialized data.
-		 * @param	getter  	The getter method for the field. Cannot be null. Must be a specific signature: DataType(ObjectType*).
-		 * @param	setter  	The setter method for the field. Can be null. Must be a specific signature: void(ObjectType*, DataType)
-		 * @param	flags		Various flags you can use to specialize how systems handle this field
+		 * @param	getter  	The getter method for the field. Must be a specific signature: DataType(ObjectType*).
+		 * @param	setter  	The setter method for the field. Must be a specific signature: void(ObjectType*, DataType)
+		 * @param	flags		Various flags you can use to specialize how outside systems handle this field. See "RTTIFieldFlag".
 		 */
 		void initSingle(const String& name, UINT16 uniqueId, boost::any getter, boost::any setter, UINT64 flags)
 		{
@@ -110,19 +124,18 @@ namespace CamelotFramework
 		}
 
 		/**
-		 * @brief	Initializes a VECTOR field with one of the built-in types. You may provide your own
-		 * 			type ID, just make sure it doesn't conflict with any standard types.
+		 * @brief	Initializes a plain field containing multiple values in an array. 
 		 *
 		 * @param	name		Name of the field.
 		 * @param	uniqueId	Unique identifier for this field. Although name is also a unique
 		 * 						identifier we want a small data type that can be used for efficiently
 		 * 						serializing data to disk and similar. It is primarily used for compatibility
 		 * 						between different versions of serialized data.
-		 * @param	getter  	The getter method for the field. Cannot be null. Must be a specific signature: DataType(ObjectType*, UINT32)
-		 * @param	getSize 	Getter method that returns the size of an array. Cannot be null. Must be a specific signature: UINT32(ObjectType*)
-		 * @param	setter  	The setter method for the field. Can be null. Must be a specific signature: void(ObjectType*, UINT32, DataType)
+		 * @param	getter  	The getter method for the field. Must be a specific signature: DataType(ObjectType*, UINT32)
+		 * @param	getSize 	Getter method that returns the size of an array. Must be a specific signature: UINT32(ObjectType*)
+		 * @param	setter  	The setter method for the field. Must be a specific signature: void(ObjectType*, UINT32, DataType)
 		 * @param	setSize 	Setter method that allows you to resize an array. Can be null. Must be a specific signature: void(ObjectType*, UINT32)
-		 * @param	flags		Various flags you can use to specialize how systems handle this field
+		 * @param	flags		Various flags you can use to specialize how outside systems handle this field. See "RTTIFieldFlag".
 		 */
 		void initArray(const String& name, UINT16 uniqueId, boost::any getter, 
 			boost::any getSize, boost::any setter, boost::any setSize, UINT64 flags)
@@ -136,21 +149,33 @@ namespace CamelotFramework
 			initAll(getter, setter, getSize, setSize, name, uniqueId, true, SerializableFT_Plain, flags);
 		}
 
+		/**
+		 * @copydoc RTTIField::getTypeSize
+		 */
 		virtual UINT32 getTypeSize()
 		{
 			return sizeof(DataType);
 		}
 
+		/**
+		 * @copydoc RTTIPlainFieldBase::getTypeId
+		 */
 		virtual UINT32 getTypeId()
 		{
 			return RTTIPlainType<DataType>::id;
 		}
 
+		/**
+		 * @copydoc RTTIPlainFieldBase::hasDynamicSize
+		 */
 		virtual bool hasDynamicSize()
 		{
 			return RTTIPlainType<DataType>::hasDynamicSize != 0;
 		}
 
+		/**
+		 * @copydoc RTTIPlainFieldBase::getDynamicSize
+		 */
 		virtual UINT32 getDynamicSize(void* object)
 		{
 			checkIsArray(false);
@@ -164,6 +189,9 @@ namespace CamelotFramework
 			return RTTIPlainType<DataType>::getDynamicSize(value);
 		}
 
+		/**
+		 * @copydoc RTTIPlainFieldBase::getArrayElemDynamicSize
+		 */
 		virtual UINT32 getArrayElemDynamicSize(void* object, int index)
 		{
 			checkIsArray(true);
@@ -177,6 +205,9 @@ namespace CamelotFramework
 			return RTTIPlainType<DataType>::getDynamicSize(value);
 		}
 
+		/**
+		 * @copydoc RTTIPlainField::getArraySize
+		 */
 		virtual UINT32 getArraySize(void* object)
 		{
 			checkIsArray(true);
@@ -186,6 +217,9 @@ namespace CamelotFramework
 			return f(castObject);
 		}
 
+		/**
+		 * @copydoc RTTIPlainField::setArraySize
+		 */
 		virtual void setArraySize(void* object, UINT32 size)
 		{
 			checkIsArray(true);
@@ -201,6 +235,9 @@ namespace CamelotFramework
 			f(castObject, size);
 		}
 
+		/**
+		 * @copydoc RTTIPlainFieldBase::toBuffer
+		 */
 		virtual void toBuffer(void* object, void* buffer)
 		{
 			checkIsArray(false);
@@ -214,6 +251,9 @@ namespace CamelotFramework
 			RTTIPlainType<DataType>::toMemory(value, (char*)buffer);
 		}
 
+		/**
+		 * @copydoc RTTIPlainFieldBase::arrayElemToBuffer
+		 */
 		virtual void arrayElemToBuffer(void* object, int index, void* buffer)
 		{
 			checkIsArray(true);
@@ -227,6 +267,9 @@ namespace CamelotFramework
 			RTTIPlainType<DataType>::toMemory(value, (char*)buffer);
 		}
 
+		/**
+		 * @copydoc RTTIPlainFieldBase::fromBuffer
+		 */
 		virtual void fromBuffer(void* object, void* buffer)
 		{
 			checkIsArray(false);
@@ -247,6 +290,9 @@ namespace CamelotFramework
 			f(castObject, value);
 		}
 
+		/**
+		 * @copydoc RTTIPlainFieldBase::arrayElemFromBuffer
+		 */
 		virtual void arrayElemFromBuffer(void* object, int index, void* buffer)
 		{
 			checkIsArray(true);

+ 74 - 10
CamelotUtility/Include/CmRTTIReflectableField.h

@@ -6,33 +6,73 @@
 
 namespace CamelotFramework
 {
+	/**
+	 * @brief	Base class containing common functionality for a reflectable class field. 
+	 * 			
+	 * @note	Reflectable fields are fields containing complex types deriving from IReflectable. They
+	 * 			are serialized recursively and you may add/remove fields from them without breaking
+	 * 			the serialized data.
+	 */
 	struct RTTIReflectableFieldBase : public RTTIField
 	{
+		/**
+		 * @brief	Retrieves the IReflectable value from the provided instance.
+		 * 			
+		 * @note	Field type must not be an array.
+		 */
 		virtual IReflectable& getValue(void* object) = 0;
+
+		/**
+		 * @brief	Retrieves the IReflectable value from an array on the provided instance
+		 * 			and index.
+		 * 			
+		 * @note	Field type must be an array.
+		 */
 		virtual IReflectable& getArrayValue(void* object, UINT32 index) = 0;
 
+		/**
+		 * @brief	Sets the IReflectable value in the provided instance.
+		 * 			
+		 * @note	Field type must not be an array.
+		 */
 		virtual void setValue(void* object, IReflectable& value) = 0;
+
+		/**
+		 * @brief	Sets the IReflectable value in an array on the provided instance
+		 * 			and index.
+		 * 			
+		 * @note	Field type must be an array.
+		 */
 		virtual void setArrayValue(void* object, UINT32 index, IReflectable& value) = 0;
 
+		/**
+		 * @brief	Creates a new object of the field type.
+		 */
 		virtual std::shared_ptr<IReflectable> newObject() = 0;
 
+		/**
+		 * @copydoc RTTIField::hasDynamicSize
+		 */
 		virtual bool hasDynamicSize() { return true; }
 	};
 
+	/**
+	 * @brief	Class containing a reflectable field containing a specific type.
+	 */
 	template <class DataType, class ObjectType>
 	struct RTTIReflectableField : public RTTIReflectableFieldBase
 	{
 		/**
-		 * @brief	Initializes a field with a data type implementing IReflectable interface. 
+		 * @brief	Initializes a field containing a single data type implementing IReflectable interface. 
 		 *
 		 * @param	name		Name of the field.
 		 * @param	uniqueId	Unique identifier for this field. Although name is also a unique
 		 * 						identifier we want a small data type that can be used for efficiently
 		 * 						serializing data to disk and similar. It is primarily used for compatibility
 		 * 						between different versions of serialized data.
-		 * @param	getter  	The getter method for the field. Cannot be null. Must be a specific signature: DataType&(ObjectType*)
-		 * @param	setter  	The setter method for the field. Can be null. Must be a specific signature: void(ObjectType*, DataType)
-		 * @param	flags		Various flags you can use to specialize how systems handle this field
+		 * @param	getter  	The getter method for the field. Must be a specific signature: DataType&(ObjectType*)
+		 * @param	setter  	The setter method for the field. Must be a specific signature: void(ObjectType*, DataType)
+		 * @param	flags		Various flags you can use to specialize how systems handle this field. See "RTTIFieldFlag".
 		 */
 		void initSingle(const String& name, UINT16 uniqueId, boost::any getter, boost::any setter, UINT64 flags)
 		{
@@ -40,18 +80,18 @@ namespace CamelotFramework
 		}
 
 		/**
-		 * @brief	Initializes a VECTOR field with data type implementing by IReflectable interface.
+		 * @brief	Initializes a field containing an array of data types implementing IReflectable interface.
 		 *
 		 * @param	name		Name of the field.
 		 * @param	uniqueId	Unique identifier for this field. Although name is also a unique
 		 * 						identifier we want a small data type that can be used for efficiently
 		 * 						serializing data to disk and similar. It is primarily used for compatibility
 		 * 						between different versions of serialized data.
-		 * @param	getter  	The getter method for the field. Cannot be null. Must be a specific signature: DataType&(ObjectType*, UINT32)
-		 * @param	getSize 	Getter method that returns the size of an array. Cannot be null. Must be a specific signature: UINT32(ObjectType*)
-		 * @param	setter  	The setter method for the field. Can be null. Must be a specific signature: void(ObjectType*, UINT32, DataType)
-		 * @param	setSize 	Setter method that allows you to resize an array. Can be null. Can be null. Must be a specific signature: void(ObjectType*, UINT32)
-		 * @param	flags		Various flags you can use to specialize how systems handle this field
+		 * @param	getter  	The getter method for the field. Must be a specific signature: DataType&(ObjectType*, UINT32)
+		 * @param	getSize 	Getter method that returns the size of an array. Must be a specific signature: UINT32(ObjectType*)
+		 * @param	setter  	The setter method for the field. Must be a specific signature: void(ObjectType*, UINT32, DataType)
+		 * @param	setSize 	Setter method that allows you to resize an array. Must be a specific signature: void(ObjectType*, UINT32)
+		 * @param	flags		Various flags you can use to specialize how systems handle this field. See "RTTIFieldFlag".
 		 */
 		void initArray(const String& name, UINT16 uniqueId, boost::any getter, 
 			boost::any getSize, boost::any setter, boost::any setSize, UINT64 flags)
@@ -59,11 +99,17 @@ namespace CamelotFramework
 			initAll(getter, setter, getSize, setSize, name, uniqueId, true, SerializableFT_Reflectable, flags);
 		}
 
+		/**
+		 * @copydoc RTTIField::getTypeSize
+		 */
 		virtual UINT32 getTypeSize()
 		{
 			return 0; // Complex types don't store size the conventional way
 		}
 
+		/**
+		 * @copydoc RTTIReflectableFieldBase::getValue
+		 */
 		virtual IReflectable& getValue(void* object)
 		{
 			checkIsArray(false);
@@ -75,6 +121,9 @@ namespace CamelotFramework
 			return castDataType;
 		}
 
+		/**
+		 * @copydoc RTTIReflectableFieldBase::getArrayValue
+		 */
 		virtual IReflectable& getArrayValue(void* object, UINT32 index)
 		{
 			checkIsArray(true);
@@ -86,6 +135,9 @@ namespace CamelotFramework
 			return castDataType;
 		}
 
+		/**
+		 * @copydoc RTTIReflectableFieldBase::setValue
+		 */
 		virtual void setValue(void* object, IReflectable& value)
 		{
 			checkIsArray(false);
@@ -102,6 +154,9 @@ namespace CamelotFramework
 			f(castObjType, castDataObj);
 		}
 
+		/**
+		 * @copydoc RTTIReflectableFieldBase::setArrayValue
+		 */
 		virtual void setArrayValue(void* object, UINT32 index, IReflectable& value)
 		{
 			checkIsArray(true);
@@ -118,6 +173,9 @@ namespace CamelotFramework
 			f(castObjType, index, castDataObj);
 		}
 
+		/**
+		 * @copydoc RTTIField::getArraySize
+		 */
 		virtual UINT32 getArraySize(void* object)
 		{
 			checkIsArray(true);
@@ -127,6 +185,9 @@ namespace CamelotFramework
 			return f(castObject);
 		}
 
+		/**
+		 * @copydoc RTTIField::setArraySize
+		 */
 		virtual void setArraySize(void* object, UINT32 size)
 		{
 			checkIsArray(true);
@@ -142,6 +203,9 @@ namespace CamelotFramework
 			f(castObject, size);
 		}
 
+		/**
+		 * @copydoc RTTIReflectableFieldBase::newObject
+		 */
 		virtual std::shared_ptr<IReflectable> newObject()
 		{
 			return DataType::getRTTIStatic()->newRTTIObject();

+ 92 - 10
CamelotUtility/Include/CmRTTIReflectablePtrField.h

@@ -6,35 +6,87 @@
 
 namespace CamelotFramework
 {
+	/**
+	 * @brief	Base class containing common functionality for a reflectable pointer class field. 
+	 * 			
+	 * @note	Reflectable fields are fields containing complex types deriving from IReflectable. They
+	 * 			are serialized recursively and you may add/remove fields from them without breaking
+	 * 			the serialized data.
+	 * 			
+	 *			ReflectablePtr field are different from Reflectable fields because other types may reference
+	 *			the same Reflectable object using a ReflectablePtr, while normal Reflectable fields are only
+	 *			referenced by a single field they're declared on.
+	 */
 	struct RTTIReflectablePtrFieldBase : public RTTIField
 	{
+		/**
+		 * @brief	Retrieves the IReflectable value from the provided instance.
+		 * 			
+		 * @note	Field type must not be an array.
+		 */
 		virtual std::shared_ptr<IReflectable> getValue(void* object) = 0;
+
+		/**
+		 * @brief	Retrieves the IReflectable value from an array on the provided instance
+		 * 			and index.
+		 * 			
+		 * @note	Field type must be an array.
+		 */
 		virtual std::shared_ptr<IReflectable> getArrayValue(void* object, UINT32 index) = 0;
 
+		/**
+		 * @brief	Sets the IReflectable value in the provided instance.
+		 * 			
+		 * @note	Field type must not be an array.
+		 */
 		virtual void setValue(void* object, std::shared_ptr<IReflectable> value) = 0;
+
+		/**
+		 * @brief	Sets the IReflectable value in an array on the provided instance
+		 * 			and index.
+		 * 			
+		 * @note	Field type must be an array.
+		 */
 		virtual void setArrayValue(void* object, UINT32 index, std::shared_ptr<IReflectable> value) = 0;
 
+		/**
+		 * @brief	Creates a new object of the field type.
+		 */
 		virtual std::shared_ptr<IReflectable> newObject() = 0;
+
+		/**
+		 * @brief	Returns the RTTI identifier of the class owning the field.
+		 */
 		virtual UINT32 getRTTIId() = 0;
+
+		/**
+		 * @brief	Returns the name of the class owning the field.
+		 */
 		virtual const String& getRTTIName() = 0;
 
+		/**
+		 * @copydoc RTTIField::hasDynamicSize
+		 */
 		virtual bool hasDynamicSize() { return true; }
 	};
 
+	/**
+	 * @brief	Class containing a reflectable pointer field containing a specific type.
+	 */
 	template <class DataType, class ObjectType>
 	struct RTTIReflectablePtrField : public RTTIReflectablePtrFieldBase
 	{
 		/**
-		 * @brief	Initializes a field pointing to a class implementing a IReflectable interface. 
+		 * @brief	Initializes a field pointing to a single data type implementing IReflectable interface.
 		 *
 		 * @param	name		Name of the field.
 		 * @param	uniqueId	Unique identifier for this field. Although name is also a unique
 		 * 						identifier we want a small data type that can be used for efficiently
 		 * 						serializing data to disk and similar. It is primarily used for compatibility
 		 * 						between different versions of serialized data.
-		 * @param	getter  	The getter method for the field. Cannot be null. Must be a specific signature: DataType*(ObjectType*)
-		 * @param	setter  	The setter method for the field. Can be null. Must be a specific signature: void(ObjectType*, DataType*)
-		 * @param	flags		Various flags you can use to specialize how systems handle this field
+		 * @param	getter  	The getter method for the field. Must be a specific signature: DataType*(ObjectType*)
+		 * @param	setter  	The setter method for the field. Must be a specific signature: void(ObjectType*, DataType*)
+		 * @param	flags		Various flags you can use to specialize how systems handle this field. See "RTTIFieldFlag".
 		 */
 		void initSingle(const String& name, UINT16 uniqueId, boost::any getter, boost::any setter, UINT64 flags)
 		{
@@ -42,18 +94,18 @@ namespace CamelotFramework
 		}
 
 		/**
-		 * @brief	Initializes a VECTOR field with entries pointing to a class implementing IReflectable interface.
+		 * @brief	Initializes a field containing an array of pointers to data types implementing IReflectable interface.
 		 *
 		 * @param	name		Name of the field.
 		 * @param	uniqueId	Unique identifier for this field. Although name is also a unique
 		 * 						identifier we want a small data type that can be used for efficiently
 		 * 						serializing data to disk and similar. It is primarily used for compatibility
 		 * 						between different versions of serialized data.
-		 * @param	getter  	The getter method for the field. Cannot be null. Must be a specific signature: DataType*(ObjectType*, UINT32)
-		 * @param	getSize 	Getter method that returns the size of an array. Cannot be null. Must be a specific signature: UINT32(ObjectType*)
-		 * @param	setter  	The setter method for the field. Can be null. Must be a specific signature: void(ObjectType*, UINT32, DataType*)
-		 * @param	setSize 	Setter method that allows you to resize an array. Can be null. Can be null. Must be a specific signature: void(ObjectType*, UINT32)
-		 * @param	flags		Various flags you can use to specialize how systems handle this field
+		 * @param	getter  	The getter method for the field. Must be a specific signature: DataType*(ObjectType*, UINT32)
+		 * @param	getSize 	Getter method that returns the size of an array. Must be a specific signature: UINT32(ObjectType*)
+		 * @param	setter  	The setter method for the field. Must be a specific signature: void(ObjectType*, UINT32, DataType*)
+		 * @param	setSize 	Setter method that allows you to resize an array. Can be null. Must be a specific signature: void(ObjectType*, UINT32)
+		 * @param	flags		Various flags you can use to specialize how systems handle this field. See "RTTIFieldFlag".
 		 */
 		void initArray(const String& name, UINT16 uniqueId, boost::any getter, 
 			boost::any getSize, boost::any setter, boost::any setSize, UINT64 flags)
@@ -61,11 +113,17 @@ namespace CamelotFramework
 			initAll(getter, setter, getSize, setSize, name, uniqueId, true, SerializableFT_ReflectablePtr, flags);
 		}
 
+		/**
+		 * @copydoc RTTIField::getTypeSize
+		 */
 		virtual UINT32 getTypeSize()
 		{
 			return 0; // Complex types don't store size the conventional way
 		}
 
+		/**
+		 * @copydoc RTTIReflectablePtrFieldBase::getValue
+		 */
 		virtual std::shared_ptr<IReflectable> getValue(void* object)
 		{
 			checkIsArray(false);
@@ -77,6 +135,9 @@ namespace CamelotFramework
 			return castDataType;
 		}
 
+		/**
+		 * @copydoc RTTIReflectablePtrFieldBase::getArrayValue
+		 */
 		virtual std::shared_ptr<IReflectable> getArrayValue(void* object, UINT32 index)
 		{
 			checkIsArray(true);
@@ -88,6 +149,9 @@ namespace CamelotFramework
 			return castDataType;
 		}
 
+		/**
+		 * @copydoc RTTIReflectablePtrFieldBase::setValue
+		 */
 		virtual void setValue(void* object, std::shared_ptr<IReflectable> value)
 		{
 			checkIsArray(false);
@@ -104,6 +168,9 @@ namespace CamelotFramework
 			f(castObjType, castDataObj);
 		}
 
+		/**
+		 * @copydoc RTTIReflectablePtrFieldBase::setArrayValue
+		 */
 		virtual void setArrayValue(void* object, UINT32 index, std::shared_ptr<IReflectable> value)
 		{
 			checkIsArray(true);
@@ -120,6 +187,9 @@ namespace CamelotFramework
 			f(castObjType, index, castDataObj);
 		}
 
+		/**
+		 * @copydoc RTTIField::setArraySize
+		 */
 		virtual UINT32 getArraySize(void* object)
 		{
 			checkIsArray(true);
@@ -129,6 +199,9 @@ namespace CamelotFramework
 			return f(castObject);
 		}
 
+		/**
+		 * @copydoc RTTIField::setArraySize
+		 */
 		virtual void setArraySize(void* object, UINT32 size)
 		{
 			checkIsArray(true);
@@ -144,16 +217,25 @@ namespace CamelotFramework
 			f(castObject, size);
 		}
 
+		/**
+		 * @copydoc RTTIReflectablePtrFieldBase::newObject
+		 */
 		virtual std::shared_ptr<IReflectable> newObject()
 		{
 			return std::shared_ptr<IReflectable>(DataType::getRTTIStatic()->newRTTIObject());
 		}
 
+		/**
+		 * @copydoc RTTIReflectablePtrFieldBase::getRTTIId
+		 */
 		virtual UINT32 getRTTIId()
 		{
 			return DataType::getRTTIStatic()->getRTTIId();
 		}
 
+		/**
+		 * @copydoc RTTIReflectablePtrFieldBase::getRTTIName
+		 */
 		virtual const String& getRTTIName()
 		{
 			return DataType::getRTTIStatic()->getRTTIName();

+ 13 - 45
CamelotUtility/Source/CmColor.cpp

@@ -1,36 +1,8 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
 #include "CmColor.h"
 #include "CmMath.h"
 
-namespace CamelotFramework {
-
+namespace CamelotFramework 
+{
     const Color Color::ZERO = Color(0.0,0.0,0.0,0.0);
     const Color Color::Black = Color(0.0,0.0,0.0);
     const Color Color::White = Color(1.0,1.0,1.0);
@@ -38,7 +10,6 @@ namespace CamelotFramework {
     const Color Color::Green = Color(0.0,1.0,0.0);
     const Color Color::Blue = Color(0.0,0.0,1.0);
 
-    //---------------------------------------------------------------------
     ABGR Color::getAsABGR(void) const
     {
         UINT8 val8;
@@ -65,7 +36,7 @@ namespace CamelotFramework {
 
         return val32;
     }
-    //---------------------------------------------------------------------
+
     BGRA Color::getAsBGRA(void) const
     {
         UINT8 val8;
@@ -93,7 +64,7 @@ namespace CamelotFramework {
 
         return val32;
     }
-	//---------------------------------------------------------------------
+
 	ARGB Color::getAsARGB(void) const
 	{
 		UINT8 val8;
@@ -121,7 +92,7 @@ namespace CamelotFramework {
 
 		return val32;
 	}
-    //---------------------------------------------------------------------
+
     RGBA Color::getAsRGBA(void) const
     {
         UINT8 val8;
@@ -149,7 +120,7 @@ namespace CamelotFramework {
 
         return val32;
     }
-    //---------------------------------------------------------------------
+
     void Color::setAsABGR(const ABGR val)
     {
         UINT32 val32 = val;
@@ -169,7 +140,7 @@ namespace CamelotFramework {
         // Alpha
         a = (val32 & 0xFF) / 255.0f;
     }
-    //---------------------------------------------------------------------
+
     void Color::setAsBGRA(const BGRA val)
     {
         UINT32 val32 = val;
@@ -189,7 +160,7 @@ namespace CamelotFramework {
         // Blue
         b = (val32 & 0xFF) / 255.0f;
     }
-	//---------------------------------------------------------------------
+
 	void Color::setAsARGB(const ARGB val)
 	{
 		UINT32 val32 = val;
@@ -209,7 +180,7 @@ namespace CamelotFramework {
 		// Alpha
 		a = (val32 & 0xFF) / 255.0f;
 	}
-    //---------------------------------------------------------------------
+
     void Color::setAsRGBA(const RGBA val)
     {
         UINT32 val32 = val;
@@ -229,7 +200,7 @@ namespace CamelotFramework {
         // Red
         r = (val32 & 0xFF) / 255.0f;
     }
-    //---------------------------------------------------------------------
+
     bool Color::operator==(const Color& rhs) const
     {
         return (r == rhs.r &&
@@ -237,12 +208,12 @@ namespace CamelotFramework {
             b == rhs.b &&
             a == rhs.a);
     }
-    //---------------------------------------------------------------------
+
     bool Color::operator!=(const Color& rhs) const
     {
         return !(*this == rhs);
     }
-	//---------------------------------------------------------------------
+
 	void Color::setHSB(float hue, float saturation, float brightness)
 	{
 		// wrap hue
@@ -329,7 +300,7 @@ namespace CamelotFramework {
 
 
 	}
-	//---------------------------------------------------------------------
+
 	void Color::getHSB(float* hue, float* saturation, float* brightness) const
 	{
 
@@ -366,9 +337,6 @@ namespace CamelotFramework {
 			if (*hue > 1.0f)
 				*hue -= 1.0f;
 		}
-
-		
 	}
-
 }
 

+ 38 - 70
CamelotUtility/Source/CmDataStream.cpp

@@ -1,45 +1,15 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #include "CmDataStream.h"
 #include "CmDebug.h"
 #include "CmException.h"
 
 namespace CamelotFramework 
 {
-
-    //-----------------------------------------------------------------------
-    //-----------------------------------------------------------------------
     template <typename T> DataStream& DataStream::operator >>(T& val)
     {
         read(static_cast<void*>(&val), sizeof(T));
         return *this;
     }
-    //-----------------------------------------------------------------------
+
     String DataStream::getLine(bool trimAfter)
     {
         char tmpBuf[OGRE_STREAM_TEMP_SIZE];
@@ -81,7 +51,7 @@ namespace CamelotFramework
 
         return retString;
     }
-    //-----------------------------------------------------------------------
+
     size_t DataStream::readLine(char* buf, size_t maxCount, const String& delim)
     {
 		// Deal with both Unix & Windows LFs
@@ -137,7 +107,7 @@ namespace CamelotFramework
 
         return totalCount;
     }
-    //-----------------------------------------------------------------------
+
     size_t DataStream::skipLine(const String& delim)
     {
         char tmpBuf[OGRE_STREAM_TEMP_SIZE];
@@ -168,7 +138,7 @@ namespace CamelotFramework
 
         return total;
     }
-    //-----------------------------------------------------------------------
+
     String DataStream::getAsString(void)
     {
         // Read the entire buffer - ideally in one read, but if the size of
@@ -186,8 +156,7 @@ namespace CamelotFramework
         free(pBuf);
         return result;
     }
-    //-----------------------------------------------------------------------
-    //-----------------------------------------------------------------------
+
     MemoryDataStream::MemoryDataStream(void* pMem, size_t inSize, bool freeOnClose, bool readOnly)
 		: DataStream(static_cast<UINT16>(readOnly ? READ : (READ | WRITE)))
     {
@@ -197,7 +166,7 @@ namespace CamelotFramework
         mFreeOnClose = freeOnClose;
         assert(mEnd >= mPos);
     }
-    //-----------------------------------------------------------------------
+
     MemoryDataStream::MemoryDataStream(const String& name, void* pMem, size_t inSize, 
         bool freeOnClose, bool readOnly)
         : DataStream(name, static_cast<UINT16>(readOnly ? READ : (READ | WRITE)))
@@ -208,7 +177,7 @@ namespace CamelotFramework
         mFreeOnClose = freeOnClose;
         assert(mEnd >= mPos);
     }
-    //-----------------------------------------------------------------------
+
     MemoryDataStream::MemoryDataStream(DataStream& sourceStream, 
         bool freeOnClose, bool readOnly)
         : DataStream(static_cast<UINT16>(readOnly ? READ : (READ | WRITE)))
@@ -234,7 +203,7 @@ namespace CamelotFramework
         }
         assert(mEnd >= mPos);
     }
-    //-----------------------------------------------------------------------
+
     MemoryDataStream::MemoryDataStream(DataStreamPtr& sourceStream, 
         bool freeOnClose, bool readOnly)
         : DataStream(static_cast<UINT16>(readOnly ? READ : (READ | WRITE)))
@@ -260,7 +229,7 @@ namespace CamelotFramework
         }
         assert(mEnd >= mPos);
     }
-    //-----------------------------------------------------------------------
+
     MemoryDataStream::MemoryDataStream(const String& name, DataStream& sourceStream, 
         bool freeOnClose, bool readOnly)
         : DataStream(name, static_cast<UINT16>(readOnly ? READ : (READ | WRITE)))
@@ -286,7 +255,7 @@ namespace CamelotFramework
         }
         assert(mEnd >= mPos);
     }
-    //-----------------------------------------------------------------------
+
     MemoryDataStream::MemoryDataStream(const String& name, const DataStreamPtr& sourceStream, 
         bool freeOnClose, bool readOnly)
         : DataStream(name, static_cast<UINT16>(readOnly ? READ : (READ | WRITE)))
@@ -312,7 +281,7 @@ namespace CamelotFramework
         }
         assert(mEnd >= mPos);
     }
-    //-----------------------------------------------------------------------
+
     MemoryDataStream::MemoryDataStream(size_t inSize, bool freeOnClose, bool readOnly)
         : DataStream(static_cast<UINT16>(readOnly ? READ : (READ | WRITE)))
     {
@@ -323,7 +292,7 @@ namespace CamelotFramework
         mEnd = mData + mSize;
         assert(mEnd >= mPos);
     }
-    //-----------------------------------------------------------------------
+
     MemoryDataStream::MemoryDataStream(const String& name, size_t inSize, 
         bool freeOnClose, bool readOnly)
         : DataStream(name, static_cast<UINT16>(readOnly ? READ : (READ | WRITE)))
@@ -335,12 +304,12 @@ namespace CamelotFramework
         mEnd = mData + mSize;
         assert(mEnd >= mPos);
     }
-    //-----------------------------------------------------------------------
+
     MemoryDataStream::~MemoryDataStream()
     {
         close();
     }
-    //-----------------------------------------------------------------------
+
     size_t MemoryDataStream::read(void* buf, size_t count)
     {
         size_t cnt = count;
@@ -356,7 +325,7 @@ namespace CamelotFramework
         mPos += cnt;
         return cnt;
     }
-	//---------------------------------------------------------------------
+
 	size_t MemoryDataStream::write(const void* buf, size_t count)
 	{
 		size_t written = 0;
@@ -375,7 +344,7 @@ namespace CamelotFramework
 		}
 		return written;
 	}
-    //-----------------------------------------------------------------------
+
     size_t MemoryDataStream::readLine(char* buf, size_t maxCount, 
         const String& delim)
     {
@@ -413,7 +382,7 @@ namespace CamelotFramework
 
         return pos;
     }
-    //-----------------------------------------------------------------------
+
     size_t MemoryDataStream::skipLine(const String& delim)
     {
         size_t pos = 0;
@@ -432,7 +401,7 @@ namespace CamelotFramework
         return pos;
 
     }
-    //-----------------------------------------------------------------------
+
     void MemoryDataStream::skip(long count)
     {
         size_t newpos = (size_t)( ( mPos - mData ) + count );
@@ -440,24 +409,24 @@ namespace CamelotFramework
 
         mPos = mData + newpos;
     }
-    //-----------------------------------------------------------------------
+
     void MemoryDataStream::seek( size_t pos )
     {
         assert( mData + pos <= mEnd );
         mPos = mData + pos;
     }
-    //-----------------------------------------------------------------------
+
     size_t MemoryDataStream::tell(void) const
 	{
 		//mData is start, mPos is current location
 		return mPos - mData;
 	}
-	//-----------------------------------------------------------------------
+
     bool MemoryDataStream::eof(void) const
     {
         return mPos >= mEnd;
     }
-    //-----------------------------------------------------------------------
+
     void MemoryDataStream::close(void)    
     {
         if (mFreeOnClose && mData)
@@ -467,8 +436,7 @@ namespace CamelotFramework
         }
 
     }
-    //-----------------------------------------------------------------------
-    //-----------------------------------------------------------------------
+
     FileDataStream::FileDataStream(std::shared_ptr<std::ifstream> s, bool freeOnClose)
         : DataStream(), mpInStream(s), mpFStreamRO(s), mpFStream(0), mFreeOnClose(freeOnClose)
     {
@@ -478,7 +446,7 @@ namespace CamelotFramework
         mpInStream->seekg(0, std::ios_base::beg);
 		determineAccess();
     }
-    //-----------------------------------------------------------------------
+
     FileDataStream::FileDataStream(const String& name, 
         std::shared_ptr<std::ifstream> s, bool freeOnClose)
         : DataStream(name), mpInStream(s), mpFStreamRO(s), mpFStream(0), mFreeOnClose(freeOnClose)
@@ -489,7 +457,7 @@ namespace CamelotFramework
         mpInStream->seekg(0, std::ios_base::beg);
 		determineAccess();
     }
-    //-----------------------------------------------------------------------
+
     FileDataStream::FileDataStream(const String& name, 
         std::shared_ptr<std::ifstream> s, size_t inSize, bool freeOnClose)
         : DataStream(name), mpInStream(s), mpFStreamRO(s), mpFStream(0), mFreeOnClose(freeOnClose)
@@ -498,7 +466,7 @@ namespace CamelotFramework
         mSize = inSize;
 		determineAccess();
     }
-	//---------------------------------------------------------------------
+
 	FileDataStream::FileDataStream(std::shared_ptr<std::fstream> s, bool freeOnClose)
 		: DataStream(false), mpInStream(s), mpFStreamRO(0), mpFStream(s), mFreeOnClose(freeOnClose)
 	{
@@ -510,7 +478,7 @@ namespace CamelotFramework
 		determineAccess();
 
 	}
-	//-----------------------------------------------------------------------
+
 	FileDataStream::FileDataStream(const String& name, 
 		std::shared_ptr<std::fstream> s, bool freeOnClose)
 		: DataStream(name, false), mpInStream(s), mpFStreamRO(0), mpFStream(s), mFreeOnClose(freeOnClose)
@@ -522,7 +490,7 @@ namespace CamelotFramework
 		mpInStream->seekg(0, std::ios_base::beg);
 		determineAccess();
 	}
-	//-----------------------------------------------------------------------
+
 	FileDataStream::FileDataStream(const String& name, 
 		std::shared_ptr<std::fstream> s, size_t inSize, bool freeOnClose)
 		: DataStream(name, false), mpInStream(s), mpFStreamRO(0), mpFStream(s), mFreeOnClose(freeOnClose)
@@ -532,7 +500,7 @@ namespace CamelotFramework
 		mSize = inSize;
 		determineAccess();
 	}
-	//---------------------------------------------------------------------
+
 	void FileDataStream::determineAccess()
 	{
 		mAccess = 0;
@@ -541,18 +509,18 @@ namespace CamelotFramework
 		if (mpFStream)
 			mAccess |= WRITE;
 	}
-    //-----------------------------------------------------------------------
+
     FileDataStream::~FileDataStream()
     {
         close();
     }
-    //-----------------------------------------------------------------------
+
     size_t FileDataStream::read(void* buf, size_t count)
     {
 		mpInStream->read(static_cast<char*>(buf), static_cast<std::streamsize>(count));
         return (size_t)mpInStream->gcount();
     }
-	//-----------------------------------------------------------------------
+
 	size_t FileDataStream::write(const void* buf, size_t count)
 	{
 		size_t written = 0;
@@ -563,7 +531,7 @@ namespace CamelotFramework
 		}
 		return written;
 	}
-    //-----------------------------------------------------------------------
+
     size_t FileDataStream::readLine(char* buf, size_t maxCount, 
         const String& delim)
     {
@@ -626,7 +594,7 @@ namespace CamelotFramework
 		}
 		return ret;
 	}
-    //-----------------------------------------------------------------------
+
     void FileDataStream::skip(long count)
     {
 #if defined(STLPORT)
@@ -645,24 +613,24 @@ namespace CamelotFramework
 		mpInStream->clear(); //Clear fail status in case eof was set
 		mpInStream->seekg(static_cast<std::ifstream::pos_type>(count), std::ios::cur);
     }
-    //-----------------------------------------------------------------------
+
     void FileDataStream::seek( size_t pos )
     {
 		mpInStream->clear(); //Clear fail status in case eof was set
 		mpInStream->seekg(static_cast<std::streamoff>(pos), std::ios::beg);
 	}
-	//-----------------------------------------------------------------------
+
     size_t FileDataStream::tell(void) const
 	{
 		mpInStream->clear(); //Clear fail status in case eof was set
 		return (size_t)mpInStream->tellg();
 	}
-	//-----------------------------------------------------------------------
+
     bool FileDataStream::eof(void) const
     {
         return mpInStream->eof();
     }
-    //-----------------------------------------------------------------------
+
     void FileDataStream::close(void)
     {
         if (mpInStream)

+ 3 - 37
CamelotUtility/Source/CmDynLib.cpp

@@ -1,30 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #include "CmDynLib.h"
 
 #include "CmException.h"
@@ -42,22 +15,18 @@ THE SOFTWARE.
 #   include <dlfcn.h>
 #endif
 
-
-namespace CamelotFramework {
-
-    //-----------------------------------------------------------------------
+namespace CamelotFramework 
+{
     DynLib::DynLib( const String& name )
     {
         mName = name;
         m_hInst = NULL;
     }
 
-    //-----------------------------------------------------------------------
     DynLib::~DynLib()
     {
     }
 
-    //-----------------------------------------------------------------------
     void DynLib::load()
     {
 		String name = mName;
@@ -85,7 +54,6 @@ namespace CamelotFramework {
 		}
     }
 
-    //-----------------------------------------------------------------------
     void DynLib::unload()
     {
         if( DYNLIB_UNLOAD( m_hInst ) )
@@ -97,12 +65,11 @@ namespace CamelotFramework {
 
     }
 
-    //-----------------------------------------------------------------------
     void* DynLib::getSymbol( const String& strName ) const throw()
     {
         return (void*)DYNLIB_GETSYM( m_hInst, strName.c_str() );
     }
-    //-----------------------------------------------------------------------
+
     String DynLib::dynlibError( void ) 
     {
 #if CM_PLATFORM == CM_PLATFORM_WIN32
@@ -128,5 +95,4 @@ namespace CamelotFramework {
         return String("");
 #endif
     }
-
 }

+ 4 - 32
CamelotUtility/Source/CmDynLibManager.cpp

@@ -1,40 +1,12 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #include "CmDynLibManager.h"
 #include "CmDynLib.h"
 
 namespace CamelotFramework
 {
-    //-----------------------------------------------------------------------
 	DynLibManager::DynLibManager()
 	{
 	}
-	//-----------------------------------------------------------------------
+
     DynLib* DynLibManager::load( const String& filename)
     {
 		DynLibList::iterator i = mLibList.find(filename);
@@ -50,7 +22,7 @@ namespace CamelotFramework
 	        return pLib;
 		}
     }
-	//-----------------------------------------------------------------------
+
 	void DynLibManager::unload(DynLib* lib)
 	{
 		DynLibList::iterator i = mLibList.find(lib->getName());
@@ -61,8 +33,8 @@ namespace CamelotFramework
 		lib->unload();
 		cm_delete(lib);
 	}
-	//-----------------------------------------------------------------------
-    DynLibManager::~DynLibManager()
+
+	DynLibManager::~DynLibManager()
     {
         // Unload & delete resources in turn
         for( DynLibList::iterator it = mLibList.begin(); it != mLibList.end(); ++it )

+ 0 - 28
CamelotUtility/Source/CmString.cpp

@@ -1,31 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
 #include "CmString.h"
 #include "CmColor.h"
 #include "CmMath.h"

+ 0 - 27
CamelotUtility/Source/CmWorkQueue.cpp

@@ -1,30 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #include "CmWorkQueue.h"
 #include "CmDebug.h"
 

+ 0 - 28
CamelotUtility/Source/Win32/CmTimer.cpp

@@ -1,31 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
 #include "CmTimer.h"
 #include "CmBitwise.h"