Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
object_tracker.h
1#pragma once
2
3#include "sound_bakery/core/core_fwd.h"
4
5namespace sbk::core
6{
17 class SB_CLASS object_tracker
18 {
19 public:
20 void track_object(object* object);
21 void untrack_object(object* object, std::optional<rttr::type> typeOverride = std::nullopt);
22
23 [[nodiscard]] std::unordered_set<object*> get_objects_of_category(const SB_OBJECT_CATEGORY& category) const;
24 [[nodiscard]] std::unordered_set<object*> get_objects_of_type(const rttr::type& type) const;
25
26 private:
27 void on_object_destroyed(object* object);
28
29 std::unordered_map<SB_OBJECT_CATEGORY, std::unordered_set<object*>> m_categoryToObjects;
30 std::unordered_map<rttr::type, std::unordered_set<object*>> m_typeToObjects;
31 };
32} // namespace sbk::core
Definition database_ptr.h:23
Tracks object categories and types.
Definition object_tracker.h:18