27 class IndentBuffer :
public std::streambuf
30 IndentBuffer() : m_Sink(NULL), m_NewLine(
false), m_IndentLevel(0){}
45 void setSink(std::streambuf *sink)
54 virtual int overflow(
int c)
override;
59 std::streambuf *m_Sink;
61 unsigned int m_IndentLevel;
73 OB(
unsigned int level) : Level(level){}
86 CB(
unsigned int level) : Level(level){}
98 : m_CodeStream(codeStream), m_Level(s_NextLevel++)
106 if(!std::uncaught_exception()) {
111 catch(
const std::runtime_error &exception)
128 const unsigned int m_Level;
132 m_Braces.push_back(0);
141 m_Buffer.setSink(stream.rdbuf());
154 IndentBuffer m_Buffer;
155 std::vector<unsigned int> m_Braces;
A close bracket marker.
Definition: codeStream.h:84
std::ostream & operator<<(std::ostream &out, const MemAlloc &m)
Definition: backendBase.h:159
~Scope()
Definition: codeStream.h:103
OB(unsigned int level)
Definition: codeStream.h:73
#define GENN_EXPORT
Definition: gennExport.h:13
An open bracket marker.
Definition: codeStream.h:71
CodeStream(std::ostream &stream)
Definition: codeStream.h:135
void setSink(std::ostream &stream)
Definition: codeStream.h:139
Scope(CodeStream &codeStream)
Definition: codeStream.h:97
Helper class for generating code - automatically inserts brackets, indents etc.
Definition: backendBase.h:30
Definition: codeStream.h:21
CB(unsigned int level)
Definition: codeStream.h:86
const unsigned int Level
Definition: codeStream.h:75
#define LOGE_CODE_GEN
Definition: logging.h:32
const unsigned int Level
Definition: codeStream.h:88
CodeStream()
Definition: codeStream.h:131
Definition: codeStream.h:94