34 template<
class T,
unsigned Size>
41 template<
class T,
unsigned Size>
44 is.
fatalCheck(
"operator>>(Istream&, FixedList<T, Size>&)");
46 if (is.
format() == IOstream::ASCII || !contiguous<T>())
52 "operator>>(Istream&, FixedList<T, Size>&) : reading first token" 57 L = dynamicCast<token::Compound<List<T> > >
72 <<
"incorrect first token, expected <label> " 73 "or '(' or '{', found " 86 if (delimiter == token::BEGIN_LIST)
88 for (
unsigned i=0; i<Size; i++)
94 "operator>>(Istream&, FixedList<T, Size>&) : " 106 "operator>>(Istream&, FixedList<T, Size>&) : " 107 "reading the single entry" 110 for (
unsigned i=0; i<Size; i++)
121 is.
read(reinterpret_cast<char*>(L.
data()), Size*
sizeof(
T));
125 "operator>>(Istream&, FixedList<T, Size>&) : " 126 "reading the binary block" 136 template<
class T,
unsigned Size>
142 && token::compound::isCompound
155 template<
class T,
unsigned Size>
164 os << token::END_STATEMENT <<
endl;
168 template<
class T,
unsigned Size>
169 Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L)
172 if (os.
format() == IOstream::ASCII || !contiguous<T>())
176 if (Size > 1 && contiguous<T>())
193 os << L.
size() << token::BEGIN_BLOCK;
199 os << token::END_BLOCK;
201 else if (Size <= 1 ||(Size < 11 && contiguous<T>()))
204 os << token::BEGIN_LIST;
209 if (i > 0) os << token::SPACE;
214 os << token::END_LIST;
219 os <<
nl << token::BEGIN_LIST;
228 os <<
nl << token::END_LIST <<
nl;
233 os.
write(reinterpret_cast<const char*>(L.
cdata()), Size*
sizeof(
T));
237 os.
check(
"Ostream& operator<<(Ostream&, const FixedList&)");
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 ))
const T * cdata() const
Return a const pointer to the first data element,.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
char readBeginList(const char *funcName)
virtual Istream & read(token &)=0
Return next token from stream.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool isPunctuation() const
errorManipArg< error, int > exit(error &err, const int errNo=1)
A 1D vector of objects of type <T> with a fixed size <Size>.
label size() const
Return the number of elements in the FixedList.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
FixedList()
Null constructor.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void writeEntry(Ostream &) const
Write the FixedList as a dictionary entry.
void putBack(const token &)
Put back token.
T * data()
Return a pointer to the first data element,.
InfoProxy< token > info() const
Return info proxy.
char readEndList(const char *funcName)
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
streamFormat format() const
Return current stream format.
virtual Ostream & write(const token &)=0
Write next token to stream.
A token holds items read from Istream.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
Template function to specify if the data of a type are contiguous.
compound & transferCompoundToken(const Istream &is)
Traits class for primitives.
Istream & operator>>(Istream &, edgeMesh &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Uniform/equally-weighted distribution model.
void checkSize(const label size) const
Check size is within valid range (0 ... size).
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.