45 os <<
"size=" << size() <<
'/' << capacity()
46 <<
" begin=" << begin_
65 end_ = elements.
size();
67 const label minLen = (end_ + min_size());
79 storage_ = std::move(elements);
92 const label len = this->size();
93 const auto list1 = this->array_one();
94 const auto list2 = this->array_two();
97 if (len != (list1.size() + list2.size()))
100 <<
"Size check failed" 105 if (
os.format() == IOstreamOption::BINARY && is_contiguous_v<T>)
117 os.beginRawWrite(len*
sizeof(
T));
121 os.writeRaw(list1.cdata_bytes(), list1.size_bytes());
125 os.writeRaw(list2.cdata_bytes(), list2.size_bytes());
134 (len <= 1 || !shortLen)
145 os << len << token::BEGIN_LIST;
149 for (
const T& val : list1)
151 if (i++)
os << token::SPACE;
154 for (
const T& val : list2)
156 if (i++)
os << token::SPACE;
161 os << token::END_LIST;
168 os <<
nl << len <<
nl << token::BEGIN_LIST <<
nl;
171 for (
const T& val : list1)
175 for (
const T& val : list2)
181 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.
void size(const label n)
Older name for setAddressableSize.
constexpr CircularBuffer() noexcept
Default construct, empty buffer without allocation.
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.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
void resize(const label len)
Alter addressable list size, allocating new space if required while recovering old content...
void setCapacity(const label len)
Alter the size of the underlying storage.
label capacity() const noexcept
Size of the underlying storage.
Istream & readList(Istream &is)
Read buffer contents from Istream.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
errorManip< error > abort(error &err)
Istream & readList(Istream &is)
Read from Istream, discarding existing contents.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
Ostream & info(Ostream &os) const
Print information.
Can suppress additional line breaks separate ASCII data content when the data elements are primitives...