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

#include "/Werk/devel/lumi/tests/core/steam/engine/mock-dispatcher.hpp"

Description

Mock setup for a complete Segmentation to emulate the structure of the actual fixture, without the need of building a low-level Model.

MockSegmentation instances can be instantiated directly within the test, by passing a test specification in »GenNode« notation to the constructor. This specification defines the segments to create and allows to associate a marker number, which can later be verified from the actual DummyClosure invocation.

  • the ctor accepts a sequence of GenNode elements, each corresponding to a segment to created
  • optionally, attributes "start" and "after" can be defined to provide the lib::time::Time values of segment start/end
  • in addition, optionally a "mark" attribute can be defined; the given integer number will be "hidden" in the job instance hash, and can be verified
  • the scope of each top-level GenNode may hold a sequence of nested nodes corresponding to prerequisite JobTicket instances
  • these can in turn hold further nested prerequisites, and so on
    See also
    MockSetup_test::verify_MockSegmentation

Definition at line 193 of file mock-dispatcher.hpp.

Public Member Functions

 MockSegmentation ()
 
 MockSegmentation (std::initializer_list< GenNode > specs)
 
ExitNode buildExitNodeFromSpec (GenNode const &spec)
 
void duplicateExitNodeSpec (uint times)
 This is some trickery to allow handling of multiple ModelPort(s) in MockDispatcher; actually the code using this mock setup does not need any elaborate differentiation of the ExitNodes structure per port, thus the first entry of the existing configuration is just duplicated for the given number of further ModelPorts.
 
- Public Member Functions inherited from Segmentation
virtual ~Segmentation ()
 this is an interface
 
size_t size () const
 
Segment const & operator[] (TimeValue time) const
 
auto eachSeg () const
 <
 
Segment const & splitSplice (OptTime start, OptTime after, engine::ExitNodes &&modelLink=ExitNodes{})
 rework the existing Segmentation to include a new Segment as specified
 

Private Member Functions

HashVal buildSeed (GenNode const &spec)
 
Duration buildRuntime (GenNode const &spec)
 
ExitNodes buildPrerequisites (GenNode const &spec)
 

Additional Inherited Members

- Protected Member Functions inherited from Segmentation
 Segmentation ()
 
void adaptSpecification (std::function< NodeGraphAttachment(NodeGraphAttachment const &)> rewrite)
 

Constructor & Destructor Documentation

◆ MockSegmentation() [1/2]

MockSegmentation ( )
inline

Definition at line 198 of file mock-dispatcher.hpp.

◆ MockSegmentation() [2/2]

MockSegmentation ( std::initializer_list< GenNode specs)
inline

Definition at line 202 of file mock-dispatcher.hpp.

References MockSegmentation::buildExitNodeFromSpec(), and Segmentation::splitSplice().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildExitNodeFromSpec()

ExitNode buildExitNodeFromSpec ( GenNode const &  spec)
inline

Definition at line 217 of file mock-dispatcher.hpp.

References MockSegmentation::buildPrerequisites(), MockSegmentation::buildRuntime(), MockSegmentation::buildSeed(), and MockJob::getFunctor().

Referenced by MockSegmentation::MockSegmentation(), MockSegmentation::buildPrerequisites(), and NodeGraphAttachment_test::fabricate_MockExitNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicateExitNodeSpec()

void duplicateExitNodeSpec ( uint  times)
inline

This is some trickery to allow handling of multiple ModelPort(s) in MockDispatcher; actually the code using this mock setup does not need any elaborate differentiation of the ExitNodes structure per port, thus the first entry of the existing configuration is just duplicated for the given number of further ModelPorts.

helper for MockDispatcher

Warning
this manipulation must be done prior to generating any JobTicket

Definition at line 267 of file mock-dispatcher.hpp.

References Segmentation::adaptSpecification().

Referenced by MockDispatcher::MockDispatcher(), and MockDispatcher::MockDispatcher().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildSeed()

HashVal buildSeed ( GenNode const &  spec)
inlineprivate

Definition at line 232 of file mock-dispatcher.hpp.

References GenNode::retrieveAttribute().

Referenced by MockSegmentation::buildExitNodeFromSpec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildRuntime()

Duration buildRuntime ( GenNode const &  spec)
inlineprivate

Definition at line 239 of file mock-dispatcher.hpp.

References GenNode::retrieveAttribute().

Referenced by MockSegmentation::buildExitNodeFromSpec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPrerequisites()

ExitNodes buildPrerequisites ( GenNode const &  spec)
inlineprivate

Definition at line 246 of file mock-dispatcher.hpp.

References MockSegmentation::buildExitNodeFromSpec(), and GenNode::getChildren().

Referenced by MockSegmentation::buildExitNodeFromSpec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
+ Inheritance diagram for MockSegmentation:
+ Collaboration diagram for MockSegmentation:

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