Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add _get_type_id to Impl #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
maksimdrachov marked this conversation as resolved.
Show resolved Hide resolved
{
return {0xB6, 0x87, 0x48, 0xA6, 0x7A, 0xDB, 0x4D, 0xF1, 0xB3, 0x1D, 0xA9, 0x8D, 0x50, 0xA7, 0x82, 0x47};
}

pavel-kirienko marked this conversation as resolved.
Show resolved Hide resolved
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_;
pavel-kirienko marked this conversation as resolved.
Show resolved Hide resolved
};

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

using EventProxy::_get_type_id_;

pavel-kirienko marked this conversation as resolved.
Show resolved Hide resolved
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_;

pavel-kirienko marked this conversation as resolved.
Show resolved Hide resolved
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