Essentia  2.1-beta6-dev
AsciiCanvas Class Reference

#include <asciidag.h>

Inheritance diagram for AsciiCanvas:

Public Member Functions

template<typename NetworkType >
 AsciiCanvas (const NetworkType &network)
 
AsciiCanvasoperator= (const std::vector< std::string > &other)
 
int height () const
 
int width () const
 
void addBorder ()
 
void fill (char c)
 
const std::string & at (int i) const
 
std::string & at (int i)
 
char at (const Position &pos) const
 
char & at (const Position &pos)
 

Detailed Description

This class represents an ASCII canvas which can contain anything. It is represented as a matrix of chars. The only restriction (guarantee?) is that every row (line) has the same number of columns (same length).

Constructor & Destructor Documentation

◆ AsciiCanvas()

AsciiCanvas ( const NetworkType &  network)
inlineexplicit

Member Function Documentation

◆ addBorder()

void addBorder ( )

Add an empty border en each of the 4 sides. This might be useful for having to deal with less bounds-checking.

Referenced by AsciiDAGParser::AsciiDAGParser().

◆ at() [1/4]

char& at ( const Position pos)
inline

References Position::x, and Position::y.

◆ at() [2/4]

char at ( const Position pos) const
inline

References Position::x, and Position::y.

◆ at() [3/4]

std::string& at ( int  i)
inline

◆ at() [4/4]

const std::string& at ( int  i) const
inline

◆ fill()

void fill ( char  c)

Fill the canvas with the given char

◆ height()

int height ( ) const
inline

◆ operator=()

AsciiCanvas& operator= ( const std::vector< std::string > &  other)

◆ width()

int width ( ) const
inline

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