Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
activity-lang.cpp
Go to the documentation of this file.
1/*
2 ActivityLang - definition language framework for scheduler activities
3
4 Copyright (C)
5 2023, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
25#include "lib/format-obj.hpp"
26#include "lib/symbol.hpp"
28
29#include <string>
30#include <boost/functional/hash.hpp>
31
32using std::string;
33using lib::Symbol;
34using lib::time::Time;
36
37
38namespace vault{
39namespace gear {
40 namespace activity {
41 Hook::~Hook() { } // emit VTable here...
42 }
44 HashVal
46 {
47 return boost::hash_value (uint32_t{id});
48 }
49
50 Symbol WorkTiming::WORKSTART{"WorkStart"};
51 Symbol WorkTiming::WORKSTOP {"WorkStop"};
52
54
55
56 Activity::operator string() const
57 {
58 return string{"Act("}
59 + showVerb()
60 + util::showAdr(this)
61 + ": "
62 + showData()
63 + "; ⤵ "
64 + (next? next->showVerb()+util::showAdr(*next)
66 + ")";
67 }
68
69 string
71 {
72 switch (verb_) {
73 case INVOKE: return "INVOKE";
74 case WORKSTART: return "WORKSTART";
75 case WORKSTOP: return "WORKSTOP";
76 case NOTIFY: return "NOTIFY";
77 case GATE: return "GATE";
78 case POST: return "POST";
79 case FEED: return "FEED";
80 case HOOK: return "HOOK";
81 case TICK: return "TICK";
82 default: NOTREACHED ("uncovered Activity verb diagnostics.");
83 }
84 }
85
86 string
88 {
89 switch (verb_) {
90 case INVOKE:
92 + ", "
94 case WORKSTART:
95 case WORKSTOP:
97 + ", quality="
99 case NOTIFY:
101 + ", timing:"
103 case GATE:
104 return "<"
106 + ", until "
108 case POST:
109 return "["
111 + "…"
113 + "]";
114 case FEED:
115 return "{"
117 + "::"
119 + "}";
120 case HOOK:
122 + "("
124 + ")";
125 case TICK:
126 return "◆ ";
127 default:
128 NOTREACHED ("uncovered Activity verb in activation function.");
129 }
130 }
131
132
133}} // namespace vault::gear
A language framework to define and interconnect scheduler activity verbs.
Token or Atom with distinct identity.
Definition symbol.hpp:120
basic constant internal time value.
Lumiera's internal time value datatype.
std::string showData() const
std::string showVerb() const
@ POST
post a message providing a chain of further time-bound Activities
Definition activity.hpp:237
@ NOTIFY
push a message to another Activity
Definition activity.hpp:235
@ HOOK
invoke an extension point through the activity::Hook interface
Definition activity.hpp:239
@ FEED
supply additional payload data for a preceding Activity
Definition activity.hpp:238
@ GATE
probe window + count-down; activate next Activity, else re-schedule
Definition activity.hpp:236
@ INVOKE
dispatch a JobFunctor into a worker thread
Definition activity.hpp:232
@ TICK
internal engine »heart beat« for internal maintenance hook(s)
Definition activity.hpp:240
@ WORKSTART
signal start of some processing and transition grooming mode ⟼ *work mode
Definition activity.hpp:233
@ WORKSTOP
correspondingly signal end of some processing
Definition activity.hpp:234
Marker for current (and obsolete) manifestations of a CalcStream processed by the Render-Engine.
Definition activity.hpp:85
static Symbol WORKSTART
virtual ~Hook()
this is an interface
Simple functions to represent objects, for debugging and diagnostics.
const string BOTTOM_INDICATOR
ostream & showAdr(ostream &stream, void const *addr)
preconfigured format for pretty-printing of addresses
std::string showPtr(X *ptr=nullptr)
diagnostics helper for explicitly indicating pointers
std::string toString(TY const &val) noexcept
get some string representation of any object, reliably.
HashVal hash_value(ManifestationID const &id)
Vault-Layer implementation namespace root.
Service for coordination and dispatch of render activities.
Instant dead
alive while time < dead
Definition activity.hpp:279
int rest
alive while rest > 0
Definition activity.hpp:278
Marker types to indicate a literal string and a Symbol.