Go to the documentation of this file.
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"
55 if (firstToken.isCompound())
57 L = dynamicCast<token::Compound<List<T> > >
59 firstToken.transferCompoundToken(is)
62 else if (firstToken.isLabel())
64 label s = firstToken.labelToken();
69 else if (!firstToken.isPunctuation())
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
144 "List<" + word(pTraits<T>::typeName) +
'>'
148 os << word(
"List<" + word(pTraits<T>::typeName) +
'>') <<
" ";
155 template<
class T,
unsigned Size>
162 os.writeKeyword(keyword);
164 os << token::END_STATEMENT <<
endl;
168 template<
class T,
unsigned Size>
172 if (os.format() == IOstream::ASCII || !contiguous<T>())
174 bool uniform =
false;
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&)");
streamFormat format() const
Return current stream format.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
#define forAll(list, i)
Loop across all elements in list.
char readBeginList(const char *funcName)
char readEndList(const char *funcName)
Ostream & endl(Ostream &os)
Add newline and flush stream.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Ostream & operator<<(Ostream &, const edgeMesh &)
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))
errorManipArg< error, int > exit(error &err, const int errNo=1)
Template function to specify if the data of a type are contiguous.
void putBack(const token &)
Put back token.
Istream & operator>>(Istream &, edgeMesh &)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void writeEntry(Ostream &) const
Write the FixedList as a dictionary entry.
FixedList()
Null constructor.
virtual Istream & read(token &)=0
Return next token from stream.