|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Stream sink that writes textual frames to an output stream. More...
#include <ca-ascii.H>
Public Member Functions | |
| Ascii_Frame_Sink (std::ostream &out, Palette palette, Ascii_Render_Options opts={}, const bool include_step_header=true) | |
| Build a stream-backed ASCII sink. | |
| template<typename Lattice > | |
| void | accept (const std::size_t step, const Lattice &frame) |
| Write one textual frame. | |
| void | flush () |
| Flush the wrapped stream. | |
Private Attributes | |
| std::ostream * | out_ = nullptr |
| Palette | palette_ |
| Ascii_Render_Options | opts_ {} |
| bool | include_step_header_ = true |
Stream sink that writes textual frames to an output stream.
Each accepted frame is preceded by a compact step marker unless include_step_header is disabled.
| Palette | invocable state_type -> std::string. |
Definition at line 286 of file ca-ascii.H.
|
inline |
Build a stream-backed ASCII sink.
| [in,out] | out | destination stream. |
| [in] | palette | state-to-text mapper. |
| [in] | opts | rendering options. |
| [in] | include_step_header | write # step N before each frame. |
Definition at line 300 of file ca-ascii.H.
|
inline |
Write one textual frame.
| Lattice | 2D lattice type. |
| [in] | step | simulation step. |
| [in] | frame | frame to render. |
Definition at line 314 of file ca-ascii.H.
References Aleph::CA::Ascii_Frame_Sink< Palette >::include_step_header_, Aleph::CA::Ascii_Frame_Sink< Palette >::opts_, Aleph::CA::Ascii_Frame_Sink< Palette >::out_, Aleph::CA::Ascii_Frame_Sink< Palette >::palette_, and Aleph::CA::render_ascii().
|
inline |
Flush the wrapped stream.
Definition at line 322 of file ca-ascii.H.
References ah_runtime_error_if, Aleph::blossom_maximum_cardinality_matching(), and Aleph::CA::Ascii_Frame_Sink< Palette >::out_.
|
private |
Definition at line 291 of file ca-ascii.H.
Referenced by Aleph::CA::Ascii_Frame_Sink< Palette >::accept().
|
private |
Definition at line 290 of file ca-ascii.H.
Referenced by Aleph::CA::Ascii_Frame_Sink< Palette >::accept().
|
private |
Definition at line 288 of file ca-ascii.H.
Referenced by Aleph::CA::Ascii_Frame_Sink< Palette >::accept(), and Aleph::CA::Ascii_Frame_Sink< Palette >::flush().
|
private |
Definition at line 289 of file ca-ascii.H.
Referenced by Aleph::CA::Ascii_Frame_Sink< Palette >::accept().