46 os <<
"size=" << size() <<
'/' << capacity()
47 <<
" begin=" << begin_
66 end_ = elements.
size();
68 const label minLen = (end_ + min_size());
80 storage_ = std::move(elements);
93 const label len = this->size();
94 const auto list1 = this->array_one();
95 const auto list2 = this->array_two();
98 if (len != (list1.size() + list2.size()))
101 <<
"Size check failed" 106 if (
os.format() == IOstreamOption::BINARY && is_contiguous<T>::value)
118 os.beginRawWrite(len*
sizeof(
T));
122 os.writeRaw(list1.cdata_bytes(), list1.size_bytes());
126 os.writeRaw(list2.cdata_bytes(), list2.size_bytes());
135 (len <= 1 || !shortLen)
141 is_contiguous<T>::value
142 || Detail::ListPolicy::no_linebreak<T>::value
150 os << len << token::BEGIN_LIST;
154 for (
const T& val : list1)
156 if (i++)
os << token::SPACE;
159 for (
const T& val : list2)
161 if (i++)
os << token::SPACE;
166 os << token::END_LIST;
173 os <<
nl << len <<
nl << token::BEGIN_LIST <<
nl;
176 for (
const T& val : list1)
180 for (
const T& val : list2)
186 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.