45 ? (align + ((
pos - 1) & ~(align - 1)))
55inline void Foam::UOPstreamBase::prepareBuffer
78inline void Foam::UOPstreamBase::writeToBuffer(
const T& val)
80 writeToBuffer(&val,
sizeof(
T),
sizeof(
T));
84inline void Foam::UOPstreamBase::writeToBuffer
96 prepareBuffer(count, align);
99 const label
pos = sendBuf_.size();
102 sendBuf_.resize(
pos + count);
104 char*
const __restrict__ buf = (sendBuf_.data() +
pos);
105 const char*
const __restrict__
input =
reinterpret_cast<const char*
>(data);
107 for (
size_t i = 0; i <
count; ++i)
114inline void Foam::UOPstreamBase::putChar(
const char c)
116 if (!sendBuf_.capacity())
118 sendBuf_.setCapacity(1000);
124inline void Foam::UOPstreamBase::putString(
const std::string& str)
126 const size_t len = str.size();
128 writeToBuffer(str.data(), len, 1);
141 const bool sendAtDestruct,
151 sendAtDestruct_(sendAtDestruct)
163 sendBuf_(buffers.sendBuf_[toProcNo]),
165 comm_(buffers.comm()),
238 const word nonWhiteChars(string::validate<word>(str));
240 if (nonWhiteChars.size() == 1)
242 return write(nonWhiteChars[0]);
244 else if (nonWhiteChars.size())
246 return write(nonWhiteChars);
273 const std::string& str,
326 std::streamsize count
332 <<
"stream format not binary"
337 writeToBuffer(
data, count, 8);
346 std::streamsize count
353 writeToBuffer(
data, count, 1);
364 <<
"stream format not binary"
370 prepareBuffer(count, 8);
397 os <<
"Writing from processor " << toProcNo_
398 <<
" to processor " << myProcNo() <<
" in communicator " << comm_
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void resize(const label len)
void reserve(const label len)
The IOstreamOption is a simple container for options an IOstream can normally have.
streamFormat
Data format (ascii | binary)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void size(const label n)
Older name for setAddressableSize.
Base class for output inter-processor communications stream (ie, parallel streams)....
DynamicList< char > & sendBuf_
virtual ~UOPstreamBase()
Destructor.
virtual Ostream & writeRaw(const char *data, std::streamsize count)
Low-level raw binary output.
virtual bool beginRawWrite(std::streamsize count)
Begin marker for low-level raw binary output.
virtual void rewind()
Rewind the send buffer for overwriting.
virtual Ostream & writeQuoted(const std::string &str, const bool quoted=true)
Write std::string surrounded by quotes.
Inter-processor communications stream.
commsTypes
Types of communications.
Database for solution data, solver performance and other reduced data.
virtual bool write()
Write the output fields.
scalar print()
Print to screen.
A token holds an item read from Istream.
@ LABEL
label (integer) type
@ DOUBLE
double (double-precision) type
@ FLAG
stream flag (1-byte bitmask)
@ FLOAT
float (single-precision) type
@ STRING
Foam::string (usually double-quoted)
const string & stringToken() const
Return const reference to the string contents.
int flagToken() const
Return flag bitmask value.
tokenType type() const noexcept
Return the token type.
const word & wordToken() const
Return const reference to the word contents.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
dimensionedScalar pos(const dimensionedScalar &ds)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static Istream & input(Istream &is, IntRange< T > &range)
double doubleScalar
A typedef for double.
bool isspace(char c) noexcept
Test for whitespace (C-locale)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static label byteAlign(const label pos, const size_t align)
float floatScalar
A typedef for float.
errorManip< error > abort(error &err)
word format(conversionProperties.get< word >("format"))