15 #ifndef hifi_workload_Space_h
16 #define hifi_workload_Space_h
20 #include <glm/glm.hpp>
22 #include "Transaction.h"
26 class Space :
public Collection {
28 using ProxyUpdate = std::pair<int32_t, Sphere>;
32 Change(int32_t i, uint32_t c, uint32_t p) : proxyId(i), region(c), prevRegion(p) {}
33 int32_t proxyId { -1 };
35 uint8_t prevRegion { 0 };
40 void setViews(
const Views& views);
42 uint32_t getNumViews()
const {
return (uint32_t)(_views.size()); }
43 void copyViews(std::vector<View>& copy)
const;
45 uint32_t getNumObjects()
const {
return _IDAllocator.getNumLiveIndices(); }
46 uint32_t getNumAllocatedProxies()
const {
return (uint32_t)(_IDAllocator.getNumAllocatedIndices()); }
48 void categorizeAndGetChanges(std::vector<Change>& changes);
49 uint32_t copyProxyValues(Proxy* proxies, uint32_t numDestProxies)
const;
50 uint32_t copySelectedProxyValues(Proxy::Vector& proxies,
const workload::indexed_container::Indices& indices)
const;
52 const Owner getOwner(int32_t proxyID)
const;
53 uint8_t getRegion(int32_t proxyID)
const;
55 void clear()
override;
58 void processTransactionFrame(
const Transaction& transaction)
override;
59 void processResets(
const Transaction::Resets& transactions);
60 void processRemoves(
const Transaction::Removes& transactions);
61 void processUpdates(
const Transaction::Updates& transactions);
64 mutable std::mutex _proxiesMutex;
65 Proxy::Vector _proxies;
66 std::vector<Owner> _owners;
71 using SpacePointer = std::shared_ptr<Space>;
72 using Changes = std::vector<Space::Change>;
73 using IndexVectors = std::vector<IndexVector>;
74 using Timing_ns = std::chrono::nanoseconds;
75 using Timings = std::vector<Timing_ns>;