12 #include "../clib/clib_endian.h" 13 #include "../clib/logfacility.h" 14 #include "../clib/streamsaver.h" 15 #include "../plib/systemstate.h" 33 if ( itr !=
hash.end() )
36 POLLOG.Format(
"ObjectHash insert failed for object serial 0x{:X}. (duplicate serial?)\n" )
55 if ( itr !=
hash.end() )
56 return ( itr->second ).get();
64 u32 tempserial = curr + 1;
70 if ( tempserial < ITEMSERIAL_START || tempserial >
ITEMSERIAL_END )
73 if (
hash.find( tempserial ) !=
hash.end() )
99 u32 tempserial = curr + 1;
108 if (
hash.find( tempserial ) !=
hash.end() )
134 sw() <<
"Object Count: " <<
hash.size() <<
"\n";
135 for ( itr =
hash.begin(), itrend =
hash.end(); itr != itrend; ++itr )
137 sw() <<
"type: " << itr->second->classname() <<
" serial: 0x" 138 << fmt::hexu( itr->second->serial ) <<
" name: " << itr->second->name() <<
"\n";
151 hs::size_type count =
hash.size();
154 hs::size_type count_this = count / 60;
155 if ( count_this < 1 )
160 while ( count_this-- )
162 UObject* obj = ( *reap_iterator ).second.get();
189 unsigned skipped = 0;
192 UObject* obj = ( *itr ).second.get();
208 INFO_PRINT <<
"Leftover objects in objecthash: " <<
hash.size() <<
"\n";
213 INFO_PRINT <<
"Leaking a copy of the objecthash in order to avoid a crash.\n";
224 UObject* obj = ( *itr ).second.get();
std::map< u32, UObjectRef > hs
u32 GetNextUnusedItemSerial()
hs::const_iterator OH_const_iterator
OH_iterator reap_iterator
hs::const_iterator begin() const
unsigned ref_counted_count() const
void RegisterCleanDeletedSerial(u32 serial)
UObject * Find(u32 serial)
const u32 CHARACTERSERIAL_START
const u32 CHARACTERSERIAL_END
ds::const_iterator dirty_deleted_end() const
void ClearCharacterAccountReferences()
virtual void destroy() POL_OVERRIDE
u32 GetCurrentItemSerialNumber(void)
bool Insert(UObject *obj)
u32 GetCurrentCharSerialNumber(void)
hs::const_iterator end() const
void PrintContents(Clib::StreamWriter &sw) const
const u32 ITEMSERIAL_START
u32 GetNextUnusedCharSerial()
ds::const_iterator dirty_deleted_begin() const