Lumiera  0.pre.03
»edit your freedom«
DiagnosticOutputSlot Class Reference

#include "/Werk/devel/lumi/tests/core/steam/play/diagnostic-output-slot.hpp"

Description

Helper for unit tests: Mock output sink.

Complete implementation of the OutputSlot interface, with some additional stipulations to support unit testing.

  • the implementation uses a special protocol output buffer, which stores each "frame" in memory for later investigation
  • the output data in the buffers handed over from client actually hold an TestFrame instance
  • the maximum number of channels and the maximum number of acceptable frames is limited to 5 and 100.
    Warning
    any Captured (test) data from all individual instances remains in memory until shutdown of the current executable

Definition at line 275 of file diagnostic-output-slot.hpp.

Public Types

typedef OutputFramesLog::iterator OutFrames
 
- Public Types inherited from OutputSlot
typedef lib::IterSource< DataSink >::iterator OpenedSinks
 

Public Member Functions

bool frame_was_allocated (uint channel, FrameID nominalFrame)
 
OutFrames getChannel (uint channel)
 
bool output_was_closed (uint channel, FrameID outputFrame)
 
bool output_was_emitted (uint channel, FrameID outputFrame)
 
- Public Member Functions inherited from OutputSlot
Allocationallocate ()
 claim this slot for exclusive use More...
 
void disconnect ()
 disconnect from this OutputSlot More...
 
bool isFree () const
 can this OutputSlot be allocated? More...
 

Static Public Member Functions

static DiagnosticOutputSlotaccess (OutputSlot &to_investigate)
 
static OutputSlotbuild ()
 build a new Diagnostic Output Slot instance, discard the existing one. More...
 

Classes

class  OutputFramesLog
 diagnostic facility to verify test data frames written to this Test/Dummy "output". More...
 
class  SimulatedOutputSequences
 Special diagnostic connection state implementation, establishing diagnostic output connections for each channel, thus allowing to verify the handling of individual buffers. More...
 

Private Member Functions

 DiagnosticOutputSlot ()
 
TrackingInMemoryBlockSequence const & accessSequence (uint channel)
 
ConnectionStatebuildState ()
 hook into the OutputSlot frontend
 
uint getOutputChannelCount ()
 

Static Private Attributes

static const uint MAX_CHANNELS = 5
 

Additional Inherited Members

- Protected Attributes inherited from OutputSlot
unique_ptr< ConnectionStatestate_
 

Constructor & Destructor Documentation

◆ DiagnosticOutputSlot()

DiagnosticOutputSlot ( )
inlineprivate

is self-managed and non-copyable. Clients use build() to get an instance

Definition at line 327 of file diagnostic-output-slot.hpp.

Member Function Documentation

◆ getOutputChannelCount()

uint getOutputChannelCount ( )
inlineprivate
Note
a real OutputSlot implementation would rely on some kind of embedded configuration here

Definition at line 285 of file diagnostic-output-slot.hpp.

◆ accessSequence()

TrackingInMemoryBlockSequence const& accessSequence ( uint  channel)
inlineprivate

access the implementation object representing a single stream connection

Definition at line 333 of file diagnostic-output-slot.hpp.

◆ build()

static OutputSlot& build ( )
inlinestatic

build a new Diagnostic Output Slot instance, discard the existing one.

Use the static query API for investigating collected data.

Definition at line 346 of file diagnostic-output-slot.hpp.

References ScopedPtrVect< T >::manage().

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

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