improved Object referring

This commit is contained in:
hyzboy 2024-11-26 00:42:36 +08:00
parent 7c08fbc530
commit 680b7717fc
2 changed files with 18 additions and 4 deletions

View File

@ -10,4 +10,6 @@ namespace hgl
}; };
#define HGL_SOURCE_CODE_LOCATION __FILE__,__FUNCTION__,__LINE__ #define HGL_SOURCE_CODE_LOCATION __FILE__,__FUNCTION__,__LINE__
#define HGL_SCL_HERE SourceCodeLocation(HGL_SOURCE_CODE_LOCATION)
}//namespace hgl }//namespace hgl

View File

@ -2,17 +2,29 @@
#pragma once #pragma once
#include<hgl/type/object/ObjectBaseInfo.h> #include<hgl/type/object/ObjectBaseInfo.h>
#include<hgl/type/SortedSet.h> #include<hgl/type/List.h>
#include<tsl/robin_set.h> //#include<tsl/robin_map.h>
namespace hgl namespace hgl
{ {
struct ObjectReferringRecord
{
ObjectSimpleInfo osi;
size_t refer_serial; ///<引用序号
SourceCodeLocation scl;
};
/** /**
* *
*/ */
struct ObjectRelation struct ObjectRelation
{ {
tsl::robin_set<ObjectSimpleInfo> follow_me; ///<引用自己的对象 List<ObjectReferringRecord> referring_me; ///<引用自己的对象
tsl::robin_set<ObjectSimpleInfo> me_follow; ///<自己引用的对象 List<ObjectReferringRecord> me_referring; ///<自己引用的对象
//tsl::robin_map< size_t, /*refer_serial*/
// ObjectReferringRecord *> referring_me_map; ///<引用自己的对象
};//struct ObjectRelation };//struct ObjectRelation
}//namespace hgl }//namespace hgl