49 static constexpr NullFunc no_release =
nullptr;
83 Wiring& on(std::shared_ptr<Core::Window> window,
IO::Keys key,
bool held,
84 std::function<
void()> on_release =
nullptr);
105 std::function<
void(
double,
double)> on_release =
nullptr);
114 std::function<
void(
double,
double)> on_release);
134 Wiring& move_to(
const glm::vec3& pos,
double delay_seconds = 0.0);
140 Wiring& position_from(PositionFn fn);
147 Wiring& position_from(std::string fn_name, PositionFn fn);
162 Wiring& use(SoundFactory factory);
163 Wiring& use(GraphicsFactory factory);
164 Wiring& use(CrossFactory factory);
165 Wiring& use(EventFactory factory);
168 Wiring& use(std::string fn_name, SoundFactory factory);
169 Wiring& use(std::string fn_name, GraphicsFactory factory);
170 Wiring& use(std::string fn_name, CrossFactory factory);
171 Wiring& use(std::string fn_name, EventFactory factory);
189 Wiring& bind(std::function<
void()> fn);
197 Wiring& bind(std::function<
void()> attach, std::function<
void()> detach);
200 Wiring& bind(std::string fn_name, std::function<
void()> fn);
203 Wiring& bind(std::string attach_name, std::function<
void()> attach,
204 std::string detach_name, std::function<
void()> detach);
229 , m_entity_id(entity_id)
252 std::optional<std::function<void(
double,
double)>>
on_release;
270 using Trigger = std::variant<std::monostate, KeyTrigger, MouseTrigger, NetworkTrigger, EventTrigger, WindowEventTrigger>;
271 using Factory = std::variant<std::monostate, SoundFactory, GraphicsFactory, CrossFactory>;
274 std::string make_name(
const char* prefix)
const;
277 bool m_has_scheduling {};
284 size_t m_times { 1 };
315 [[nodiscard]] uint32_t entity_id()
const {
return m_entity_id; }
318 [[nodiscard]] std::optional<double>
interval()
const {
return m_interval; }
321 [[nodiscard]] std::optional<double>
duration()
const {
return m_duration; }
327 [[nodiscard]]
const std::vector<MoveStep>&
move_steps()
const {
return m_move_steps; }
342 [[nodiscard]]
bool has_bind()
const {
return m_bind_attach.has_value(); }
351 [[nodiscard]]
const std::string&
factory_name()
const {
return m_factory_name; }
Orchestrates spatial indexing and scheduling for Nexus objects.
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 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::variant< std::monostate, KeyTrigger, MouseTrigger, NetworkTrigger, EventTrigger, WindowEventTrigger > Trigger
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::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 GLFW window input events.
MouseButtons
Enumeration for mouse buttons.
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 GLFW window input events.