42 #ifndef Foam_UOPstream_H 43 #define Foam_UOPstream_H 68 inline void prepareBuffer(
const size_t count,
const size_t align);
72 inline void writeToBuffer(
const T& val);
76 inline void writeToBuffer
84 inline void putChar(
const char c);
88 inline void putString(
const std::string& str);
118 const bool sendAtDestruct =
true,
137 virtual ios_base::fmtflags
flags()
const 139 return ios_base::fmtflags(0);
166 const std::string& str,
167 const bool quoted=
true 216 virtual char fill()
const 222 virtual char fill(
const char)
228 virtual int width()
const 235 virtual int width(
const int)
263 virtual ios_base::fmtflags
flags(
const ios_base::fmtflags)
265 return ios_base::fmtflags(0);
289 bool bufferIPCsend();
306 const bool sendAtDestruct =
true,
333 const std::streamsize bufSize,
355 bool bufferIPCsend();
372 const bool sendAtDestruct =
true,
394 const int rootProcNo,
396 const std::streamsize bufSize,
static bool write(const UPstream::commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Write buffer contents to given processor.
const bool sendAtDestruct_
virtual bool write(const token &tok)
Write token to stream or otherwise handle it.
virtual void flush()
Flush stream.
commsTypes
Types of communications.
virtual void indent()
Add indentation characters.
A token holds an item read from Istream.
UOPBstream(const commsTypes commsType, const int toProcNo, DynamicList< char > &sendBuf, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool sendAtDestruct=true, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct given process index to write to using the given attached send buffer, optional communicatio...
static int & msgType() noexcept
Message tag of standard messages.
static label worldComm
Default world communicator (all processors). May differ from globalComm if local worlds are in use...
UOPstreamBase(const commsTypes commsType, const int toProcNo, DynamicList< char > &sendBuf, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool sendAtDestruct=true, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct given process index to write to using the given attached send buffer, optional communicatio...
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
virtual ios_base::fmtflags flags() const
Return flags of output stream.
virtual bool beginRawWrite(std::streamsize count)
Begin marker for low-level raw binary output.
virtual int width() const
Get width of output field.
A class for handling words, derived from Foam::string.
void print(Ostream &os) const
Print stream description to Ostream.
virtual Ostream & writeQuoted(const std::string &str, const bool quoted=true)
Write std::string surrounded by quotes.
virtual ~UOPBstream()
Destructor, usually sends buffer on destruct.
DynamicList< char > & sendBuf_
Output inter-processor communications stream using MPI broadcast - operating on external buffer...
virtual void endl()
Add newline and flush stream.
virtual void rewind()
Rewind the send buffer for overwriting.
virtual int precision() const
Get precision of output field.
commsTypes commsType() const noexcept
Get the communications type of the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Output inter-processor communications stream using MPI send/recv etc. - operating on external buffer...
virtual ~UOPstream()
Destructor, usually sends buffer on destruct.
OBJstream os(runTime.globalPath()/outputName)
Database for solution data, solver performance and other reduced data.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static bool write(const commsTypes commsType, const int rootProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Wrapped version of UPstream::broadcast with const-cast.
virtual ~UOPstreamBase()
Destructor.
virtual Ostream & writeRaw(const char *data, std::streamsize count)
Low-level raw binary output.
UOPstream(const commsTypes commsType, const int toProcNo, DynamicList< char > &sendBuf, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool sendAtDestruct=true, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct given process index to write to using the given attached send buffer, optional communicatio...
const dimensionedScalar c
Speed of light in a vacuum.
streamFormat
Data format (ascii | binary)
virtual bool endRawWrite()
End marker for low-level raw binary output.
Base class for output inter-processor communications stream (ie, parallel streams). Not to be used directly, thus contructors are protected.
virtual char fill() const
Get the current padding character.
Inter-processor communications stream.