MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ scheduler()

InspectResult & MayaFlux::Portal::Forma::Inspector::scheduler ( Surface &  surface,
LayoutCursor &  cursor,
float  x_min = -0.95F,
float  x_max = 0.95F,
float  row_h = 0.05F 
)

Inspect the full TaskScheduler state.

Header shows total task count. Each task is a collapsible whose header is the routine's dynamic type name, with name, token, active, and delay context as sub-fields.

Persistent: the first call builds the result against surface and cursor and keeps it on this Inspector. Subsequent calls return the same result regardless of the supplied surface and cursor; the original window remains the render target. destroy() releases it, and the next call builds afresh.

Definition at line 55 of file SchedulerQuery.cpp.

59{
61 return *m_scheduler_result;
62 }
63
64 const std::vector<EntrySpec> root_entrys {
65 EntrySpec {
66 .label = "tasks",
67 .reader = [&m_sched = m_sched] {
68 return std::to_string(m_sched.get_all_tasks().size());
69 },
70 },
71 };
72
73 auto hbuf = make_header_buffer(surface.window());
74 auto rbufs = make_row_buffers(surface.window(), root_entrys.size());
75 auto root_group = make_entry_group(root_entrys, "TaskScheduler", std::move(hbuf), rbufs,
76 surface, cursor, x_min, x_max, row_h, true);
77
78 InspectResult& result = m_scheduler_result.emplace();
79 result.group = std::move(root_group);
80
81 const auto tasks = m_sched.get_all_tasks();
82 for (const auto& entry : tasks) {
83 if (!entry.routine)
84 continue;
85
86 auto task_result = inspect_task(
87 entry, surface, cursor,
88 x_min, x_max, row_h);
89
90 result.group.header.attach(surface.layer(), task_result.group.header.header_id);
91 result.children.push_back(std::move(task_result));
92 }
93
94 return result;
95}
std::shared_ptr< Buffers::FormaBuffer > make_header_buffer(const std::shared_ptr< Core::Window > &window) const
A "text"-slotted buffer, registered with the BufferManager.
Definition Inspector.cpp:11
InspectResult tasks(Vruta::ProcessingToken token, Surface &surface, LayoutCursor &cursor, float x_min=-0.95F, float x_max=0.95F, float row_h=0.05F)
Inspect tasks for a specific processing token.
std::vector< EntryBuffer > make_row_buffers(const std::shared_ptr< Core::Window > &window, size_t count) const
count row targets, slices of one "text"-slotted buffer, for make_entry_group's rows.
Definition Inspector.cpp:24
std::optional< InspectResult > m_scheduler_result
InspectResult inspect_task(const Vruta::TaskEntry &entry, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h)
Vruta::TaskScheduler & m_sched
const std::vector< TaskEntry > & get_all_tasks()
Get all tasks for inspection/debugging.
EntryGroup make_entry_group(std::span< const EntrySpec > entrys, std::string_view header_label, FormaTarget header_buf, std::span< const EntryBuffer > row_bufs, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h, bool initially_open)
Construct a collapsible header followed by N entry rows under it.
Definition Entry.cpp:104

References MayaFlux::Portal::Forma::Collapsible::attach(), MayaFlux::Portal::Forma::InspectResult::children, MayaFlux::Vruta::TaskScheduler::get_all_tasks(), MayaFlux::Portal::Forma::InspectResult::group, MayaFlux::Portal::Forma::EntryGroup::header, inspect_task(), MayaFlux::Portal::Forma::EntrySpec::label, MayaFlux::Portal::Forma::Surface::layer(), m_sched, m_scheduler_result, MayaFlux::Portal::Forma::make_entry_group(), make_header_buffer(), make_row_buffers(), tasks(), and MayaFlux::Portal::Forma::Surface::window().

Referenced by MayaFlux::Portal::Forma::inspect_scheduler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: