Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
DummyClosure Class Reference

Description

MockJob objects are backed by this closure.

Invocations of this job functor are recorded in a hashtable

Note
as of 5/2023, we use a simplistic map-based implementation, causing a consecutive invocation of the same job instance with identical JobParameter to overwrite the previous log entry.

Definition at line 74 of file mock-dispatcher.cpp.

Classes

struct  Invocation
 

Public Member Functions

Invocation const & queryInvocation (JobParameter param) const
 
void clearLog ()
 
- Public Member Functions inherited from JobClosure
virtual ~JobClosure ()
 this is an interface
 
virtual void invokeJobOperation (JobParameter parameter)=0
 
lib::HashVal hash_value (JobParameter) const
 
- Public Member Functions inherited from JobFunctor
virtual ~JobFunctor ()
 this is an interface
 
virtual std::string diagnostic () const
 
 operator std::string () const
 

Private Member Functions

void invokeJobOperation (JobParameter parameter) override
 
JobKind getJobKind () const override
 
InvocationInstanceID buildInstanceID (HashVal seed) const override
 Generate a specifically marked invocationKey for use in unit-tests.
 
size_t hashOfInstance (InvocationInstanceID invoKey) const override
 

Private Attributes

unordered_map< HashVal, InvocationinvocationLog_
 recording MockJob invocations
 

Member Function Documentation

◆ invokeJobOperation()

void invokeJobOperation ( JobParameter  parameter)
inlineoverrideprivate

Definition at line 78 of file mock-dispatcher.cpp.

◆ getJobKind()

JobKind getJobKind ( ) const
inlineoverrideprivatevirtual

Implements JobClosure.

Definition at line 84 of file mock-dispatcher.cpp.

References META_JOB.

◆ buildInstanceID()

InvocationInstanceID buildInstanceID ( HashVal  seed) const
inlineoverrideprivatevirtual

Generate a specifically marked invocationKey for use in unit-tests.

Remarks
in the actual implementation, this function generates a distinct base hash to tag specific processing provided by this JobFunctor; the seed usually factors in the media stream format; on invocation the nominal frame time will additionally be hashed in. Yet for unit testing, we typically use this dummy JobFunctor and it is expedient if this hash-chaining calculation is easy predictable;
Returns
a zero-initialised invocationKey, assigning seed to the lower part

Implements JobClosure.

Definition at line 100 of file mock-dispatcher.cpp.

◆ hashOfInstance()

size_t hashOfInstance ( InvocationInstanceID  invoKey) const
inlineoverrideprivatevirtual

Implements JobClosure.

Definition at line 108 of file mock-dispatcher.cpp.

References lib::hash::combine(), InvocationInstanceID::frameNumber, and InvocationInstanceID::part.

+ Here is the call graph for this function:

◆ queryInvocation()

Invocation const & queryInvocation ( JobParameter  param) const
inline

Definition at line 145 of file mock-dispatcher.cpp.

Referenced by MockJob::invocationAdditionalKey(), MockJob::invocationNominalTime(), MockJob::invocationTime(), and MockJob::was_invoked().

+ Here is the caller graph for this function:

◆ clearLog()

void clearLog ( )
inline

Definition at line 152 of file mock-dispatcher.cpp.

Member Data Documentation

◆ invocationLog_

unordered_map<HashVal,Invocation> invocationLog_
private

recording MockJob invocations

Definition at line 140 of file mock-dispatcher.cpp.

+ Inheritance diagram for DummyClosure:
+ Collaboration diagram for DummyClosure:

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