28#include "utility/event/hand_event.hpp"
30namespace utility::event
40 float _amplitude { 1.0F };
43 float _frequencyHz { 0.0F };
46 std::int64_t _durationNs { 0 };
61 std::shared_ptr<Event>
create(
void)
const override;
67 std::shared_ptr<HandHapticEvent>
createTyped(
void)
const;
Abstract factory interface for creating events.
Abstract base class for hand events.
Factory for creating HandHapticEvent instances.
std::shared_ptr< HandHapticEvent > createTyped(void) const
Create a strongly-typed HandHapticEvent.
std::shared_ptr< Event > create(void) const override
Create a HandHapticEvent as base Event pointer.
Shared behavior for hand haptic output events.
HandHapticEvent & setDurationNs(const std::int64_t durationNs) noexcept
Backward-compatible alias for setDuration.
HandHapticEvent & setDuration(const std::int64_t duration) noexcept
Set the number of nanoseconds the vibration should last.
float getFrequencyHz(void) const noexcept
Backward-compatible alias for getFrequency.
float getAmplitude(void) const noexcept
Get haptic amplitude.
float getFrequency(void) const noexcept
Get the frequency of the vibration in Hz.
std::int64_t getDurationNs(void) const noexcept
Backward-compatible alias for getDuration.
HandHapticEvent & setFrequencyHz(const float frequencyHz) noexcept
Backward-compatible alias for setFrequency.
HandHapticEvent(void)
Default constructor.
std::int64_t getDuration(void) const noexcept
Get the number of nanoseconds the vibration should last.
~HandHapticEvent(void) override
Default destructor.
HandHapticEvent & setAmplitude(const float amplitude) noexcept
Set haptic amplitude.
HandHapticEvent & setFrequency(const float frequency) noexcept
Set the frequency of the vibration in Hz.