class UberStructSystem

Defined at line 31 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.h

TODO(https://fxbug.dev/42122511): write a bug to find a better name for this system

A system for aggregating local data from Flatland instances to be consumed by the render loop.

All functions are thread safe. The intent is for separate worker threads to own each Flatland

instance, compute local data (such as topology vectors) in their local thread, and then commit

those vectors to this class in a concurrent manner.

Public Methods

TransformHandle::InstanceId GetNextInstanceId ()

Returns the next instance ID for this particular UberStructSystem. Instance IDs are guaranteed

to be unique for each caller and should be used as keys for setting UberStructs and accessing

UberStructs in snapshots.

Defined at line 19 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

std::shared_ptr<UberStructQueue> AllocateQueueForSession (scheduling::SessionId session_id)

Allocates an UberStructQueue for |session_id| and returns a shared reference to that

UberStructQueue. Callers should call |RemoveSession| when the session associated with that

|session_id| has exited to clean up the allocated resources.

Defined at line 28 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

void UberStructSystem ()

Defined at line 33 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.h

void RemoveSession (scheduling::SessionId session_id)

Removes the UberStructQueue and current UberStruct associated with |session_id|. Any

PendingUberStructs pushed into the queue after this call will never be published to the

InstanceMap.

Defined at line 39 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

UpdateResults UpdateInstances (const std::unordered_map<scheduling::SessionId, scheduling::PresentId> & instances_to_update)

Commits a new UberStruct to the instance map for each key/value pair in |sessions_to_update|.

All pending UberStructs associated with each SessionId with lower PresentIds will be

discarded.

Defined at line 46 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

const UberStructSnapshot & Snapshot ()

Snapshots the current map of UberStructs and returns the copy.

Note that this function returns a reference. This structure may only be modified on main

thread.

Defined at line 120 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

void ForceUpdateAllSessions (size_t max_updates_per_queue)

For pushing all pending UberStructs in tests.

Defined at line 106 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

bool MustRecomputeViewTree ()

Returns true if the ViewTree needs to be recomputed. Clears the stored value, so immediatlely

calling it a second time will always return false.

Defined at line 109 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.h

size_t GetSessionCount ()

For validating cleanup logic in tests.

Defined at line 122 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

TransformHandle::InstanceId GetLatestInstanceId ()

For getting Flatland InstanceIds in tests.

Defined at line 124 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

Records