34template<
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()
56 <<
exit(FatalIOError);
61template<
class T,
class BaseType>
66 readOpt() == IOobject::MUST_READ
67 || (readOpt() == IOobject::READ_IF_PRESENT && headerOk())
78template<
class T,
class BaseType>
84 const label oldSize = size;
85 size += this->operator[](i).size();
97template<
class T,
class BaseType>
106template<
class T,
class BaseType>
119template<
class T,
class BaseType>
135template<
class T,
class BaseType>
151template<
class T,
class BaseType>
168template<
class T,
class BaseType>
184 <<
"Overall number of elements of CompactIOList of size "
185 << this->size() <<
" overflows the representation of a label"
186 <<
nl <<
" Switching to ascii writing" <<
endl;
192 const word oldTypeName(typeName);
199 const_cast<word&
>(typeName) = oldTypeName;
208template<
class T,
class BaseType>
211 return (
os << *
this).
good();
217template<
class T,
class BaseType>
229template<
class T,
class BaseType>
241 L.setSize(start.size()-1);
247 label index = start[i];
248 subList.setSize(start[i+1] - index);
252 subList[j] = elems[index++];
260template<
class T,
class BaseType>
270 os << static_cast<const List<T>&>(
L);
278 for (label i = 1; i < start.size(); i++)
280 const label prev = start[i-1];
281 start[i] = prev+
L[i-1].
size();
286 <<
"Overall number of elements " << start[i]
287 <<
" of CompactIOList of size "
288 <<
L.
size() <<
" overflows the representation of a label"
289 <<
endl <<
"Please recompile with a larger representation"
294 List<BaseType> elems(start[start.size()-1]);
299 const T& subList =
L[i];
303 elems[elemI++] = subList[j];
306 os << start << elems;
A List of objects of type <T> with automated input and output using a compact storage....
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options. Checks for overflow in binary.
virtual bool resize()
Resize the ODE solver.
A List of objects of type <T> with automated input and output.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool good() const noexcept
Did last readHeader() succeed?
The IOstreamOption is a simple container for options an IOstream can normally have.
streamFormat format() const noexcept
Get the current stream format.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void operator=(const UList< T > &a)
Assignment to UList operator. Takes linear time.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static constexpr direction size() noexcept
The number of elements in the VectorSpace = Ncmpts.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
transferModelList & transfer()
Transfer.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define WarningInFunction
Report a warning using Foam::Warning.
List< label > labelList
A List of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
const vector L(dict.get< vector >("L"))