Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
ActivityDetector::ActivityProbe Class Reference

Description

A rigged CALLBACK-Activity to watch passing of activations.

Definition at line 345 of file activity-detector.hpp.

Static Public Member Functions

static Time lastInvoked (Activity const *act)
 

Public Member Functions

 ActivityProbe (string id, EventLog &masterLog, uint const &invocationSeqNr)
 
 ActivityProbe (Activity const &subject, string id, EventLog &masterLog, uint const &invocationSeqNr)
 
 operator string () const
 
- Public Member Functions inherited from Activity
 Activity (Verb verb) noexcept
 
 Activity (uint64_t o1, uint64_t o2) noexcept
 
 Activity (JobFunctor &job, Time nominalTime, Activity &feed) noexcept
 
 Activity (Activity *target, Time limitWhen=Time::ANYTIME) noexcept
 
 Activity (int expectNotifications, Time deadline=Time::NEVER) noexcept
 
 Activity (Time when, Activity *followUp) noexcept
 
 Activity (Time start, Time after, Activity *followUp) noexcept
 
 Activity (activity::Hook &callback, size_t arg) noexcept
 
 Activity () noexcept
 
 operator std::string () const
 diagnostic representation
 
std::string showVerb () const
 
std::string showData () const
 
template<class EXE >
activity::Proc activate (Time now, EXE &executionCtx)
 Core Operation: Activate and perform this Activity.
 
template<class EXE >
activity::Proc dispatch (Time now, EXE &executionCtx)
 Entrance point for an activation, which has been dispatched indirectly through the dispatch and/or priority queue; typically this is achieved by invoking the post-λ on the executionCtx, or by activating a POST-Activity.
 
bool is (Activity::Verb expectedVerb) const
 
void incDependencies ()
 
void setNotificationTarget (Activity *target, Time limitStart=Time::ANYTIME)
 
Time constrainedStart (Time start)
 
Time constrainedDeath (Time death)
 
- Public Member Functions inherited from Hook
virtual ~Hook ()
 this is an interface
 
 operator std::string () const
 

Private Member Functions

Activitytarget ()
 
Activity const * target () const
 
activity::Proc activation (Activity &thisHook, Time now, void *executionCtx) override
 Callback on activation of the corresponding HOOK-Activity.
 
activity::Proc notify (Activity &thisHook, Time now, void *executionCtx) override
 Callback when dispatching a NOTIFY-Activity to thisHook.
 
Time getDeadline () const override
 
std::string diagnostic () const override
 

Private Attributes

Logger log_
 
TimeVar invoked_ {Time::ANYTIME}
 

Additional Inherited Members

- Public Types inherited from Activity
enum  Verb {
  INVOKE ,
  WORKSTART ,
  WORKSTOP ,
  NOTIFY ,
  GATE ,
  POST ,
  FEED ,
  HOOK ,
  TICK
}
 All possible kinds of activities. More...
 
- Public Attributes inherited from Activity
const Verb verb_
 
Activitynext
 Activities are organised into chains to represent relations based on verbs.
 
ArgumentData data_
 

Constructor & Destructor Documentation

◆ ActivityProbe() [1/2]

ActivityProbe ( string  id,
EventLog masterLog,
uint const &  invocationSeqNr 
)
inline

Definition at line 420 of file activity-detector.hpp.

◆ ActivityProbe() [2/2]

ActivityProbe ( Activity const &  subject,
string  id,
EventLog masterLog,
uint const &  invocationSeqNr 
)
inline

Definition at line 425 of file activity-detector.hpp.

References Activity::next.

Member Function Documentation

◆ target() [1/2]

Activity * target ( )
inlineprivate

Definition at line 353 of file activity-detector.hpp.

References Activity::Callback::arg, Activity::ArgumentData::callback, and Activity::data_.

Referenced by ActivityDetector::ActivityProbe::activation(), ActivityDetector::ActivityProbe::getDeadline(), and ActivityDetector::ActivityProbe::notify().

+ Here is the caller graph for this function:

◆ target() [2/2]

Activity const * target ( ) const
inlineprivate

Definition at line 359 of file activity-detector.hpp.

◆ activation()

activity::Proc activation ( Activity thisHook,
Time  now,
void *  executionCtx 
)
inlineoverrideprivatevirtual

Callback on activation of the corresponding HOOK-Activity.

Parameters
thisHookthe Activity record wired to this hook
nowcurrent »wall-clock-time« as used by the Scheduler
executionCtxopaque pointer to the actual execution context
Returns
decision how to proceed with the activation
Remarks
the intended use is to rig this callback based on additional knowledge regarding the usage context. Through thisHook, the follow-up chain is accessible, and an additional payload data field (size_t). Since the execution context is a concept, it is necessary to know the actual type of the concrete execution context and cast down in the implementation. This mechanism is used especially for detecting expected test invocations.

Implements Hook.

Definition at line 365 of file activity-detector.hpp.

References Activity::activate(), ActivityDetector::executionCtx, Activity::HOOK, ActivityDetector::ActivityProbe::invoked_, Activity::is(), ActivityDetector::ActivityProbe::log_, vault::gear::activity::PASS, ActivityDetector::ActivityProbe::target(), and util::toString().

+ Here is the call graph for this function:

◆ notify()

activity::Proc notify ( Activity thisHook,
Time  now,
void *  executionCtx 
)
inlineoverrideprivatevirtual

Callback when dispatching a NOTIFY-Activity to thisHook.

Implements Hook.

Definition at line 385 of file activity-detector.hpp.

References Activity::dispatch(), ActivityDetector::executionCtx, Activity::HOOK, ActivityDetector::ActivityProbe::invoked_, Activity::is(), ActivityDetector::ActivityProbe::log_, vault::gear::activity::PASS, ActivityDetector::ActivityProbe::target(), and util::toString().

+ Here is the call graph for this function:

◆ getDeadline()

Time getDeadline ( ) const
inlineoverrideprivatevirtual

Implements Hook.

Definition at line 405 of file activity-detector.hpp.

References Activity::ArgumentData::condition, Activity::data_, Activity::GATE, Activity::Condition::getDeadline(), Activity::is(), Time::NEVER, and ActivityDetector::ActivityProbe::target().

+ Here is the call graph for this function:

◆ diagnostic()

std::string diagnostic ( ) const
inlineoverrideprivatevirtual

Reimplemented from Hook.

Definition at line 414 of file activity-detector.hpp.

References ActivityDetector::ActivityProbe::log_.

Referenced by ActivityDetector::ActivityProbe::operator string().

+ Here is the caller graph for this function:

◆ operator string()

operator string ( ) const
inline

Definition at line 432 of file activity-detector.hpp.

References ActivityDetector::ActivityProbe::diagnostic().

+ Here is the call graph for this function:

◆ lastInvoked()

static Time lastInvoked ( Activity const *  act)
inlinestatic

Definition at line 439 of file activity-detector.hpp.

References Activity::ArgumentData::callback, Activity::data_, Activity::HOOK, Activity::Callback::hook, ActivityDetector::ActivityProbe::invoked_, Time::NEVER, and Activity::verb_.

Referenced by ActivityDetector::invokeTime().

+ Here is the caller graph for this function:

Member Data Documentation

◆ log_

◆ invoked_

+ Inheritance diagram for ActivityDetector::ActivityProbe:
+ Collaboration diagram for ActivityDetector::ActivityProbe:

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