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); }
136 return NullObjectRef<List<T>>();
146 explicit
List(const label len);
149 List(const label len, const
T& val);
191 List(
std::initializer_list<
T> list);
197 template<
int SizeMin>
220 inline
void resize(const label len);
223 void resize(const label len, const
T& val);
256 template<
int SizeMin>
257 void transfer(DynamicList<T, SizeMin>& list);
269 template<
class... Args>
282 inline void push_back(
const UList<T>& list);
287 inline void push_back(
const IndirectListBase<T, Addr>& list);
307 void operator=(
const IndirectListBase<T, Addr>& list);
311 void operator=(
const FixedList<T, N>& list);
314 void operator=(std::initializer_list<T> list);
326 template<
int SizeMin>
358 template<
class TypeT = T>
359 typename std::enable_if<std::is_same<bool, TypeT>::value,
bool>
::type 360 inline set(
const label i,
bool val =
true)
366 else if (i >= this->
size())
401 void append(
const IndirectListBase<T, Addr>& list)
412 explicit List(
const SLList<T>& list);
423 struct Hash<List<
T>> : List<T>::hasher {};
430 Istream&
operator>>(Istream& is, List<T>& list)
432 return list.readList(is);
452 template<
class T,
class ListComparePredicate>
455 const UList<T>&
input,
457 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.
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.
static const List< T > & null() noexcept
Return a null List (reference to a nullObject). Behaves like an empty List.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...