write shit

This commit is contained in:
2023-08-25 17:35:45 +08:00
parent ad9d0cadce
commit c8c2c6e20b
14 changed files with 472 additions and 411 deletions

View File

@ -28,43 +28,22 @@ namespace LibCmo::XContainer {
/**
@brief Class representation of an array.
@tparam T Element Type.
@remark This class now use std::vector<T>.
@see XClassArray, XSArray
@remark
+ This class now use std::vector<T>.
+ XSArray, XClassArray now redirect to this.
*/
template<typename T>
using XArray = std::vector<T>;
/**
@brief Class representation of an array.
@tparam T Element Type.
@details Equivalent to XArray becasue memory reducing is useless.
@see XArray
*/
template<typename T>
using XSArray = XArray<T>;
/**
@brief Class representation of an array.
@tparam T Element Type.
@details Equivalent to XArray because std::vector<T> can fufill the requirements.
@see XArray
*/
template<typename T>
using XClassArray = XArray<T>;
/**
@brief Container class for CKObject Id's.
@remark
+ This class use the template container XArray to contain object CK_ID's.
+ Supports for Check, Load, Save, Add, Remove, Find functions in the Object CK_ID array.
+ XSObjectArray now redirect to this.
@todo May independ this class to implement the functions introduced in remarks.
@see XObjectPointerArray, CKObjectArray
*/
using XObjectArray = XArray<CK2::CK_ID>;
/**
@brief Container class for CKObject Id's
@details Equivalent to XObjectArray becasue memory reducing is useless.
@see XObjectArray
*/
using XSObjectArray = XObjectArray;
/**
@brief Container class for CKObject pointers.
@ -72,15 +51,11 @@ namespace LibCmo::XContainer {
+ Exactly same as XObjectArray class, but uses XArray (Pre-allocated items)
for storing pointers, and not IDs (more efficient to retrieve the objects).
+ Supports for Check, Load, Save, Add, Remove, Find functions in the CKObject Pointer array.
+ XSObjectPointerArray now redirect to this.
@todo May independ this class to implement the functions introduced in remarks.
@see XObjectArray, CKObjectArray
*/
using XObjectPointerArray = XArray<CK2::CKObject*>;
/**
@brief Container class for CKObject pointers.
@details Equivalent to XObjectPointerArray becasue memory reducing is useless.s
*/
using XSObjectPointerArray = XObjectPointerArray;
/**
@brief Class representation of an Hash Table container.
@ -88,24 +63,12 @@ namespace LibCmo::XContainer {
@tparam T The type of element to insert
@tparam H The hash function to hash the key
@tparam Eq The equal function to the key
@remark This class now use std::unordered_map<T>.
@remark
+ This class now use std::unordered_map<T>.
+ XNHashTable, XSHashTable now redirect to this.
*/
template<class K, class T, class H = std::hash<K>, class Eq = std::equal_to<K>>
using XHashTable = std::unordered_map<K, T, H, Eq>;
/**
@copydoc XHashTable
@details Equivalent to XHashTable
@see XHashTable
*/
template<class K, class T, class H = std::hash<K>, class Eq = std::equal_to<K>>
using XNHashTable = XHashTable<K, T, H, Eq>;
/**
@copydoc XHashTable
@details Equivalent to XHashTable because static allocation is useless.
@see XHashTable
*/
template<class K, class T, class H = std::hash<K>, class Eq = std::equal_to<K>>
using XSHashTable = XHashTable<K, T, H, Eq>;
}