33 template<
class>
class Container,
34 template<
class>
class IOContainer,
35 template<
class>
class CompactIOContainer,
48 size += this->operator[](i).size();
62 template<
class>
class Container,
63 template<
class>
class IOContainer,
64 template<
class>
class CompactIOContainer,
72 List<typename Type::value_type>& elems
75 start.setSize(this->size() + 1);
79 for (
label i = 1; i < start.size(); i++)
81 const label prev = start[i-1];
83 start[i] = prev + this->operator[](i-1).size();
88 <<
"Overall number of elements " << start[i]
89 <<
" of CompactIOListBase of size "
90 << this->size() <<
" overflows the representation of a label"
91 <<
endl <<
"Please recompile with a larger representation"
96 elems.setSize(start[start.size() - 1]);
102 const Type& subList = this->operator[](i);
106 elems[elemi++] = subList[j];
114 template<
class>
class Container,
115 template<
class>
class IOContainer,
116 template<
class>
class CompactIOContainer,
124 const List<typename Type::value_type>& elems
127 this->
setSize(start.size() - 1);
131 Type& subList = this->operator[](i);
133 label index = start[i];
135 subList.setSize(start[i+1] - index);
139 subList[j] = elems[index++];
147 template<
class>
class Container,
148 template<
class>
class IOContainer,
149 template<
class>
class CompactIOContainer,
160 if (headerClassName() == IOContainer<Type>::typeName)
162 is >>
static_cast<Container<Type>&
>(*this);
165 else if (headerClassName() == CompactIOContainer<Type>::typeName)
173 <<
"unexpected class name " << headerClassName()
174 <<
" expected " << CompactIOContainer<Type>::typeName <<
" or "
175 << IOContainer<Type>::typeName <<
endl
176 <<
" while reading object " <<
name()
187 template<
class>
class Container,
188 template<
class>
class IOContainer,
189 template<
class>
class CompactIOContainer,
210 template<
class>
class Container,
211 template<
class>
class IOContainer,
212 template<
class>
class CompactIOContainer,
226 readFromStream(
read);
231 readFromStream(
read && haveFile);
238 template<
class>
class Container,
239 template<
class>
class IOContainer,
240 template<
class>
class CompactIOContainer,
269 template<
class>
class Container,
270 template<
class>
class IOContainer,
271 template<
class>
class CompactIOContainer,
278 const Container<Type>& l
297 template<
class>
class Container,
298 template<
class>
class IOContainer,
299 template<
class>
class CompactIOContainer,
310 Container<Type>(move(l))
325 template<
class>
class Container,
326 template<
class>
class IOContainer,
327 template<
class>
class CompactIOContainer,
337 Container<Type>(move(l))
345 template<
class>
class Container,
346 template<
class>
class IOContainer,
347 template<
class>
class CompactIOContainer,
359 template<
class>
class Container,
360 template<
class>
class IOContainer,
361 template<
class>
class CompactIOContainer,
377 const word oldTypeName = CompactIOContainer<Type>::typeName;
379 const_cast<word&
>(CompactIOContainer<Type>::typeName) =
380 IOContainer<Type>::typeName;
385 const_cast<word&
>(CompactIOContainer<Type>::typeName) = oldTypeName;
389 else if (this->overflows())
392 <<
"Overall number of elements of CompactIOListBase of size "
393 << this->size() <<
" overflows the representation of a label"
394 <<
endl <<
" Switching to ascii writing" <<
endl;
397 const word oldTypeName = CompactIOContainer<Type>::typeName;
399 const_cast<word&
>(CompactIOContainer<Type>::typeName) =
400 IOContainer<Type>::typeName;
405 const_cast<word&
>(CompactIOContainer<Type>::typeName) = oldTypeName;
418 template<
class>
class Container,
419 template<
class>
class IOContainer,
420 template<
class>
class CompactIOContainer,
427 return (os << *
this).good();
435 template<
class>
class Container,
436 template<
class>
class IOContainer,
437 template<
class>
class CompactIOContainer,
448 Container<Type>::operator=(rhs);
454 template<
class>
class Container,
455 template<
class>
class IOContainer,
456 template<
class>
class CompactIOContainer,
466 Container<Type>::operator=(move(rhs));
474 template<
class>
class Container,
475 template<
class>
class IOContainer,
476 template<
class>
class CompactIOContainer,
493 template<
class>
class Container,
494 template<
class>
class IOContainer,
495 template<
class>
class CompactIOContainer,
501 CompactIOListBase<Container, IOContainer, CompactIOContainer, Type>& l
507 is >>
static_cast<Container<Type>&
>(l);
512 List<typename Type::value_type> elems(is);
513 l.convertFromCompact(start, elems);
522 template<
class>
class Container,
523 template<
class>
class IOContainer,
524 template<
class>
class CompactIOContainer,
530 const CompactIOListBase<Container, IOContainer, CompactIOContainer, Type>& l
536 os << static_cast<const Container<Type>&>(l);
541 List<typename Type::value_type> elems;
542 l.convertToCompact(start, elems);
543 os << start << elems;
#define forAll(list, i)
Loop across all elements in list.
virtual bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
virtual ~CompactIOListBase()
Destructor.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool write) const
WriteObject function. Changes the write type depending on whether.
CompactIOListBase(const IOobject &)
Construct from IOobject.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
readOption readOpt() const
streamFormat
Enumeration for the format of data in the stream.
compressionType
Enumeration for the format of data in the stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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.
bool headerOk()
Read and check header info.
virtual bool read()
Read object.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool read(const char *, int32_t &)
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
points setSize(newPointi)