Lumiera  0.pre.03
»edit your freedom«
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 (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. More...
 
- Public Member Functions inherited from Segmentation
virtual ~Segmentation ()
 this is an interface
 
auto eachSeg () const
 < More...
 
Segment const & operator[] (TimeValue time) const
 
size_t size () const
 
Segment const & splitSplice (OptTime start, OptTime after, engine::ExitNodes &&modelLink=ExitNodes{})
 rework the existing Segmentation to include a new Segment as specified More...
 

Private Member Functions

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

Additional Inherited Members

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

Member Function Documentation

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

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

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