Go to the documentation of this file.
48 if (!sendBuf_.capacity())
50 sendBuf_.setCapacity(1000);
63 if (!sendBuf_.capacity())
65 sendBuf_.setCapacity(1000);
68 label alignedPos = sendBuf_.size();
73 alignedPos = align + ((sendBuf_.size() - 1) & ~(align - 1));
77 sendBuf_.setSize(alignedPos + count);
79 const char* dataPtr =
reinterpret_cast<const char*
>(
data);
81 while (i--) sendBuf_[alignedPos++] = *dataPtr++;
95 const bool sendAtDestruct,
106 sendAtDestruct_(sendAtDestruct)
116 Ostream(buffers.format_, buffers.version_),
118 sendBuf_(buffers.sendBuf_[toProcNo]),
120 comm_(buffers.comm_),
121 sendAtDestruct_(buffers.commsType_ !=
UPstream::nonBlocking)
148 <<
"Failed sending outgoing message of size " << sendBuf_.size()
149 <<
" to processor " << toProcNo_
193 word nonWhiteChars(string::validate<word>(str));
195 if (nonWhiteChars.size() == 1)
197 return write(nonWhiteChars.c_str()[1]);
199 else if (nonWhiteChars.size())
201 return write(nonWhiteChars);
214 size_t len = str.size();
216 writeToBuffer(str.c_str(), len + 1, 1);
226 size_t len = str.size();
228 writeToBuffer(str.c_str(), len + 1, 1);
236 const std::string& str,
249 size_t len = str.size();
251 writeToBuffer(str.c_str(), len + 1, 1);
294 <<
"stream format not binary"
298 writeToBuffer(
data, count, 8);
306 os <<
"Writing from processor " << toProcNo_
307 <<
" to processor " << myProcNo() <<
" in communicator " << comm_
UOPstream(const commsTypes commsType, const int toProcNo, DynamicList< char > &sendBuf, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool sendAtDestruct=true, streamFormat format=BINARY, versionNumber version=currentVersion)
Construct given process index to send to and optional buffer size,.
word format(conversionProperties.lookup("format"))
double doubleScalar
Double precision floating point scalar type.
A class for handling words, derived from string.
float floatScalar
Float precision floating point scalar type.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Ostream & endl(Ostream &os)
Add newline and flush stream.
A token holds items read from Istream.
void writeToBuffer(const T &)
Write a T to the transfer buffer.
void setOpened()
Set stream opened.
const string & stringToken() const
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
static bool write(const commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=0)
Write given buffer to given processor.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Inter-processor communications stream.
Ostream & writeQuoted(const std::string &, const bool quoted=true)
Write std::string surrounded by quotes.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
errorManip< error > abort(error &err)
commsTypes
Types of communications.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void setGood()
Set stream to be good.
void print(Ostream &) const
Print description of IOstream to Ostream.
const dimensionedScalar c
Speed of light in a vacuum.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Database for solution data, solver performance and other reduced data.
streamFormat
Enumeration for the format of data in the stream.