Lumiera  0.pre.03
»edit your freedom«
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.

Public Member Functions

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

Classes

struct  Invocation
 

Private Member Functions

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

Private Attributes

unordered_map< HashVal, InvocationinvocationLog_
 recording MockJob invocations
 

Member Function Documentation

◆ 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.

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

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