31 template<
class Type,
class BaseType>
34 Istream& is = readStream(word::null, read);
38 if (headerClassName() == IOField<Type>::typeName)
40 is >>
static_cast<Field<Type>&
>(*this);
43 else if (headerClassName() == typeName)
53 ) <<
"unexpected class name " << headerClassName()
54 <<
" expected " << typeName <<
" or " << IOField<Type>::typeName
56 <<
" while reading object " <<
name()
65 template<
class Type,
class BaseType>
81 template<
class Type,
class BaseType>
97 readFromStream(read && haveFile);
102 template<
class Type,
class BaseType>
126 template<
class Type,
class BaseType>
150 template<
class Type,
class BaseType>
171 template<
class Type,
class BaseType>
184 template<
class Type,
class BaseType>
192 template<
class Type,
class BaseType>
222 template<
class Type,
class BaseType>
225 return (os << *
this).good();
231 template<
class Type,
class BaseType>
232 void Foam::CompactIOField<Type, BaseType>::operator=
241 template<
class Type,
class BaseType>
242 void Foam::CompactIOField<Type, BaseType>::operator=
251 template<
class Type,
class BaseType>
258 template<
class Type,
class BaseType>
267 template<
class Type,
class BaseType>
279 L.setSize(start.
size()-1);
285 label index = start[i];
286 subField.
setSize(start[i+1] - index);
290 subField[j] = elems[index++];
298 template<
class Type,
class BaseType>
308 os << static_cast<const Field<Type>&>(L);
316 for (
label i = 1; i < start.size(); i++)
318 start[i] = start[i-1]+L[i-1].
size();
330 elems[elemI++] = subField[j];
333 os << start << elems;
#define forAll(list, i)
Loop across all elements in list.
CompactIOField(const IOobject &)
Construct from IOobject.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static const char *const typeName
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool headerOk()
Read and check header info.
Pre-declare related SubField type.
regIOobject(const IOobject &, const bool isTime=false)
Construct from IOobject. Optional flag for if IOobject is the.
void operator=(const CompactIOField< Type, BaseType > &)
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool write) const
Write using given format, version and compression.
Pre-declare SubField and related Field type.
A class for handling words, derived from string.
streamFormat
Enumeration for the format of data in the stream.
virtual bool writeData(Ostream &) const
Pure virtual writaData function.
virtual ~CompactIOField()
compressionType
Enumeration for the format of data in the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void operator=(const Field< Type > &)
word name(const complex &)
Return a string representation of a complex.
void setSize(const label)
Reset size of List.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A Field of objects of type <T> with automated input and output using a compact storage. Behaves like IOField except when binary output in case it writes a CompactListList.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool write) const
Write using given format, version and compression.
readOption readOpt() const
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A primitive field of type <T> with automated input and output.