56 template<
class T>
class List;
57 template<
class T,
unsigned N>
class FixedList;
82 inline void doAlloc();
86 inline void reAlloc(
const label len);
89 template<
class ListType>
90 inline void copyList(
const ListType& list);
94 template<
class ListType,
class ListIndices>
95 inline void copyList(
const ListType& list,
const ListIndices& indices);
99 void doResize(
const label len);
103 template<
class InputIterator>
106 InputIterator firstIter,
107 InputIterator lastIter,
113 bool readBracketList(
Istream& is);
119 void setCapacity_nocopy(
const label len) {
resize_nocopy(len); }
142 explicit
List(const label len);
145 List(const label len, const
T& val);
187 List(
std::initializer_list<
T> list);
193 template<
int SizeMin>
216 inline
void resize(const label len);
219 void resize(const label len, const
T& val);
252 template<
int SizeMin>
253 void transfer(DynamicList<T, SizeMin>& list);
265 template<
class... Args>
278 inline void push_back(
const UList<T>& list);
283 inline void push_back(
const IndirectListBase<T, Addr>& list);
303 void operator=(
const IndirectListBase<T, Addr>& list);
307 void operator=(
const FixedList<T, N>& list);
310 void operator=(std::initializer_list<T> list);
322 template<
int SizeMin>
354 template<
class TypeT = T>
355 typename std::enable_if<std::is_same<bool, TypeT>::value,
bool>
::type 356 inline set(
const label i,
bool val =
true)
362 else if (i >= this->
size())
397 void append(
const IndirectListBase<T, Addr>& list)
408 explicit List(
const SLList<T>& list);
419 struct Hash<List<
T>> : List<T>::hasher {};
426 Istream&
operator>>(Istream& is, List<T>& list)
428 return list.readList(is);
448 template<
class T,
class ListComparePredicate>
451 const UList<T>&
input,
453 const ListComparePredicate& comp
void pop_back(label n=1)
Reduce size by 1 or more elements. Can be called on an empty list.
A 1D vector of objects of type <T> with a fixed length <N>.
void resize(const label len)
Adjust allocated size of list.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
void append(const T &val)
Append an element at the end of the list.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
friend class SubList< T >
Declare friendship with the SubList class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
label appendUniq(const T &val)
Same as push_uniq()
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
SubList< T > subList
Declare type of subList.
static const List< T > & null()
Return a null List.
void resize_fill(const label len, const T &val)
Adjust allocated size of list and set val for all elements.
void push_back(const T &val)
Append an element at the end of the list.
label push_uniq(const T &val)
Append an element if not already in the list.
Base for lists with indirect addressing, templated on the list contents type and the addressing type...
friend class List< T >
Declare friendship with the List class.
Forward declarations for SLList.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void setSize(const label n)
Alias for resize()
void shallowCopy(const UList< T > &)=delete
No shallowCopy permitted.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
void operator=(const UList< T > &list)
Assignment to UList operator. Takes linear time.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
void clear()
Clear the list, i.e. set size to zero.
Istream & operator>>(Istream &, directionInfo &)
static Istream & input(Istream &is, IntRange< T > &range)
#define FOAM_DEPRECATED_STRICT(since, replacement)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Istream & readList(Istream &is)
Read List from Istream, discarding contents of existing List.
label size() const noexcept
The number of elements in the container.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void resize_unsafe(const label len) noexcept
Change the addressed list size directly without affecting any memory management (advanced usage)...
const Vector< label > N(dict.get< Vector< label >>("N"))
T & emplace_back(Args &&... args)
Construct an element at the end of the list, return reference to the new list element.
T & newElmt(const label i)
Return subscript-checked element of UList and resizing the list if required.
List< char > charList
A List of chars.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
autoPtr< List< T > > clone() const
Clone.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
List< label > labelList
A List of labels.
Foam::argList args(argc, argv)
constexpr List() noexcept
Default construct.
List< bool > boolList
A List of bools.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...