17 #if !defined(OPENNURBS_MAP_INC_)
18 #define OPENNURBS_MAP_INC_
316 std::size_t max_count,
350 SN_BLOCK_CAPACITY = 8192,
352 ID_HASH_TABLE_COUNT = 8192
358 std::size_t m_purged;
359 unsigned int m_sorted;
362 struct SN_ELEMENT m_sn[SN_BLOCK_CAPACITY];
364 void CullBlockHelper();
365 void SortBlockHelper();
366 bool IsValidBlock(
ON_TextLog* textlog,
struct SN_ELEMENT*
const* hash_table,std::size_t* active_id_count)
const;
367 struct SN_ELEMENT* BinarySearchBlockHelper(
unsigned int sn);
368 static int CompareMaxSN(
const void*,
const void*);
369 std::size_t ActiveElementEstimate(
unsigned int sn0,
unsigned int sn1)
const;
373 unsigned int m_maxsn;
374 unsigned int m_reserved;
377 ON_MEMORY_POOL* m_pool;
380 std::size_t m_sn_count;
381 std::size_t m_sn_purged;
384 bool m_bHashTableIsValid;
385 std::size_t m_active_id_count;
400 struct SN_BLOCK** m_snblk_list;
401 std::size_t m_snblk_list_capacity;
402 std::size_t m_snblk_list_count;
409 struct SN_BLOCK* m_e_blk;
414 SN_BLOCK m_sn_block0;
416 struct SN_ELEMENT* FindElementHelper(
unsigned int sn);
417 void UpdateMaxSNHelper();
418 void GarbageCollectHelper();
419 std::size_t GarbageCollectMoveHelper(SN_BLOCK* dst,SN_BLOCK* src);
425 struct SN_ELEMENT* m_hash_table[ID_HASH_TABLE_COUNT];
426 std::size_t HashIndex(
const ON_UUID*)
const;
427 void InvalidateHashTableHelper();
428 bool RemoveBlockFromHashTableHelper(
const struct SN_BLOCK* blk);
429 void AddBlockToHashTableHelper(
struct SN_BLOCK* blk);
430 void BuildHashTableHelper();
struct SN_ELEMENT * FindId(ON_UUID) const
struct SN_ELEMENT * FindSerialNumber(unsigned int sn) const
std::size_t ActiveSerialNumberCount() const
ON_SerialNumberMap(ON_MEMORY_POOL *pool=0)
struct SN_ELEMENT * RemoveSerialNumberAndId(unsigned int sn)
struct SN_ELEMENT * RemoveId(unsigned int sn, ON_UUID id)
bool IsValid(ON_TextLog *textlog) const
struct SN_ELEMENT * LastElement() const
std::size_t ActiveIdCount() const
std::size_t GetElements(unsigned int sn0, unsigned int sn1, std::size_t max_count, ON_SimpleArray< SN_ELEMENT > &elements) const
struct SN_ELEMENT * FirstElement() const
struct SN_ELEMENT * AddSerialNumberAndId(unsigned int sn, ON_UUID id)
void Dump(ON_TextLog &text_log) const
struct SN_ELEMENT * AddSerialNumber(unsigned int sn)
void Dump(ON_TextLog &) const
unsigned char m_sn_active
unsigned char m_reserved1
unsigned char m_id_active
struct SN_ELEMENT * m_next
unsigned char m_reserved2