31 template<
class T,
class BaseType>
34 Istream& is = readStream(word::null);
36 if (headerClassName() == IOList<T>::typeName)
38 is >>
static_cast<ListCompactIO<T, BaseType>&
>(*this);
41 else if (headerClassName() == typeName)
51 ) <<
"unexpected class name " << headerClassName()
52 <<
" expected " << typeName <<
" or " << IOList<T>::typeName
54 <<
" while reading object " <<
name()
62 template<
class T,
class BaseType>
69 io.
readOpt() == IOobject::MUST_READ
70 || (io.
readOpt() == IOobject::READ_IF_PRESENT && headerOk())
78 template<
class T,
class BaseType>
89 io.
readOpt() == IOobject::MUST_READ
90 || (io.
readOpt() == IOobject::READ_IF_PRESENT && headerOk())
102 template<
class T,
class BaseType>
113 io.
readOpt() == IOobject::MUST_READ
114 || (io.
readOpt() == IOobject::READ_IF_PRESENT && headerOk())
126 template<
class T,
class BaseType>
138 io.
readOpt() == IOobject::MUST_READ
139 || (io.
readOpt() == IOobject::READ_IF_PRESENT && headerOk())
147 template<
class T,
class BaseType>
160 template<
class T,
class BaseType>
168 template<
class T,
class BaseType>
177 if (fmt == IOstream::ASCII)
180 const word oldTypeName = typeName;
184 bool good = regIOobject::writeObject(fmt, ver, cmp, write);
187 const_cast<word&
>(typeName) = oldTypeName;
191 else if (this->overflows())
194 <<
"Overall number of elements of CompactIOList of size " 195 << this->size() <<
" overflows the representation of a label" 196 <<
endl <<
" Switching to ascii writing" <<
endl;
199 const word oldTypeName = typeName;
203 bool good = regIOobject::writeObject(IOstream::ASCII, ver, cmp, write);
206 const_cast<word&
>(typeName) = oldTypeName;
212 return regIOobject::writeObject(fmt, ver, cmp, write);
217 template<
class T,
class BaseType>
220 return (os << *
this).good();
226 template<
class T,
class BaseType>
227 void Foam::CompactIOList<T, BaseType>::operator=
236 template<
class T,
class BaseType>
237 void Foam::CompactIOList<T, BaseType>::operator=
246 template<
class T,
class BaseType>
247 void Foam::CompactIOList<T, BaseType>::operator=
256 template<
class T,
class BaseType>
257 void Foam::CompactIOList<T, BaseType>::operator=
errorManipArg< error, int > exit(error &err, const int errNo=1)
A List of objects of type <T> with input and output using a compact storage. Behaves like List except...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Ostream & endl(Ostream &os)
Add newline and flush stream.
A List of objects of type <T> with automated input and output.
points setSize(newPointi)
A class for handling words, derived from string.
CompactIOList(const IOobject &)
Construct from IOobject.
streamFormat
Enumeration for the format of data in the stream.
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...
A List of objects of type <T> with automated input and output using a compact storage. Behaves like IOList except when binary output in case it writes a CompactListList.
word name(const complex &)
Return a string representation of a complex.
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
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
virtual bool writeData(Ostream &) const
Pure virtual writaData function.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...