From 680b7717fc9253b138108b5f59b985f6bbc5b4e3 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 26 Nov 2024 00:42:36 +0800 Subject: [PATCH] improved Object referring --- inc/hgl/SourceCodeLocation.h | 2 ++ inc/hgl/type/object/ObjectRelation.h | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/inc/hgl/SourceCodeLocation.h b/inc/hgl/SourceCodeLocation.h index d42b0a4..8587e1b 100644 --- a/inc/hgl/SourceCodeLocation.h +++ b/inc/hgl/SourceCodeLocation.h @@ -10,4 +10,6 @@ namespace hgl }; #define HGL_SOURCE_CODE_LOCATION __FILE__,__FUNCTION__,__LINE__ + + #define HGL_SCL_HERE SourceCodeLocation(HGL_SOURCE_CODE_LOCATION) }//namespace hgl diff --git a/inc/hgl/type/object/ObjectRelation.h b/inc/hgl/type/object/ObjectRelation.h index aa7c00c..c91a0d7 100644 --- a/inc/hgl/type/object/ObjectRelation.h +++ b/inc/hgl/type/object/ObjectRelation.h @@ -2,17 +2,29 @@ #pragma once #include -#include -#include +#include +//#include namespace hgl { + struct ObjectReferringRecord + { + ObjectSimpleInfo osi; + + size_t refer_serial; ///<引用序号 + + SourceCodeLocation scl; + }; + /** * 对象引用关系 */ struct ObjectRelation { - tsl::robin_set follow_me; ///<引用自己的对象 - tsl::robin_set me_follow; ///<自己引用的对象 + List referring_me; ///<引用自己的对象 + List me_referring; ///<自己引用的对象 + + //tsl::robin_map< size_t, /*refer_serial*/ + // ObjectReferringRecord *> referring_me_map; ///<引用自己的对象 };//struct ObjectRelation }//namespace hgl