30 template<
class T,
class BaseType>
37 size += this->operator[](i).size();
47 template<
class T,
class BaseType>
54 start.
setSize(this->size() + 1);
59 label prev = start[i-1];
60 start[i] = prev + this->operator[](i-1).
size();
65 <<
"Overall number of elements " << start[i]
66 <<
" of ListCompactIO of size " 67 << this->size() <<
" overflows the representation of a label" 68 <<
endl <<
"Please recompile with a larger representation" 78 const T&
subList = this->operator[](i);
82 elems[elemi++] = subList[j];
88 template<
class T,
class BaseType>
101 label index = start[i];
102 subList.
setSize(start[i+1] - index);
106 subList[j] = elems[index++];
114 template<
class T,
class BaseType>
119 template<
class T,
class BaseType>
126 template<
class T,
class BaseType>
133 template<
class T,
class BaseType>
140 template<
class T,
class BaseType>
149 template<
class T,
class BaseType>
150 void Foam::ListCompactIO<T, BaseType>::operator=
159 template<
class T,
class BaseType>
160 void Foam::ListCompactIO<T, BaseType>::operator=
169 template<
class T,
class BaseType>
176 template<
class T,
class BaseType>
185 template<
class T,
class BaseType>
189 if (os.
format() == IOstream::ASCII)
191 os << static_cast<const List<T>&>(l);
206 template<
class T,
class BaseType>
213 if (is.format() == IOstream::ASCII)
215 is >>
static_cast<List<T>&
>(L);
221 L.convertFromCompact(start, elems);
228 template<
class T,
class BaseType>
236 if (os.format() == IOstream::ASCII)
238 os << static_cast<const List<T>&>(L);
244 L.convertToCompact(start, elems);
245 os << start << elems;
#define forAll(list, i)
Loop across all elements in list.
void convertToCompact(labelList &start, List< BaseType > &elems) const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
ListCompactIO()
Construct null.
void convertFromCompact(const labelList &start, const List< BaseType > &elems)
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...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
points setSize(newPointi)
A List obtained as a section of another List.
streamFormat format() const
Return current stream format.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
void setSize(const label)
Reset size of List.
bool overflows() const
Has too many elements in it?
void operator=(const ListCompactIO< T, BaseType > &)