Browse Source

More documentation

Marko Pintera 11 years ago
parent
commit
5b2b3b26ea

+ 85 - 3
CamelotUtility/Include/CmMemStack.h

@@ -8,7 +8,7 @@
 namespace CamelotFramework
 {
 	/**
-	 * @brief	Memory stack.
+	 * @brief	Describes a memory stack of a certain block capacity. See "MemoryStack" for more information.
 	 *
 	 *  @tparam	BlockCapacity Minimum size of a block. Larger blocks mean less memory allocations, but also potentially
 	 * 			more wasted memory. If an allocation requests more bytes than BlockCapacity, first largest multiple is
@@ -18,6 +18,11 @@ namespace CamelotFramework
 	class MemStackInternal
 	{
 	private:
+
+		/**
+		 * @brief	A single block of memory of "BlockCapacity" size. A pointer to the first
+		 * 			free address is stored, and a remaining size. 
+		 */
 		class MemBlock
 		{
 		public:
@@ -28,6 +33,11 @@ namespace CamelotFramework
 			~MemBlock()
 			{ }
 
+			/**
+			 * @brief	Returns the first free address and increments the free pointer.
+			 * 			Caller needs to ensure the remaining block size is adequate before
+			 * 			calling.
+			 */
 			UINT8* alloc(UINT32 amount)
 			{
 				UINT8* freePtr = &mData[mFreePtr];
@@ -36,6 +46,13 @@ namespace CamelotFramework
 				return freePtr;
 			}
 
+			/**
+			 * @brief	Deallocates the provided pointer. Deallocation must happen in opposite order
+			 * 			from allocation otherwise corruption will occur.
+			 * 			
+			 * @note	Pointer to "data" isn't actually needed, but is provided for debug purposes in order to more
+			 * 			easily track out-of-order deallocations.
+			 */
 			void dealloc(UINT8* data, UINT32 amount)
 			{
 				mFreePtr -= amount;
@@ -64,6 +81,18 @@ namespace CamelotFramework
 			}
 		}
 
+		/**
+		 * @brief	Allocates the given amount of memory on the stack.
+		 *
+		 * @param	amount	The amount to allocate in bytes.
+		 *
+		 * @note	Allocates the memory in the currently active block if it is large enough,
+		 * 			otherwise a new block is allocated. If the allocation is larger than
+		 * 			default block size a separate block will be allocated only for that allocation,
+		 * 			making it essentially a slower heap allocator.
+		 * 			
+		 *			Each allocation comes with a 4 byte overhead.
+		 */
 		UINT8* alloc(UINT32 amount)
 		{
 			amount += sizeof(UINT32);
@@ -89,6 +118,10 @@ namespace CamelotFramework
 			return data + sizeof(UINT32);
 		}
 
+		/**
+		 * @brief	Deallocates the given memory. Data must be deallocated in opposite
+		 * 			order then when it was allocated.
+		 */
 		void dealloc(UINT8* data)
 		{
 			data -= sizeof(UINT32);
@@ -108,6 +141,10 @@ namespace CamelotFramework
 	private:
 		std::stack<MemBlock*> mBlocks;
 
+		/**
+		 * @brief	Allocates a new block of memory using a heap allocator. Block will never be 
+		 * 			smaller than "BlockCapacity" no matter the "wantedSize".
+		 */
 		MemBlock* allocBlock(UINT32 wantedSize)
 		{
 			UINT32 blockSize = BlockCapacity;
@@ -124,6 +161,9 @@ namespace CamelotFramework
 			return newBlock;
 		}
 
+		/**
+		 * @brief	Deallocates a block of memory.
+		 */
 		void deallocBlock(MemBlock* block)
 		{
 			block->~MemBlock();
@@ -136,11 +176,11 @@ namespace CamelotFramework
 	 * 			must happen in opposite order from allocations. 
 	 * 			
 	 * @note	It's mostly useful when you need to allocate something temporarily on the heap,
-	 * 			usually something that gets allocated and freed within the same function.
+	 * 			usually something that gets allocated and freed within the same method.
 	 * 			
 	 *			Each allocation comes with a pretty hefty 4 byte memory overhead, so don't use it for small allocations. 
 	 *			
-	 *			This class is thread safe but you cannot allocate on one thread and deallocate on another. Threads will keep
+	 *			Thread safe. But you cannot allocate on one thread and deallocate on another. Threads will keep
 	 *			separate stacks internally. Make sure to call beginThread/endThread for any thread this stack is used on.
 	 */
 	class MemStack
@@ -158,27 +198,55 @@ namespace CamelotFramework
 		 */
 		static CM_UTILITY_EXPORT void endThread();
 
+		/**
+		 * @copydoc	MemoryStackInternal::alloc
+		 */
 		static CM_UTILITY_EXPORT UINT8* alloc(UINT32 numBytes);
+
+		/**
+		 * @copydoc	MemoryStackInternal::dealloc
+		 */
 		static CM_UTILITY_EXPORT void deallocLast(UINT8* data);
 
 	private:
 		static CM_THREADLOCAL MemStackInternal<1024 * 1024>* ThreadMemStack;
 	};
 
+	/**
+	* @copydoc	MemoryStackInternal::alloc
+	*/
 	CM_UTILITY_EXPORT inline void* stackAlloc(UINT32 numBytes);
 
+	/**
+	 * @brief	Allocates enough memory to hold the specified type, on the stack, but
+	 * 			does not initialize the object. 
+	 *
+	 * @see		MemoryStackInternal::alloc()
+	 */
 	template<class T>
 	T* stackAlloc()
 	{
 		return (T*)MemStack::alloc(sizeof(T));
 	}
 
+	/**
+	 * @brief	Allocates enough memory to hold N objects of the specified type, 
+	 * 			on the stack, but does not initialize the objects. 
+	 *
+	 * @see		MemoryStackInternal::alloc()
+	 */
 	template<class T>
 	T* stackAllocN(UINT32 count)
 	{
 		return (T*)MemStack::alloc(sizeof(T) * count);
 	}
 
+	/**
+	 * @brief	Allocates enough memory to hold the specified type, on the stack, 
+	 * 			and initializes the object using the parameterless constructor.
+	 *
+	 * @see		MemoryStackInternal::alloc()
+	 */
 	template<class T>
 	T* stackConstructN(UINT32 count)
 	{
@@ -190,6 +258,11 @@ namespace CamelotFramework
 		return data;
 	}
 
+	/**
+	 * @brief	Destructs and deallocates last allocated entry currently located on stack.
+	 *
+	 * @see		MemoryStackInternal::dealloc()
+	 */
 	template<class T>
 	void stackDestruct(T* data)
 	{
@@ -198,6 +271,12 @@ namespace CamelotFramework
 		MemStack::deallocLast((UINT8*)data);
 	}
 
+	/**
+	 * @brief	Destructs an array of objects and deallocates last allocated 
+	 * 			entry currently located on stack.
+	 *
+	 * @see		MemoryStackInternal::dealloc()
+	 */
 	template<class T>
 	void stackDestructN(T* data, UINT32 count)
 	{
@@ -207,5 +286,8 @@ namespace CamelotFramework
 		MemStack::deallocLast((UINT8*)data);
 	}
 
+	/**
+	 * @copydoc	MemoryStackInternal::dealloc()
+	 */
 	CM_UTILITY_EXPORT inline void stackDeallocLast(void* data);
 }

+ 75 - 31
CamelotUtility/Include/CmMemoryAllocator.h

@@ -10,6 +10,10 @@ namespace CamelotFramework
 {
 	class MemoryAllocatorBase;
 
+	/**
+	 * @brief	Thread safe class used for storing total number of memory allocations and deallocations,
+	 * 			primarily for statistic purposes.
+	 */
 	class MemoryCounter
 	{
 	public:
@@ -34,6 +38,10 @@ namespace CamelotFramework
 		static CM_THREADLOCAL UINT64 Frees;
 	};
 
+	/**
+	 * @brief	Base class all memory allocators need to inherit. Provides
+	 * 			allocation and free counting.
+	 */
 	class MemoryAllocatorBase
 	{
 	protected:
@@ -44,6 +52,9 @@ namespace CamelotFramework
 	/**
 	 * @brief	Memory allocator providing a generic implementation. 
 	 * 			Specialize for specific categories as needed.
+	 * 			
+	 * @note	For example you might implement a pool allocator for specific types in order
+	 * 			to reduce allocation overhead. By default standard malloc/free are used.
 	 */
 	template<class T>
 	class MemoryAllocator : public MemoryAllocatorBase
@@ -96,6 +107,8 @@ namespace CamelotFramework
 	/**
 	 * @brief	Allocator used for allocating small amounts of temporary memory that
 	 * 			used and then quickly released
+	 * 			
+	 * @note	Currently not used.
 	 */
 	class ScratchAlloc
 	{ };
@@ -103,6 +116,8 @@ namespace CamelotFramework
 	/**
 	 * @brief	Pool allocator that is only suited for allocating one specific type of data. Most useful when you are
 	 * 			often allocating one certain data type, with no specific allocation or deallocation order.
+	 * 			
+	 * @note	Currently not used.
 	 */
 	class PoolAlloc
 	{ };
@@ -157,8 +172,11 @@ namespace CamelotFramework
 #undef FORWARD_T
 #undef MAKE_CM_NEW
 
-	// Create a new object with the specified allocator without any parameters
-	// (Needs to be separate from parameter version so I don't unnecessarily zero-initialize POD types)
+	/**
+	 * @brief	Create a new object with the specified allocator without any parameters
+	 *
+	 * @note	Needs to be separate from parameter version so I don't unnecessarily zero-initialize POD types.
+	 */
 	template<class Type, class Alloc>
 	Type* cm_new() 
 	{
@@ -232,7 +250,9 @@ namespace CamelotFramework
 		return ptr;
 	}
 
-	// Create a new object with the general allocator and the specified parameters.
+	/**
+	 * @brief	Create a new object with the specified allocator and the specified parameters.
+	 */
 #define MAKE_CM_NEW(z, n, unused)                                     \
 	template<class Type BOOST_PP_ENUM_TRAILING_PARAMS(n, class T)>     \
 	Type* cm_new(BOOST_PP_ENUM_BINARY_PARAMS(n, T, &&t) ) { \
@@ -247,8 +267,11 @@ namespace CamelotFramework
 #undef FORWARD_T
 #undef MAKE_CM_NEW
 
-	// Create a new object with the general allocator without any parameters
-	// (Needs to be separate from parameter version so I don't unnecessarily zero-initialize POD types)
+	/**
+	 * @brief	Create a new object with the specified allocator without any parameters
+	 *
+	 * @note	Needs to be separate from parameter version so I don't unnecessarily zero-initialize POD types.
+	 */
 	template<class Type>
 	Type* cm_new() 
 	{
@@ -304,12 +327,15 @@ namespace CamelotFramework
 
 namespace CamelotFramework
 {
-	// Allocator we can use in the standard library
+    /**
+     * @brief	Allocator for the standard library that internally uses Banshee
+     * 			memory allocator.
+     */
     template <class T, class Alloc = GenAlloc>
 	class StdAlloc 
 	{
-		public:
-		// type definitions
+	public:
+		// Type definitions
 		typedef T        value_type;
 		typedef T*       pointer;
 		typedef const T* const_pointer;
@@ -318,26 +344,15 @@ namespace CamelotFramework
 		typedef std::size_t    size_type;
 		typedef std::ptrdiff_t difference_type;
 
-		// rebind allocator to type U
+		/**
+		 * @brief	Rebind allocator to type U
+		 */
 		template <class U>
 		struct rebind 
 		{
 			typedef StdAlloc<U, Alloc> other;
 		};
 
-		// return address of values
-		pointer address (reference value) const 
-		{
-			return &value;
-		}
-		const_pointer address (const_reference value) const 
-		{
-			return &value;
-		}
-
-		/* constructors and destructor
-		* - nothing to do because the allocator has no state
-		*/
 		StdAlloc() throw() 
 		{ }
 
@@ -351,47 +366,76 @@ namespace CamelotFramework
 		~StdAlloc() throw() 
 		{ }
 
-		// return maximum number of elements that can be allocated
+		/**
+		 * @brief	Return address of value.
+		 */
+		pointer address (reference value) const 
+		{
+			return &value;
+		}
+
+		/**
+		 * @brief	Return address of value.
+		 */
+		const_pointer address (const_reference value) const 
+		{
+			return &value;
+		}
+
+		/**
+		 * @brief	Return maximum number of elements that can be allocated.
+		 */
 		size_type max_size () const throw() 
 		{
 			return std::numeric_limits<std::size_t>::max() / sizeof(T);
 		}
 
-		// allocate but don't initialize num elements of type T
+		/**
+		 * @brief	Allocate but don't initialize number elements of type T.
+		 */
 		pointer allocate (size_type num, const void* = 0) 
 		{
 			pointer ret = (pointer)(cm_alloc<Alloc>((size_t)num*sizeof(T)));
 			return ret;
 		}
 
-		// initialize elements of allocated storage p with value value
+		/**
+		 * @brief	Initialize elements of allocated storage p with value "value".
+		 */
 		void construct (pointer p, const T& value) 
 		{
-			// initialize memory with placement new
 			new((void*)p)T(value);
 		}
 
-		// destroy elements of initialized storage p
+		/**
+		 * @brief	Destroy elements of initialized storage p.
+		 */
 		void destroy (pointer p) 
 		{
-			// destroy objects by calling their destructor
 			p->~T();
 		}
 
-		// deallocate storage p of deleted elements
+		/**
+		 * @brief	Deallocate storage p of deleted elements.
+		 */
 		void deallocate (pointer p, size_type num) 
 		{
-			// print message and deallocate memory with global delete
 			cm_free<Alloc>((void*)p);
 		}
 	};
 
-   // return that all specializations of this allocator are interchangeable
+   /**
+    * @brief	Return that all specializations of this allocator are interchangeable.
+    */
    template <class T1, class T2, class Alloc>
    bool operator== (const StdAlloc<T1, Alloc>&,
                     const StdAlloc<T2, Alloc>&) throw() {
        return true;
    }
+
+   /**
+    * @brief	Return that all specializations of this allocator are interchangeable.
+    */
    template <class T1, class T2, class Alloc>
    bool operator!= (const StdAlloc<T1, Alloc>&,
                     const StdAlloc<T2, Alloc>&) throw() {

+ 30 - 1
CamelotUtility/Include/CmModule.h

@@ -7,11 +7,19 @@ namespace CamelotFramework
 {
 	/**
 	 * @brief	Represents one engine module. Essentially it is a specialized type of singleton.
+	 * 			Module must be manually started up and shut down before and after use.
+	 * 			
+	 * TODO Low priority - Use variadic templates to automatically pass parameters so I may construct the object instance internally.
+	 *			Right now I expect the caller to allocate the object using general memory allocator.
 	 */
 	template <class T>
 	class Module
 	{
 		public:
+		/**
+		 * @brief	Returns a reference to the module instance. Module has to have been started up
+		 * 			first otherwise an exception will be thrown.
+		 */
 		static T& instance()
 		{
 			if(isShutDown)
@@ -29,6 +37,10 @@ namespace CamelotFramework
 			return *_instance;
 		}
 
+		/**
+		 * @brief	Returns a pointer to the module instance. Module has to have been started up
+		 * 			first otherwise an exception will be thrown.
+		 */
 		static T* instancePtr()
 		{
 			if(isShutDown)
@@ -46,6 +58,10 @@ namespace CamelotFramework
 			return _instance;
 		}
 		
+		/**
+		 * @brief	Starts up the module. You must provide an initialized instance of the module,
+		 * 			allocated using the general memory allocator.
+		 */
 		static void startUp(T* inst)
 		{
 			if(!isShutDown)
@@ -75,7 +91,7 @@ namespace CamelotFramework
 		}
 
 		/**
-		 * @brief	Query if this object has been started.
+		 * @brief	Query if the module has been started.
 		 */
 		static bool isStarted()
 		{
@@ -96,7 +112,20 @@ namespace CamelotFramework
 		Module(const Module&) { }
 		Module& operator=(const Module&) { return *this; }
 
+		/**
+		 * @brief	Override if you want your module to be notified once it has been constructed and started.
+		 * 			
+		 * @note	Useful when your module is polymorphic and you cannot perform 
+		 * 			some implementation specific initialization in constructor itself.
+		 */
 		virtual void onStartUp() {}
+
+		/**
+		 * @brief	Override if you want your module to be notified just before it is deleted.
+		 * 			
+		 * @note	Useful when your module is polymorphic and you might want to perform some 
+		 * 			kind of clean up perhaps overriding that of a base class.
+		 */
 		virtual void onShutDown() {}
 
 		static T* _instance;

+ 30 - 0
CamelotUtility/Include/CmPath.h

@@ -11,17 +11,29 @@ namespace CamelotFramework
 	class CM_UTILITY_EXPORT Path
 	{
 	public:
+		/**
+		 * @brief	Returns file extension extracted from the provided
+		 * 			path, with a leading ".".
+		 */
 		static WString getExtension(const WString& path)
 		{
 			boost::filesystem3::wpath ext = boost::filesystem3::extension(boost::filesystem3::wpath(path.c_str()));
 			return ext.wstring().c_str();
 		}
 
+		/**
+		 * @brief	Query if a path has the specified extension. Provided
+		 * 			extension must contain the leading ".".
+		 */
 		static bool hasExtension(const WString& path, const WString& extension)
 		{
 			return getExtension(path) == extension;
 		}
 
+		/**
+		 * @brief	Replaces or adds an extension on a file path. Provided
+		 * 			extension must contain the leading ".".
+		 */
 		static void replaceExtension(WString& path, const WString& newExtension)
 		{
 			boost::filesystem3::path internalPath = path.c_str();
@@ -29,6 +41,10 @@ namespace CamelotFramework
 			path = internalPath.replace_extension(newExtension.c_str()).c_str();
 		}
 
+		/**
+		 * @brief	Returns a path that is one level higher than the provided path, unless the path
+		 * 			is already at the root. Otherwise returns the initial path.
+		 */
 		static WString parentPath(const WString& path)
 		{
 			boost::filesystem3::path internalPath = path.c_str();
@@ -86,6 +102,11 @@ namespace CamelotFramework
 			return relativePath;
 		}
 
+		/**
+		 * @brief	Splits a path into string entries. Path separator
+		 * 			may be "\" or "/". Path separator will not be included
+		 * 			in the returned strings.
+		 */
 		static Vector<WString>::type split(const WString& path)
 		{
 			Vector<WString>::type splitPath;
@@ -94,6 +115,9 @@ namespace CamelotFramework
 			return StringUtil::split(standardizedPath, L"/");
 		}
 
+		/**
+		 * @brief	Combines two paths using the "/" path separator.
+		 */
 		static WString combine(const WString& base, const WString& name)
 		{
 			if (base.empty())
@@ -162,6 +186,12 @@ namespace CamelotFramework
 			return true;
 		}
 
+		/**
+		 * @brief	Extracts filename from the provided path.
+		 *
+		 * @param	path				Path to the file.
+		 * @param	includeExtension	(optional) If true, filename extension will be included in the returned string.
+		 */
 		static WString getFilename(const WString& path, bool includeExtension = true)
 		{
 			boost::filesystem3::path internalPath = path.c_str();

+ 84 - 8
CamelotUtility/Include/CmRTTIPrerequisites.h

@@ -4,7 +4,7 @@ namespace CamelotFramework
 {
 	/**
 	* @brief	Helper method when serializing known data types that have valid
-	* 			RTTIPlainType specializations.
+	* 			RTTIPlainType specialization.
 	* 			
 	*			Returns the size of the element. If elements serializable type is 
 	*			specialized with hasDynamicSize == true, the dynamic size is calculated, 
@@ -21,7 +21,7 @@ namespace CamelotFramework
 
 	/**
 	 * @brief	Helper method when serializing known data types that have valid
-	 * 			RTTIPlainType specializations.
+	 * 			RTTIPlainType specialization.
 	 * 			
 	 *			Writes the specified data into memory, advances the memory pointer by the
 	 *			bytes written and returns pointer to new memory.
@@ -36,7 +36,7 @@ namespace CamelotFramework
 
 	/**
 	* @brief	Helper method when serializing known data types that have valid
-	* 			RTTIPlainType specializations.
+	* 			RTTIPlainType specialization.
 	* 			
 	*			Writes the specified data into memory, advances the memory pointer by the
 	*			bytes written and returns pointer to new memory. Also increases the size 
@@ -56,7 +56,7 @@ namespace CamelotFramework
 
 	/**
 	 * @brief	Helper method when serializing known data types that have valid
-	 * 			RTTIPlainType specializations.
+	 * 			RTTIPlainType specialization.
 	 * 			
 	 *			Reads the specified data into memory, advances the memory pointer by the
 	 *			bytes read and returns pointer to new memory.
@@ -71,7 +71,7 @@ namespace CamelotFramework
 
 	/**
 	 * @brief	Helper method when serializing known data types that have valid
-	 * 			RTTIPlainType specializations.
+	 * 			RTTIPlainType specialization.
 	 * 			
 	 *			Reads the specified data into memory, advances the memory pointer by the
 	 *			bytes read and returns pointer to new memory. Also increases the size 
@@ -88,6 +88,21 @@ namespace CamelotFramework
 		return memory + elemSize;
 	}
 
+	/**
+	 * @brief	Template that you may specialize with a class if you want to provide
+	 * 			simple serialization for it. 
+	 * 			
+	 *			Any type that uses the "plain" field in the RTTI system must specialize this class.
+	 * 			
+	 * @note	Normally you will want to implement IReflectable interface if you want to provide serialization
+	 * 			as that interface properly handles versioning, nested objects, pointer handling and more.
+	 * 			
+	 *			This class is useful for types you can easily serialize using a memcpy (built-in types like int/float/etc), or
+	 *			types you cannot modify so they implement IReflectable interface (like std::string or std::vector).
+	 *			
+	 * @see		RTTIType
+	 * @see		RTTIField
+	 */
 	template<class T>
 	struct RTTIPlainType 
 	{ 
@@ -95,20 +110,32 @@ namespace CamelotFramework
 			"Provided type isn't plain-old-data. You need to specialize RTTIPlainType template in order to serialize this type. "\
 			" (Or call CM_ALLOW_MEMCPY_SERIALIZATION(type) macro if you are sure the type can be properly serialized using just memcpy.)");
 
-		enum { id = 0 }; 
-		enum { hasDynamicSize = 0 };
+		enum { id = 0 /**< Unique id for the serializable type. */ }; 
+		enum { hasDynamicSize = 0 /**< 0 (Object has static size less than 255 bytes, e.g. int) or 1 (Dynamic size with no size restriction, e.g. string) */ };
 
+		/**
+		 * @brief	Serializes the provided object into the provided pre-allocated
+		 * 			memory buffer.
+		 */
 		static void toMemory(const T& data, char* memory)	
 		{ 
 			memcpy(memory, &data, sizeof(T)); 
 		}
 
+		/**
+		 * @brief	Deserializes a previously allocated object from the provided
+		 * 			memory buffer. Return the number of bytes read from the memory buffer.
+		 */
 		static UINT32 fromMemory(T& data, char* memory)
 		{
 			memcpy(&data, memory, sizeof(T)); 
 			return sizeof(T);
 		}
 
+		/**
+		 * @brief	Returns the size of the provided object. (Works for both
+		 * 			static and dynamic size types)
+		 */
 		static UINT32 getDynamicSize(const T& data)
 		{ 
 			assert(false); 
@@ -116,6 +143,14 @@ namespace CamelotFramework
 		}
 	};
 
+	/**
+	 * @brief	Tell the RTTI system that the specified type may be serialized just by
+	 * 			using a memcpy.
+	 *
+	 * @note	Internally this creates a basic RTTIPlainType specialization for the type.
+	 * 
+	 * @see		RTTIPlainType
+	 */
 #define CM_ALLOW_MEMCPY_SERIALIZATION(type)				\
 	template<> struct RTTIPlainType<##type##>			\
 	{	enum { id=0 }; enum { hasDynamicSize = 0 };		\
@@ -127,11 +162,18 @@ namespace CamelotFramework
 	{ assert(false); return sizeof(##type##); }				\
 	}; 
 
-	// RTTI types for some standard classes
+	/**
+	 * @brief	RTTIPlainType for std::vector.
+	 * 			
+	 * @see		RTTIPlainType
+	 */
 	template<class T> struct RTTIPlainType<std::vector<T, StdAlloc<T>>>
 	{	
 		enum { id = TID_STDVECTOR }; enum { hasDynamicSize = 1 };
 
+		/**
+		 * @copydoc		RTTIPlainType::toMemory
+		 */
 		static void toMemory(const std::vector<T, StdAlloc<T>>& data, char* memory)
 		{ 
 			UINT32 size = sizeof(UINT32);
@@ -155,6 +197,9 @@ namespace CamelotFramework
 			memcpy(memoryStart, &size, sizeof(UINT32));
 		}
 
+		/**
+		 * @copydoc		RTTIPlainType::toMemory
+		 */
 		static UINT32 fromMemory(std::vector<T, StdAlloc<T>>& data, char* memory)
 		{ 
 			UINT32 size = 0;
@@ -177,6 +222,9 @@ namespace CamelotFramework
 			return size;
 		}
 
+		/**
+		 * @copydoc		RTTIPlainType::toMemory
+		 */
 		static UINT32 getDynamicSize(const std::vector<T, StdAlloc<T>>& data)	
 		{ 
 			UINT64 dataSize = sizeof(UINT32) * 2;
@@ -190,10 +238,18 @@ namespace CamelotFramework
 		}	
 	}; 
 
+	/**
+	 * @brief	RTTIPlainType for std::map.
+	 * 			
+	 * @see		RTTIPlainType
+	 */
 	template<class Key, class Value> struct RTTIPlainType<std::map<Key, Value, std::less<Key>, StdAlloc<std::pair<const Key, Value>>>>
 	{	
 		enum { id = TID_STDMAP }; enum { hasDynamicSize = 1 };
 
+		/**
+		 * @copydoc		RTTIPlainType::toMemory
+		 */
 		static void toMemory(const std::map<Key, Value, std::less<Key>, StdAlloc<std::pair<const Key, Value>>>& data, char* memory)
 		{ 
 			UINT32 size = sizeof(UINT32);
@@ -223,6 +279,9 @@ namespace CamelotFramework
 			memcpy(memoryStart, &size, sizeof(UINT32));
 		}
 
+		/**
+		 * @copydoc		RTTIPlainType::fromMemory
+		 */
 		static UINT32 fromMemory(std::map<Key, Value, std::less<Key>, StdAlloc<std::pair<const Key, Value>>>& data, char* memory)
 		{ 
 			UINT32 size = 0;
@@ -249,6 +308,9 @@ namespace CamelotFramework
 			return size;
 		}
 
+		/**
+		 * @copydoc		RTTIPlainType::getDynamicSize
+		 */
 		static UINT32 getDynamicSize(const std::map<Key, Value, std::less<Key>, StdAlloc<std::pair<const Key, Value>>>& data)	
 		{ 
 			UINT64 dataSize = sizeof(UINT32) * 2;
@@ -265,10 +327,18 @@ namespace CamelotFramework
 		}	
 	}; 
 
+	/**
+	 * @brief	RTTIPlainType for std::pair.
+	 * 			
+	 * @see		RTTIPlainType
+	 */
 	template<class A, class B> struct RTTIPlainType<std::pair<A, B>>
 	{	
 		enum { id = TID_STDPAIR }; enum { hasDynamicSize = 1 };
 
+		/**
+		 * @copydoc		RTTIPlainType::toMemory
+		 */
 		static void toMemory(const std::pair<A, B>& data, char* memory)
 		{ 
 			UINT32 size = sizeof(UINT32);
@@ -290,6 +360,9 @@ namespace CamelotFramework
 			memcpy(memoryStart, &size, sizeof(UINT32));
 		}
 
+		/**
+		 * @copydoc		RTTIPlainType::fromMemory
+		 */
 		static UINT32 fromMemory(std::pair<A, B>& data, char* memory)
 		{ 
 			UINT32 size = 0;
@@ -305,6 +378,9 @@ namespace CamelotFramework
 			return size;
 		}
 
+		/**
+		 * @copydoc		RTTIPlainType::getDynamicSize
+		 */
 		static UINT32 getDynamicSize(const std::pair<A, B>& data)	
 		{ 
 			UINT64 dataSize = sizeof(UINT32);