38#ifndef Foam_DynamicField_H
39#define Foam_DynamicField_H
50template<
class T,
int SizeMin>
class DynamicField;
52template<
class T,
int SizeMin>
55template<
class T,
int SizeMin>
62template<
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>
215 inline
void reserve(const label len);
228 inline
void resize(const label len);
231 inline
void resize(const label len, const
T& val);
267 template<
int AnySizeMin>
271 template<
int AnySizeMin>
278 template<
int AnySizeMin>
282 template<
int AnySizeMin>
286 inline
void append(const
T& val);
326 template<
int AnySizeMin>
333 template<
int AnySizeMin>
361#include "DynamicFieldI.H"
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
T remove()
Remove and return the top element.
void swap(DynamicField< T, AnySizeMin > &other)
Swap content, independent of sizing parameter.
void transfer(List< T > &list)
Transfer the parameter contents into this.
void setSize(const label n)
Alias for resize()
void resize_nocopy(const label len)
void setCapacity_nocopy(const label len)
void reserve_nocopy(const label len)
void setCapacity_unsafe(const label len) noexcept
std::streamsize capacity_bytes() const noexcept
Number of contiguous bytes of the underlying storage.
void append(const T &val)
Append an element at the end of the list.
void clearStorage()
Clear the list and delete storage.
static const DynamicField< T, SizeMin > & null()
Return a null field.
label capacity() const noexcept
Size of the underlying storage.
void setSize(const label n, const T &val)
Alias for resize()
void shrinkStorage()
Shrink the allocated space to the number of elements used.
tmp< DynamicField< T, SizeMin > > clone() const
Clone.
label expandStorage() noexcept
Expand the addressable size to fit the allocated capacity.
constexpr DynamicField() noexcept
Default construct, an empty field without allocation.
static constexpr label min_size() noexcept
Normal lower capacity limit - the SizeMin template parameter.
DynamicField< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
void resize(const label len)
void reserve(const label len)
void setCapacity(const label len)
Alter the size of the underlying storage.
Istream & readList(Istream &is)
Read from Istream, discarding existing contents.
friend Ostream & operator(Ostream &os, const DynamicField< T, SizeMin > &rhs)
Write to Ostream.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Abstract base class to hold the Field mapping addressing and weights.
Generic templated field type.
tmp< Field< T > > T() const
Return the field transpose (only defined for second rank tensors)
void map(const UList< T > &mapF, const labelUList &mapAddressing)
1 to 1 map from the given field
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
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...
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...
A class for managing temporary objects.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Istream & operator>>(Istream &, directionInfo &)