34 template<
class T,
unsigned Size>
43 template<
class T,
unsigned Size>
50 template<
class T,
unsigned Size>
53 is.
fatalCheck(
"operator>>(Istream&, FixedList<T, Size>&)");
55 if (is.
format() == IOstream::ASCII || !contiguous<T>())
61 "operator>>(Istream&, FixedList<T, Size>&) : reading first token"
64 if (firstToken.isCompound())
66 L = dynamicCast<token::Compound<List<T>>>
68 firstToken.transferCompoundToken(is)
71 else if (firstToken.isLabel())
73 label s = firstToken.labelToken();
78 else if (!firstToken.isPunctuation())
81 <<
"incorrect first token, expected <label> "
82 "or '(' or '{', found "
95 if (delimiter == token::BEGIN_LIST)
97 for (
unsigned i=0; i<Size; i++)
103 "operator>>(Istream&, FixedList<T, Size>&) : "
115 "operator>>(Istream&, FixedList<T, Size>&) : "
116 "reading the single entry"
119 for (
unsigned i=0; i<Size; i++)
130 is.
read(
reinterpret_cast<char*
>(L.
data()), Size*
sizeof(
T));
134 "operator>>(Istream&, FixedList<T, Size>&) : "
135 "reading the binary block"
145 template<
class T,
unsigned Size>
149 if (os.
format() == IOstream::ASCII || !contiguous<T>())
151 bool uniform =
false;
153 if (Size > 1 && contiguous<T>())
170 os << L.
size() << token::BEGIN_BLOCK;
176 os << token::END_BLOCK;
178 else if (Size <= 1 ||(Size < 11 && contiguous<T>()))
181 os << token::BEGIN_LIST;
186 if (i > 0) os << token::SPACE;
191 os << token::END_LIST;
196 os <<
nl << token::BEGIN_LIST;
205 os <<
nl << token::END_LIST <<
nl;
210 os.
write(
reinterpret_cast<const char*
>(L.
cdata()), Size*
sizeof(
T));
214 os.
check(
"Ostream& operator<<(Ostream&, const FixedList&)");
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> with a fixed size <Size>.
label size() const
Return the number of elements in the FixedList.
const T * cdata() const
Return a const pointer to the first data element,.
void checkSize(const label size) const
Check size is within valid range (0 ... size)
T * data()
Return a pointer to the first data element,.
FixedList()
Null constructor.
streamFormat format() const
Return current stream format.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
char readEndList(const char *funcName)
virtual Istream & read(token &)=0
Return next token from stream.
char readBeginList(const char *funcName)
void putBack(const token &)
Put back token.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const char)=0
Write character.
A token holds items read from Istream.
Template function to specify if the data of a type are contiguous.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Istream & operator>>(Istream &is, volFieldValue::Result< Type > &result)
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void writeListEntry(Ostream &os, const ListType &l)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Istream & operator>>(Istream &, pistonPointEdgeData &)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)