Skip to content

Commit

Permalink
Added Pool::getHandle()
Browse files Browse the repository at this point in the history
  • Loading branch information
corporateshark committed Feb 18, 2024
1 parent db6f755 commit a45ff2c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lvk/Pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ class Pool {
assert(handle.gen() == objects_[index].gen_); // accessing deleted object
return &objects_[index].obj_;
}
Handle<ObjectType> getHandle(uint32_t index) const {
assert(index < objects_.size());
if (index >= objects_.size())
return {};

return Handle<ObjectType>(index, objects_[index].gen_);
}
Handle<ObjectType> findObject(const ImplObjectType* obj) {
if (!obj)
return {};
Expand Down

0 comments on commit a45ff2c

Please sign in to comment.