Skip to content

Commit

Permalink
Add _get_type_id to Impl
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimdrachov committed Nov 29, 2024
1 parent 306a574 commit 60b0d70
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/olg_scheduler/olg_scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ class Event : private cavl::Node<Event<TimePoint>>
/// It is guaranteed that while an event resides in the tree, it has a valid deadline set.
[[nodiscard]] std::optional<TimePoint> getDeadline() const noexcept { return deadline_; }

static constexpr std::array<std::uint8_t, 16> _get_type_id_() noexcept
{
return {0xB6, 0x87, 0x48, 0xA6, 0x7A, 0xDB, 0x4D, 0xF1, 0xB3, 0x1D, 0xA9, 0x8D, 0x50, 0xA7, 0x82, 0x47};
}

protected:
using Tree = cavl::Tree<Event>;
using cavl::Node<Event>::remove;
Expand Down Expand Up @@ -189,6 +194,7 @@ class EventLoop final
{
public:
using Event<time_point>::execute;
using Event<time_point>::_get_type_id_;
};

public:
Expand Down Expand Up @@ -219,6 +225,8 @@ class EventLoop final
this->schedule(Clock::now() + period_, owner.tree_);
}

using EventProxy::_get_type_id_;

private:
void execute(const Arg<time_point>& args, Tree& tree) override
{
Expand Down Expand Up @@ -250,6 +258,8 @@ class EventLoop final
this->schedule(Clock::now() + min_period_, owner.tree_);
}

using EventProxy::_get_type_id_;

private:
void execute(const Arg<time_point>& args, Tree& tree) override
{
Expand Down Expand Up @@ -277,6 +287,8 @@ class EventLoop final
this->schedule(deadline, owner.tree_);
}

using EventProxy::_get_type_id_;

private:
void execute(const Arg<time_point>& args, Tree&) override
{
Expand Down

0 comments on commit 60b0d70

Please sign in to comment.