From 23d88aa2812c361d30abefeeb296548698409bf5 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 21 Apr 2022 10:32:35 -0700 Subject: More progress, mostly planning and playing. I'm trying to find the right design usage patterns for using the archive system with tagging and lists and dictionaries. Also, are there other structures that I'm missing? --- src/stable/archivebinary.cpp | 41 +---------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'src/stable/archivebinary.cpp') diff --git a/src/stable/archivebinary.cpp b/src/stable/archivebinary.cpp index 04e80d2..f46bd28 100644 --- a/src/stable/archivebinary.cpp +++ b/src/stable/archivebinary.cpp @@ -13,8 +13,7 @@ Bu::ArchiveBinary::ArchiveBinary( Stream &rStream, bool bLoading ) : bLoading( bLoading ), - rStream( rStream ), - nNextID( 1 ) + rStream( rStream ) { } @@ -236,44 +235,6 @@ bool Bu::ArchiveBinary::isLoading() return bLoading; } -uint32_t Bu::ArchiveBinary::getID( const void *ptr ) -{ - if( hPtrID.has( (ptrdiff_t)ptr ) ) - return hPtrID.get( (ptrdiff_t)ptr ); - hPtrID.insert( (ptrdiff_t)ptr, nNextID ); - return nNextID++; -} - -void Bu::ArchiveBinary::assocPtrID( void **ptr, uint32_t id ) -{ - if( hPtrID.has( id ) ) - { - *ptr = (void *)hPtrID.get( id ); - return; - } - - if( !hPtrDest.has( id ) ) - hPtrDest.insert( id, List() ); - - hPtrDest[id].getValue().append( ptr ); -} - -void Bu::ArchiveBinary::readID( const void *ptr, uint32_t id ) -{ - hPtrID.insert( id, (ptrdiff_t)ptr ); - - if( hPtrDest.has( id ) ) - { - Bu::List &l = hPtrDest.get( id ); - for( Bu::List::iterator i = l.begin(); i != l.end(); i++ ) - { - *(*i) = (void *)ptr; - } - - hPtrDest.erase( id ); - } -} - void Bu::ArchiveBinary::setProperty( const Bu::Blob &rKey, const Bu::Variant &rValue ) { hProps.insert( rKey, rValue ); -- cgit v1.2.3