36template<
class T,
unsigned N>
40 if (token::compound::isCompound(tag))
42 os << tag << token::SPACE;
46 os << static_cast<label>(
N);
55template<
class T,
unsigned N>
64template<
class T,
unsigned N>
73 os.writeKeyword(keyword);
76 os << token::END_STATEMENT <<
endl;
80template<
class T,
unsigned N>
102 (
N <= 1 || !shortLen)
105 (
N <=
unsigned(shortLen))
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;
151template<
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"
193 list = dynamicCast<token::Compound<List<T>>>
207 <<
"incorrect first token, expected <label> or '(' , found "
209 << exit(FatalIOError);
220 if (delimiter == token::BEGIN_LIST)
222 for (
unsigned i=0; i<
N; ++i)
228 "FixedList<T, N>::readList(Istream&) : "
243 "FixedList<T, N>::readList(Istream&) : "
244 "reading the single entry"
247 for (
unsigned i=0; i<
N; ++i)
A 1D vector of objects of type <T> with a fixed length <N>.
static std::streamsize size_bytes() noexcept
Number of contiguous bytes for the list data,.
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
void checkSize(const label size) const
Check size is identical to template parameter N.
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
void writeEntry(Ostream &os) const
Write the FixedList with its compound type.
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
Istream & readList(Istream &is)
Read from Istream, discarding contents of existing List.
FixedList()=default
Default construct.
streamFormat format() const noexcept
Get the current stream format.
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
char readEndList(const char *funcName)
End read of list data, ends with ')' or '}'.
char readBeginList(const char *funcName)
Begin read of list data, starts with '(' or '{'.
void putBack(const token &tok)
Put back a token. Only a single put back is permitted.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A traits class, which is primarily used for primitives.
A token holds an item read from Istream.
compound & transferCompoundToken()
Return reference to compound and mark internally as released.
bool isPunctuation() const noexcept
Token is PUNCTUATION.
bool isLabel() const noexcept
Token is LABEL.
label labelToken() const
Return label value.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
bool isCompound() const noexcept
Token is COMPOUND.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char nl
The newline '\n' character (0x0a)
A template class to specify that a data type can be considered as being contiguous in memory.
const Vector< label > N(dict.get< Vector< label > >("N"))