Activity-Lang: framework for building an Activity-Term

While the ''general direction'' seems clear, some in-depth
analysis was required to find out what information can reasonably
be expected to be available at this point.

The decision was made to shift the actual deadline calculation
into the Job-Planning altogether, assuming that a preliminary solution
based on data implicitly available there will be enough to implement
simple linear playback, while precise management of job start times
can be added in later, when observation of actual timing behaviour
is available...
This commit is contained in:
Fischlurch 2023-08-28 23:40:25 +02:00
parent 568957b75d
commit 8e20fa6de1
4 changed files with 1231 additions and 1409 deletions

View file

@ -43,6 +43,7 @@
#include "vault/gear/activity.hpp"
#include "vault/gear/block-flow.hpp"
#include "vault/gear/activity-term.hpp"
//#include "lib/symbol.hpp"
//#include "lib/util.hpp"
@ -74,6 +75,18 @@ namespace gear {
{ }
// using default copy/assignment
private:
/** @internal generate the builder / configurator term */
activity::Term
setupActivityScheme (activity::Term::Template schemeKind, Time start, Time after)
{
return activity::Term{ mem_.until(after)
, schemeKind
, start
, after
};
}
};

View file

@ -0,0 +1,114 @@
/*
ACTIVITY-TERM.hpp - definition language framework for scheduler activities
Copyright (C) Lumiera.org
2023, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file activity-term.hpp
** A term of the _activity language_ describing interconnected scheduler activities.
** The activity::Term is created as a transient object in _builder notation,_ and used
** to lay out the specifics of the planned operations necessary to calculate a single
** frame or to carry out some administrative task. The actual \ref Activity verbs are
** allocated independently, within the BlockFlow allocation scheme, while the Term
** links and configures these data records and prepares them to instruct the Scheduler.
** Through the activity::Term, relevant attachment points are exposed for configuration,
** yet after posting the entrance point of an activity chain to the Scheduler, the term
** is obsoleted and can be discarded without affecting the individual Activities awaiting
** activation through the Scheduler.
**
** @see SchedulerActivity_test
** @see activity-lang.hpp Entrance point to Activity definition
** @see activity.hpp definition of verbs
**
** @todo WIP-WIP-WIP 8/2023 »Playback Vertical Slice«
**
*/
#ifndef SRC_VAULT_GEAR_ACTIVITY_TERM_H_
#define SRC_VAULT_GEAR_ACTIVITY_TERM_H_
#include "vault/gear/activity.hpp"
#include "vault/gear/block-flow.hpp"
//#include "lib/symbol.hpp"
#include "lib/time/timevalue.hpp"
//#include "lib/util.hpp"
//#include <string>
#include <utility>
namespace vault{
namespace gear {
using lib::time::Time;////////////WIP
// using util::isnil;
// using std::string;
using std::move;
using BlockFlowAlloc = BlockFlow<blockFlow::RenderConfig>;
namespace activity {
/**
* A Term of the »Activity Language«, describing the steps necessary
* to perform the calculation of a single frame or similar tasks.
*/
class Term
{
using AllocHandle = BlockFlowAlloc::AllocatorHandle;
AllocHandle alloc_;
public:
enum Template {CALC_JOB ///< scheme for a synchronous media calculation job
,LOAD_JOB ///< scheme for an asynchronous data retrieval job
,META_JOB ///< scheme for planning and organisational job
};
explicit
Term (AllocHandle&& allocHandle, Template kind, Time start, Time after)
: alloc_{move (allocHandle)}
{ }
// virtual std::string
// diagnostic() const
// {
// return "Activity::Hook";
// }
// operator std::string() const
// {
// return diagnostic();
// }
};
/** */
}//(End)namespace activity
}} // namespace vault::gear
#endif /*SRC_VAULT_GEAR_ACTIVITY_TERM_H_*/

View file

@ -204,7 +204,7 @@ namespace gear {
/*********************************************//**
* Term to describe an Activity,
* Record to describe an Activity,
* to happen within the Scheduler's control flow.
* @note Activity is a »POD with constructor«
* - trivially *destructible*

File diff suppressed because it is too large Load diff