46 os <<
"size=" << size() <<
'/' << capacity()
47 <<
" begin=" << begin_
73 "CircularBuffer<T>::readList(Istream&) : " 89 end_ = storage_.size();
93 storage_.resize(end_ + min_size());
106 storage_.resize(end_ + min_size());
111 UList<T> list(storage_.data(), end_);
123 const label len = sll.size();
129 storage_.resize(end_ + min_size());
132 for (label i = 0; i < len; ++i)
134 storage_[i] = std::move(sll.removeHead());
141 <<
"incorrect first token, expected <int> or '(', found " 157 const label len = this->size();
158 const auto list1 = this->array_one();
159 const auto list2 = this->array_two();
162 if (len != (list1.size() + list2.size()))
165 <<
"Size check failed" 170 if (
os.format() == IOstreamOption::BINARY && is_contiguous<T>::value)
182 os.beginRawWrite(len*
sizeof(
T));
186 os.writeRaw(list1.cdata_bytes(), list1.size_bytes());
190 os.writeRaw(list2.cdata_bytes(), list2.size_bytes());
199 (len <= 1 || !shortLen)
205 is_contiguous<T>::value
206 || Detail::ListPolicy::no_linebreak<T>::value
214 os << len << token::BEGIN_LIST;
218 for (
const T& val : list1)
220 if (i++)
os << token::SPACE;
223 for (
const T& val : list2)
225 if (i++)
os << token::SPACE;
230 os << token::END_LIST;
237 os <<
nl << len <<
nl << token::BEGIN_LIST <<
nl;
240 for (
const T& val : list1)
244 for (
const T& val : list2)
250 os << token::END_LIST <<
nl;
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write buffer contents with line-breaks in ASCII when length exceeds shortLen.
bool isPunctuation() const noexcept
Token is PUNCTUATION.
constexpr CircularBuffer() noexcept
Default construct, empty buffer without allocation.
compound & transferCompoundToken()
Return reference to compound and mark internally as released.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool isCompound() const noexcept
Token is COMPOUND.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
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 token holds an item read from Istream.
A templated class for holding compound tokens.
Istream & readList(Istream &is)
Read buffer contents from Istream.
void putBack(const token &tok)
Put back a token. Only a single put back is permitted.
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
Type & dynamicCast(U &obj)
A dynamic_cast (for references) that generates FatalError on failed casts.
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
label labelToken() const
Return label value.
bool isLabel() const noexcept
Token is LABEL.
Ostream & info(Ostream &os) const
Print information.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...