Timeline: perform track profile with given interpreter object

This commit is contained in:
Fischlurch 2019-04-10 01:58:11 +02:00
parent e85f218045
commit 972ec9851b

View file

@ -80,7 +80,7 @@ namespace timeline {
struct TrackProfile
{
using SlopeVerb = lib::VerbToken<ProfileInterpreter, void(uint)>;
using SlopeElm = std::tuple<SlopeVerb, uint>;
using SlopeElm = std::pair<SlopeVerb, uint>;
using Elements = std::vector<SlopeElm>;
Elements elements;
@ -93,6 +93,13 @@ namespace timeline {
return not util::isnil (elements);
}
void
performWith (ProfileInterpreter& interpreter)
{
for (auto& slopeElm : elements)
slopeElm.first.applyTo (interpreter, uint(slopeElm.second));
}
private:/* ===== Internals: handling tokens ===== */
void
append (SlopeVerb::Handler handler, Literal token, uint param)