Go to the documentation of this file.
38 #ifndef DynamicField_H
39 #define DynamicField_H
52 template<
class T,
int SizeMin>
55 template<
class T,
int SizeMin>
62 template<
class T,
int SizeMin=64>
67 static_assert(SizeMin > 0,
"Invalid min size parameter");
78 template<
class ListType>
79 inline void assignDynList(
const ListType& list);
83 inline void doCapacity(
const bool nocopy,
const label len);
88 inline void doReserve(
const bool nocopy,
const label len);
93 inline void doResize(
const bool nocopy,
const label len);
103 return NullObjectRef<DynamicField<T, SizeMin>>();
125 template<
int AnySizeMin>
143 template<
int AnySizeMin>
147 template<
int AnySizeMin>
184 static constexpr label
min_size() noexcept {
return SizeMin; }
187 inline label
capacity() const noexcept;
215 inline
void reserve(const label len);
228 inline
void resize(const label len);
231 inline
void resize(const label len, const
T& val);
247 inline void clear() noexcept;
267 template<
int AnySizeMin>
271 template<
int AnySizeMin>
278 template<
int AnySizeMin>
282 template<
int AnySizeMin>
327 template<
int AnySizeMin>
334 template<
int AnySizeMin>
362 #include "DynamicFieldI.H"
void transfer(List< T > &list)
Transfer the parameter contents into this.
void clearStorage()
Clear the list and delete storage.
void resize(const label len)
void setCapacity_nocopy(const label len)
void setSize(const label n)
Alias for resize()
A class for managing temporary objects.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
friend Ostream & operator(Ostream &os, const DynamicField< T, SizeMin > &rhs)
Write to Ostream.
label capacity() const noexcept
Size of the underlying storage.
Abstract base class to hold the Field mapping addressing and weights.
Istream & operator>>(Istream &, directionInfo &)
void setSize(const label n, const T &val)
Alias for resize()
void swap(DynamicField< T, AnySizeMin > &other)
Swap content, independent of sizing parameter.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
void shrinkStorage()
Shrink the allocated space to the number of elements used.
DynamicField< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
void setCapacity(const label len)
Alter the size of the underlying storage.
Generic templated field type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
label expandStorage() noexcept
Expand the addressable size to fit the allocated capacity.
constexpr DynamicField() noexcept
Default construct, an empty field without allocation.
void reserve_nocopy(const label len)
OBJstream os(runTime.globalPath()/outputName)
Istream & readList(Istream &is)
Read from Istream, discarding existing contents.
tmp< DynamicField< T, SizeMin > > clone() const
Clone.
T remove()
Remove and return the top element.
static constexpr label min_size() noexcept
Normal lower capacity limit - the SizeMin template parameter.
void setCapacity_unsafe(const label len) noexcept
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void reserve(const label len)
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
void resize_nocopy(const label len)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
DynamicField< T, SizeMin > & append(const T &val)
Append an element at the end of the list.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
std::streamsize capacity_bytes() const noexcept
Number of contiguous bytes of the underlying storage.