Go to the documentation of this file.
34 template<
class T,
class BaseType>
37 Istream& is = readStream(word::null);
39 if (headerClassName() == IOList<T>::typeName)
41 is >>
static_cast<List<T>&
>(*this);
44 else if (headerClassName() == typeName)
52 <<
"unexpected class name " << headerClassName()
53 <<
" expected " << typeName <<
" or " << IOList<T>::typeName
55 <<
" while reading object " <<
name()
61 template<
class T,
class BaseType>
67 const label oldSize = size;
68 size += this->operator[](i).size();
80 template<
class T,
class BaseType>
87 io.
readOpt() == IOobject::MUST_READ
88 || (io.
readOpt() == IOobject::READ_IF_PRESENT && headerOk())
96 template<
class T,
class BaseType>
107 io.
readOpt() == IOobject::MUST_READ
108 || (io.
readOpt() == IOobject::READ_IF_PRESENT && headerOk())
120 template<
class T,
class BaseType>
131 io.
readOpt() == IOobject::MUST_READ
132 || (io.
readOpt() == IOobject::READ_IF_PRESENT && headerOk())
144 template<
class T,
class BaseType>
157 io.
readOpt() == IOobject::MUST_READ
158 || (io.
readOpt() == IOobject::READ_IF_PRESENT && headerOk())
168 template<
class T,
class BaseType>
177 bool nonCompact =
false;
179 if (fmt == IOstream::ASCII)
183 else if (overflows())
188 <<
"Overall number of elements of CompactIOList of size "
189 << this->size() <<
" overflows the representation of a label"
190 <<
nl <<
" Switching to ascii writing" <<
endl;
196 const word oldTypeName(typeName);
200 bool good = regIOobject::writeObject(IOstream::ASCII, ver, cmp, valid);
203 const_cast<word&
>(typeName) = oldTypeName;
208 return regIOobject::writeObject(fmt, ver, cmp, valid);
212 template<
class T,
class BaseType>
215 return (os << *
this).good();
221 template<
class T,
class BaseType>
233 template<
class T,
class BaseType>
245 L.setSize(
start.size()-1);
252 subList.setSize(
start[i+1] - index);
256 subList[j] = elems[index++];
264 template<
class T,
class BaseType>
272 if (os.format() == IOstream::ASCII)
274 os << static_cast<const List<T>&>(
L);
285 start[i] = prev+
L[i-1].size();
290 <<
"Overall number of elements " <<
start[i]
291 <<
" of CompactIOList of size "
292 <<
L.size() <<
" overflows the representation of a label"
293 <<
endl <<
"Please recompile with a larger representation"
303 const T& subList =
L[i];
307 elems[elemI++] = subList[j];
310 os <<
start << elems;
List< label > labelList
A List of labels.
points setSize(newPointi)
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const vector L(dict.get< vector >("L"))
A class for handling words, derived from Foam::string.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Representation of a major/minor version number.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
word name(const complex &c)
Return string representation of complex.
CompactIOList(const CompactIOList &)=default
Default copy construct.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
A List of objects of type <T> with automated input and output using a compact storage....
virtual bool writeData(Ostream &) const
streamFormat
Data format (ascii | binary)
errorManipArg< error, int > exit(error &err, const int errNo=1)
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
readOption readOpt() const
The read option.
label ListType::const_reference const label start
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A List of objects of type <T> with automated input and output.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
#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,...
#define WarningInFunction
Report a warning using Foam::Warning.