38 #ifndef Foam_DynamicField_H 39 #define Foam_DynamicField_H 52 template<
class T,
int SizeMin>
55 template<
class T,
int SizeMin>
56 inline Ostream& operator<<(Ostream&, const DynamicField<T, 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>
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>
272 inline
void swap(DynamicList<
T, AnySizeMin>& other);
278 template<
int AnySizeMin>
279 inline
void transfer(DynamicList<
T, AnySizeMin>& list);
282 template<
int AnySizeMin>
305 inline Istream&
readList(Istream& is);
329 template<
int AnySizeMin>
336 template<
int AnySizeMin>
void setCapacity(const label len)
Alter the size of the underlying storage.
void swap(DynamicField< T, AnySizeMin > &other)
Swap content, independent of sizing parameter.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
DynamicField< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
void push_back(const T &val)
Append an element at the end of the list.
constexpr DynamicField() noexcept
Default construct, an empty field without allocation.
Base for lists with indirect addressing, templated on the list contents type and the addressing type...
Istream & readList(Istream &is)
Read from Istream, discarding existing contents.
void transfer(List< T > &list)
Transfer the parameter contents into this.
void reserve_nocopy(const label len)
Reserve allocation space for at least this size, allocating new space if required without retaining o...
void resize_nocopy(const label len)
Alter addressable list size, allocating new space if required without necessarily recovering old cont...
tmp< DynamicField< T, SizeMin > > clone() const
Clone.
void setCapacity_unsafe(const label len) noexcept
Change the value for the list capacity directly (ADVANCED, UNSAFE) Does not perform any memory manage...
void resize(const label len)
Alter addressable list size, allocating new space if required while recovering old content...
label expandStorage() noexcept
Expand the addressable size to fit the allocated capacity.
Abstract base class to hold the Field mapping addressing and weights.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Generic templated field type.
Istream & operator>>(Istream &, directionInfo &)
void pop_back(label n=1)
Reduce size by 1 or more elements. Can be called on an empty list.
void reserve(const label len)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void map(const UList< T > &mapF, const labelUList &mapAddressing)
1 to 1 map from the given field
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
static constexpr label min_size() noexcept
Normal lower capacity limit - the SizeMin template parameter.
static const DynamicField< T, SizeMin > & null()
Return a null field.
constexpr UList() noexcept
Default construct, zero-sized and nullptr.
void shrinkStorage()
Shrink the allocated space to the number of elements used.
void clearStorage()
Clear the list and delete storage.
void setCapacity_nocopy(const label len)
Alter the size of the underlying storage, without retaining old content.
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.
tmp< Field< T > > T() const
Return the field transpose (only defined for second rank tensors)
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
A class for managing temporary objects.
A non-counting (dummy) refCount.
T remove()
Remove and return the last element. Fatal on an empty list.
constexpr List() noexcept
Default construct.
void setSize(const label n)
Alias for resize()
label capacity() const noexcept
Size of the underlying storage.
friend Ostream & operator(Ostream &os, const DynamicField< T, SizeMin > &rhs)
Write to Ostream.