36 template<
class T,
unsigned N>
40 if (token::compound::isCompound(tag))
42 os << tag << token::SPACE;
46 os << static_cast<label>(
N);
55 template<
class T,
unsigned N>
64 template<
class T,
unsigned N>
73 os.writeKeyword(keyword);
80 template<
class T,
unsigned N>
102 (
N <= 1 || !shortLen)
105 (
N <= unsigned(shortLen))
108 is_contiguous<T>::value
109 || Detail::ListPolicy::no_linebreak<T>::value
117 os << token::BEGIN_LIST;
120 for (
unsigned i=0; i<
N; ++i)
122 if (i)
os << token::SPACE;
127 os << token::END_LIST;
134 os <<
nl << token::BEGIN_LIST <<
nl;
137 for (
unsigned i=0; i<
N; ++i)
143 os << token::END_LIST <<
nl;
151 template<
class T,
unsigned N>
165 Detail::readContiguous<T>
174 "FixedList<T, N>::readList(Istream&) : " 175 "reading the binary block" 185 "FixedList<T, N>::readList(Istream&) : " 186 "reading first token" 189 if (tok.isCompound())
193 list = tok.transferCompoundToken<List<T>>(is);
196 else if (tok.isLabel())
201 else if (!tok.isPunctuation())
204 <<
"incorrect first token, expected <label> or '(' , found " 217 if (delimiter == token::BEGIN_LIST)
219 for (
unsigned i=0; i<
N; ++i)
225 "FixedList<T, N>::readList(Istream&) : " 240 "FixedList<T, N>::readList(Istream&) : " 241 "reading the single entry" const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A 1D vector of objects of type <T> with a fixed length <N>.
char readEndList(const char *funcName)
End read of list data, ends with ')' or '}'.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
A traits class, which is primarily used for primitives and vector-space.
void writeEntry(Ostream &os) const
Write the FixedList with its compound type.
void putBack(const token &tok)
Put back a token (copy). Only a single put back is permitted.
A class for handling words, derived from Foam::string.
static std::streamsize size_bytes() noexcept
Number of contiguous bytes for the list data,.
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
char readBeginList(const char *funcName)
Begin read of list data, starts with '(' or '{'.
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void checkSize(const label size) const
Check size is identical to template parameter N.
OBJstream os(runTime.globalPath()/outputName)
const Vector< label > N(dict.get< Vector< label >>("N"))
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A template class to specify that a data type can be considered as being contiguous in memory...
Istream & readList(Istream &is)
Read from Istream, discarding contents of existing List.
streamFormat format() const noexcept
Get the current stream format.
FixedList()=default
Default construct.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...