Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::Dot_Frame_Sink< Palette > Class Template Reference

Path-pattern sink that writes GraphViz DOT frames. More...

#include <ca-dot.H>

Collaboration diagram for Aleph::CA::Dot_Frame_Sink< Palette >:
[legend]

Public Member Functions

 Dot_Frame_Sink (std::filesystem::path path_pattern, Palette palette, DOT_Render_Options opts={}, const std::size_t zero_pad=6)
 Build a DOT frame sink.
 
template<typename Graph >
void accept (const std::size_t step, const Graph &graph)
 Write one DOT frame.
 

Static Public Member Functions

static void flush ()
 DOT frames are written eagerly; this is a no-op.
 

Private Attributes

std::filesystem::path pattern_
 
Palette palette_
 
DOT_Render_Options opts_ {}
 
std::size_t zero_pad_ = 6
 

Detailed Description

template<typename Palette>
class Aleph::CA::Dot_Frame_Sink< Palette >

Path-pattern sink that writes GraphViz DOT frames.

Template Parameters
Paletteinvocable state_type -> std::string.

Definition at line 221 of file ca-dot.H.

Constructor & Destructor Documentation

◆ Dot_Frame_Sink()

template<typename Palette >
Aleph::CA::Dot_Frame_Sink< Palette >::Dot_Frame_Sink ( std::filesystem::path  path_pattern,
Palette  palette,
DOT_Render_Options  opts = {},
const std::size_t  zero_pad = 6 
)
inline

Build a DOT frame sink.

Parameters
[in]path_patternoutput path pattern.
[in]palettestate-to-fill-colour mapper.
[in]optsrendering options.
[in]zero_padminimum width for {step}.
Exceptions
Anyexception thrown by Palette move/copy. Does not touch the filesystem.

Definition at line 237 of file ca-dot.H.

Member Function Documentation

◆ accept()

template<typename Palette >
template<typename Graph >
void Aleph::CA::Dot_Frame_Sink< Palette >::accept ( const std::size_t  step,
const Graph &  graph 
)
inline

Write one DOT frame.

Template Parameters
Graphgraph lattice type.
Parameters
[in]stepsimulation step.
[in]graphgraph frame to write.
Exceptions
std::runtime_errorif the destination file cannot be opened or the underlying stream write fails.
std::filesystem::filesystem_errorif the parent directory cannot be created.
Anyexception propagated by the palette.

Definition at line 256 of file ca-dot.H.

References ah_runtime_error_if, Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::format_step_path(), Aleph::CA::Dot_Frame_Sink< Palette >::opts_, out, Aleph::CA::Dot_Frame_Sink< Palette >::palette_, Aleph::CA::Dot_Frame_Sink< Palette >::pattern_, Aleph::CA::render_graph_lattice_dot(), and Aleph::CA::Dot_Frame_Sink< Palette >::zero_pad_.

◆ flush()

template<typename Palette >
static void Aleph::CA::Dot_Frame_Sink< Palette >::flush ( )
inlinestatic

DOT frames are written eagerly; this is a no-op.

Definition at line 267 of file ca-dot.H.

Member Data Documentation

◆ opts_

Definition at line 225 of file ca-dot.H.

Referenced by Aleph::CA::Dot_Frame_Sink< Palette >::accept().

◆ palette_

template<typename Palette >
Palette Aleph::CA::Dot_Frame_Sink< Palette >::palette_
private

Definition at line 224 of file ca-dot.H.

Referenced by Aleph::CA::Dot_Frame_Sink< Palette >::accept().

◆ pattern_

template<typename Palette >
std::filesystem::path Aleph::CA::Dot_Frame_Sink< Palette >::pattern_
private

Definition at line 223 of file ca-dot.H.

Referenced by Aleph::CA::Dot_Frame_Sink< Palette >::accept().

◆ zero_pad_

template<typename Palette >
std::size_t Aleph::CA::Dot_Frame_Sink< Palette >::zero_pad_ = 6
private

Definition at line 226 of file ca-dot.H.

Referenced by Aleph::CA::Dot_Frame_Sink< Palette >::accept().


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