50 static constexpr NullFunc no_release =
nullptr;
85 std::function<
void()> on_release =
nullptr);
106 std::function<
void(
double,
double)> on_release =
nullptr);
115 std::function<
void(
double,
double)> on_release);
141 std::function<
void(
double,
double)> fn);
148 Wiring& move_to(
const glm::vec3& pos,
double delay_seconds = 0.0);
154 Wiring& position_from(PositionFn fn);
161 Wiring& position_from(std::string fn_name, PositionFn fn);
176 Wiring& use(SoundFactory factory);
177 Wiring& use(GraphicsFactory factory);
178 Wiring& use(CrossFactory factory);
179 Wiring& use(EventFactory factory);
182 Wiring& use(std::string fn_name, SoundFactory factory);
183 Wiring& use(std::string fn_name, GraphicsFactory factory);
184 Wiring& use(std::string fn_name, CrossFactory factory);
185 Wiring& use(std::string fn_name, EventFactory factory);
203 Wiring& bind(std::function<
void()> fn);
211 Wiring& bind(std::function<
void()> attach, std::function<
void()> detach);
214 Wiring& bind(std::string fn_name, std::function<
void()> fn);
217 Wiring& bind(std::string attach_name, std::function<
void()> attach,
218 std::string detach_name, std::function<
void()> detach);
244 , m_entity_id(entity_id)
267 std::optional<std::function<void(
double,
double)>>
on_release;
273 std::function<void(
double,
double)>
fn;
298 using Factory = std::variant<std::monostate, SoundFactory, GraphicsFactory, CrossFactory>;
301 std::string make_name(
const char* prefix)
const;
304 bool m_has_scheduling {};
311 size_t m_times { 1 };
342 [[nodiscard]] uint32_t entity_id()
const {
return m_entity_id; }
348 [[nodiscard]] std::optional<double>
duration()
const {
return m_duration; }
354 [[nodiscard]]
const std::vector<MoveStep>&
move_steps()
const {
return m_move_steps; }
357 [[nodiscard]]
bool is_scroll()
const {
return std::holds_alternative<ScrollTrigger>(m_trigger); }
372 [[nodiscard]]
bool has_bind()
const {
return m_bind_attach.has_value(); }
381 [[nodiscard]]
const std::string&
factory_name()
const {
return m_factory_name; }
std::weak_ptr< Core::Window > window
Orchestrates spatial indexing and scheduling for Nexus objects.
Serializes Fabric state to an EXR texture and JSON schema.
std::optional< std::function< void()> > m_bind_detach
bool has_position_fn() const
True if position_from was called.
const Trigger & trigger() const
Active trigger variant set by on.
std::string m_position_fn_name
bool is_scroll() const
True if on_scroll was called.
bool has_bind_detach() const
True if bind(attach, detach) was called.
std::function< Vruta::CrossRoutine()> CrossFactory
std::string m_bind_attach_name
const std::string & position_fn_name() const
Name of the position function, empty if anonymous.
const std::string & bind_attach_name() const
Name of the bind attach function, empty if anonymous or none.
const std::string & factory_name() const
Name of the active factory, empty if anonymous or none.
Wiring(Wiring &&) noexcept=default
const EFactory & event_factory() const
Active event-factory, if use(EventFactory) was called.
std::function< glm::vec3()> PositionFn
std::optional< std::function< void()> > m_bind_attach
const std::vector< MoveStep > & move_steps() const
Choreography steps from move_to calls.
std::optional< double > m_duration
std::optional< EventFactory > EFactory
Wiring & operator=(const Wiring &)=delete
std::function< Vruta::GraphicsRoutine()> GraphicsFactory
std::function< Vruta::Event(Vruta::TaskScheduler &)> EventFactory
const std::string & bind_detach_name() const
Name of the bind detach function, empty if anonymous or none.
std::optional< double > m_interval
const Factory & factory() const
Active factory variant set by use for non-Event factories.
bool has_bind() const
True if any bind overload was called.
std::optional< double > interval() const
Recurring interval in seconds, if every was called.
std::optional< double > duration() const
Active duration in seconds, if for_duration was called.
Wiring(const Wiring &)=delete
std::string m_bind_detach_name
std::vector< MoveStep > m_move_steps
std::string m_factory_name
size_t times_count() const
Repetition count set by times, default 1.
std::optional< PositionFn > m_position_fn
Wiring(Fabric &fabric, uint32_t entity_id)
std::variant< std::monostate, SoundFactory, GraphicsFactory, CrossFactory > Factory
std::variant< std::monostate, KeyTrigger, MouseTrigger, NetworkTrigger, EventTrigger, WindowEventTrigger, ScrollTrigger > Trigger
std::function< Vruta::SoundRoutine()> SoundFactory
Fluent builder that wires an entity into Fabric's scheduling infrastructure.
Coroutine resumed by more than one clock.
Base for event filters used by EventSources to match signals to awaiters.
Abstract base for all awaitable signal sources.
Coroutine type for event-driven suspension.
A C++20 coroutine-based graphics processing task with frame-accurate timing.
Awaitable broadcast message stream for a network endpoint.
A C++20 coroutine-based audio processing task with sample-accurate timing.
Token-based multimodal task scheduling system for unified coroutine processing.
Awaitable stream of window input events.
MouseButtons
Enumeration for mouse buttons.
void on_scroll(const std::shared_ptr< Core::Window > &window, std::function< void(double, double)> callback, std::string name)
Schedule a mouse scroll handler.
Vruta::EventFilter filter
Vruta::EventSource * source
std::shared_ptr< Core::Window > window
std::optional< std::function< void()> > on_release
std::optional< std::function< void(double, double)> > on_release
std::shared_ptr< Core::Window > window
Vruta::NetworkSource * source
Vruta::WindowEventFilter filter
Filter criteria for window input events.