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)
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"
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)
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;
constexpr CircularBuffer() noexcept
Default construct, empty buffer without allocation.
Ostream & writeList(Ostream &os, const label shortLen=0) const
Istream & readList(Istream &is)
Read buffer contents from Istream.
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)....
void putBack(const token &tok)
Put back a token. Only a single put back is permitted.
Template class for non-intrusive linked lists.
T removeHead()
Remove and return first entry.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Istream & readList(Istream &is)
Read List contents from Istream.
InfoProxy< ensightCells > info() const
Return info proxy.
A templated class for holding compound tokens.
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.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
errorManip< error > abort(error &err)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
To & dynamicCast(From &r)
A template class to specify that a data type can be considered as being contiguous in memory.