53 typedef std::map<uintptr_t, SerializableObject*, std::less<uintptr_t> >
forwardType;
56 typedef std::map<SerializableObject*, uintptr_t, std::less<SerializableObject*> >
reverseType;
59 typename forwardType::const_iterator
begin()
63 typename forwardType::const_iterator
end()
132 static_assert(std::is_base_of_v<SerializableObject, T> ==
true);
Declaration of SerializableObject.
Definition AcceleratorBuffer.h:204
Bidirectional table mapping integer IDs in scopesession files to object pointers.
Definition IDTable.h:49
void ReserveID(uintptr_t id)
Marks an ID as unavailable for use, without assigning an pointer to it.
Definition IDTable.h:123
void erase(SerializableObject *key)
Erase an entry given a reverse key.
Definition IDTable.h:167
size_t size() const
Return the number of entries in the bijection.
Definition IDTable.h:186
reverseType m_reverseMap
Map of object-to-object in the reverse direction.
Definition IDTable.h:198
std::map< SerializableObject *, uintptr_t, std::less< SerializableObject * > > reverseType
Type of the reverse map.
Definition IDTable.h:56
void replace(SerializableObject *oldval, SerializableObject *newval)
Replaces one value with another, keeping the keys identical.
Definition IDTable.h:177
T * Lookup(uintptr_t id)
Type-safe object lookup.
Definition IDTable.h:130
void clear()
Deletes all entries from the table.
Definition IDTable.h:143
uintptr_t emplace(SerializableObject *p)
Store a new object in the table.
Definition IDTable.h:80
bool HasID(uintptr_t id)
Checks if we have an object with a specific ID.
Definition IDTable.h:117
uintptr_t m_nextID
Index of the next ID to be assigned.
Definition IDTable.h:192
std::map< uintptr_t, SerializableObject *, std::less< uintptr_t > > forwardType
Type of the forward map.
Definition IDTable.h:53
forwardType m_forwardMap
Map of object-to-object in the forward direction.
Definition IDTable.h:195
void emplace(uintptr_t id, SerializableObject *p)
Store a new object in the table using a specific ID.
Definition IDTable.h:97
bool HasID(SerializableObject *p)
Checks if we have an object at a specific pointer.
Definition IDTable.h:109
uintptr_t operator[](SerializableObject *key)
Forward lookup.
Definition IDTable.h:137
void erase(uintptr_t key)
Erase an entry given a forward key.
Definition IDTable.h:155
forwardType::const_iterator begin()
Get an iterator to the start of the forward map.
Definition IDTable.h:59
forwardType::const_iterator end()
Get an iterator to the end of the forward map.
Definition IDTable.h:63
Definition SerializableObject.h:40