continue refactor project

This commit is contained in:
2023-09-16 22:38:21 +08:00
parent 1ddeeb3b68
commit 3c8266e7dd
8 changed files with 215 additions and 60 deletions

View File

@ -4,6 +4,7 @@
#include <string>
#include <vector>
#include <unordered_map>
#include <list>
/**
* @brief The X container part of LibCmo.
@ -34,6 +35,13 @@ namespace LibCmo::XContainer {
*/
template<typename T>
using XArray = std::vector<T>;
/**
* @brief Double-linked list.
* @tparam T Element Type.
*/
template<typename T>
using XList = std::list<T>;
/**
@brief Container class for CKObject Id's.
@ -105,5 +113,54 @@ namespace LibCmo::XContainer {
}
namespace NSXObjectArray {
/**
* @brief Check Object ID validation and remove invalid IDs before deletion.
* @param objarray
* @param ctx
*/
void PreDeletedCheck(XObjectArray& objarray, CK2::CKContext* ctx);
/**
* @brief Check Object ID validation and remove invalid IDs after deletion.
* @param objarray
* @param ctx
*/
void PostDeletedCheck(XObjectArray& objarray, CK2::CKContext* ctx);
}
namespace NSXObjectPointerArray {
/**
* @brief Check Object pointer validation and remove invalid pointers before deletion.
* @param objarray
* @param ctx
*/
void PreDeletedCheck(XObjectPointerArray& objarray, CK2::CKContext* ctx);
/**
* @brief Check Object pointer validation and remove invalid pointers after deletion.
* @param objarray
* @param ctx
* @remark The performance of this function is extremely low. Use it carefully.
*/
void PostDeletedCheck(XObjectPointerArray& objarray, CK2::CKContext* ctx);
/**
* @brief Check Object pointer validation and remove invalid pointers before deletion.
* @param objarray
* @param ctx
*/
void PreDeletedCheck(XList<CK2::ObjImpls::CKObject*>& objarray, CK2::CKContext* ctx);
/**
* @brief Check Object pointer validation and remove invalid pointers after deletion.
* @param objarray
* @param ctx
* @remark The performance of this function is extremely low. Use it carefully.
*/
void PostDeletedCheck(XList<CK2::ObjImpls::CKObject*>& objarray, CK2::CKContext* ctx);
}
}