Lumiera  0.pre.03
»edit your freedom«
Term Class Reference

#include "vault/gear/activity-term.hpp"

Description

A Term of the »Activity Language«, describing the steps necessary to perform the calculation of a single frame or similar tasks.

Definition at line 93 of file activity-term.hpp.

Public Types

enum  Template {
  CALC_JOB,
  LOAD_JOB,
  META_JOB
}
 

Public Member Functions

 Term (AllocHandle &&allocHandle, Template kind, Time start, Time dead, Job job)
 
TermappendNotificationTo (Term &targetTerm, bool unlimitedTime=false)
 Builder operation: append a Notification link to the end of this Term's chain. More...
 
Activitycallback ()
 
TermexpectNotification (Activity &notificationSrc, bool unlimitedTime=false)
 Builder operation: block this Term waiting for prerequisite notification. More...
 
 operator std::string () const
 
Activitypost ()
 
TermrequireDirectActivation ()
 Insert a self-inhibition to enforce activation is possible only after the scheduled start time. More...
 

Private Types

using AllocHandle = BlockFlowAlloc::AllocatorHandle
 

Private Member Functions

void configureTemplate (Template kind)
 
void insertWorkBracket ()
 
void setupGate ()
 
ActivitysetupInvocation (Job &job)
 
ActivitysetupPost (Time start, Time dead, Activity *followUp)
 
void severAsyncChain ()
 

Static Private Member Functions

static ActivityfindTail (Activity *chain)
 
static void insert (Activity *anchor, Activity *target)
 

Private Attributes

AllocHandle alloc_
 
Activitycallback_ {nullptr}
 
Activitygate_ {nullptr}
 
Activityinvoke_ {nullptr}
 
Activitypost_ {nullptr}
 

Member Enumeration Documentation

◆ Template

enum Template
Enumerator
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

Definition at line 108 of file activity-term.hpp.

Member Function Documentation

◆ post()

Activity& post ( )
inline
Returns
entrance point to this Activity-chain setup.
Remarks
use this call for instructing the Scheduler.

Definition at line 138 of file activity-term.hpp.

Referenced by Scheduler::continueMetaJob().

+ Here is the caller graph for this function:

◆ callback()

Activity& callback ( )
inline
Returns
re-entrance point for completion after async IO.
Remarks
initiate follow-up processing by ActivityLang::dispatchChain().

Definition at line 149 of file activity-term.hpp.

References Term::callback_.

◆ expectNotification()

Term& expectNotification ( Activity notificationSrc,
bool  unlimitedTime = false 
)
inline

Builder operation: block this Term waiting for prerequisite notification.

Parameters
notificationSrcan NOTIFY-Activity to attach the notification-link
Note
using this feature implies to wire in a GATE-Activity (if not already present) and to increase the Gate's latch counter. Moreover, the Argument, must be a NOTIFY and will be modified to store the link to this receiving Gate; typically this function is actually invoked starting from the other Term — the prerequisite — by invoking #appendNotificationTo(targetTerm).

Definition at line 165 of file activity-term.hpp.

References Time::ANYTIME, and Activity::NOTIFY.

Referenced by Term::appendNotificationTo(), and Term::requireDirectActivation().

+ Here is the caller graph for this function:

◆ appendNotificationTo()

Term& appendNotificationTo ( Term targetTerm,
bool  unlimitedTime = false 
)
inline

Builder operation: append a Notification link to the end of this Term's chain.

Parameters
targetTermanother Term, which thereby becomes dependent on this Term.
Remarks
the targetTerm will be inhibited, until this Term's chain has been activated and processed up to emitting the inserted NOTIFY.

Definition at line 182 of file activity-term.hpp.

References Term::callback_, Term::expectNotification(), and Activity::NOTIFY.

+ Here is the call graph for this function:

◆ requireDirectActivation()

Term& requireDirectActivation ( )
inline

Insert a self-inhibition to enforce activation is possible only after the scheduled start time.

Relevant for Jobs, which are to be triggered by external events, while the actual computation must not be start prior to activating the main chain, even if all prerequisites are already fulfilled.

Remarks
typical example is when a target buffer is known to be available only after the planned start time and until the planned deadline.
Note
the actual activation always goes through Activity::dispatch() and the primary chain is aborted with activity::SKIP. However, since the additional notification is inserted at a point executed holding the GroomingToken, the dispatch() actually happens synchronous and immediately processes the activated tail-chain in a nested call.
Deprecated:
12/23 this feature seemed necessary in the first implementation, yet after integration and follow-up refactorings (NOTIFY-handling) it turned out both superfluous and potentially dangerous, since it creates additional management work and possible contention on the Grooming-Token. The way NOTIFY-activities are handled now already ensures that they are activated only after their target's start time.

Definition at line 210 of file activity-term.hpp.

References Term::CALC_JOB, Term::callback_, Term::expectNotification(), Activity::FEED, Activity::GATE, stage::widget::kind(), Term::LOAD_JOB, Term::META_JOB, Activity::next, Activity::NOTIFY, Activity::WORKSTART, and Activity::WORKSTOP.

+ Here is the call graph for this function:

Member Data Documentation

◆ callback_

Activity* callback_ {nullptr}
private
Note
indicates also this is an async job

Definition at line 104 of file activity-term.hpp.

Referenced by Term::appendNotificationTo(), Term::callback(), and Term::requireDirectActivation().

+ Collaboration diagram for Term:

The documentation for this class was generated from the following file: