40 && token::compound::isCompound
58 os << token::END_STATEMENT <<
endl;
63 Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::UList<T>& L)
66 if (os.format() == IOstream::ASCII || !contiguous<T>())
70 if (L.
size() > 1 && contiguous<T>())
87 os << L.
size() << token::BEGIN_BLOCK;
93 os << token::END_BLOCK;
95 else if (L.
size() <= 1 || (L.
size() < 11 && contiguous<T>()))
98 os << L.
size() << token::BEGIN_LIST;
103 if (i > 0) os << token::SPACE;
108 os << token::END_LIST;
113 os <<
nl << L.
size() <<
nl << token::BEGIN_LIST;
122 os <<
nl << token::END_LIST <<
nl;
130 os.write(reinterpret_cast<const char*>(L.v_), L.
byteSize());
135 os.check(
"Ostream& operator<<(Ostream&, const UList&)");
144 is.
fatalCheck(
"operator>>(Istream&, UList<T>&)");
146 token firstToken(is);
148 is.
fatalCheck(
"operator>>(Istream&, UList<T>&) : reading first token");
166 <<
"incorrect length for UList. Read " << s
167 <<
" expected " << L.
size()
183 <<
"incorrect length for UList. Read " << s
184 <<
" expected " << L.
size()
190 if (is.
format() == IOstream::ASCII || !contiguous<T>())
197 if (delimiter == token::BEGIN_LIST)
205 "operator>>(Istream&, UList<T>&) : reading entry" 216 "operator>>(Istream&, UList<T>&) : " 217 "reading the single entry" 234 is.
read(reinterpret_cast<char*>(L.
data()), s*
sizeof(
T));
238 "operator>>(Istream&, UList<T>&) : reading the binary block" 245 if (firstToken.
pToken() != token::BEGIN_LIST)
248 <<
"incorrect first token, expected '(', found " 259 if (sll.size() != L.
size())
262 <<
"incorrect length for UList. Read " << sll.size()
263 <<
" expected " << L.
size()
283 <<
"incorrect first token, expected <int> or '(', found "
#define forAll(list, i)
Loop across all elements in list.
punctuationToken pToken() const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
compound & transferCompoundToken(const Istream &is)
To & dynamicCast(From &r)
Reference type cast template function,.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
char readEndList(const char *funcName)
InfoProxy< token > info() const
Return info proxy.
Template class for non-intrusive linked lists.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
An STL-conforming const_iterator.
A token holds items read from Istream.
void putBack(const token &)
Put back token.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Template function to specify if the data of a type are contiguous.
Traits class for primitives.
A templated class for holding compound tokens.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
virtual Istream & read(token &)=0
Return next token from stream.
A class for handling words, derived from string.
Istream & operator>>(Istream &, directionInfo &)
streamFormat format() const
Return current stream format.
char readBeginList(const char *funcName)
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
T * data()
Return a pointer to the first data element,.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
label size() const
Return the number of elements in the UList.
Non-intrusive singly-linked list.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
bool isPunctuation() const
void writeEntry(Ostream &) const
Write the UList as a dictionary entry.