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);
90 inline void copyList(
const List2& list);
94 void doResize(
const label len);
98 template<
class InputIterator>
101 InputIterator begIter,
102 InputIterator endIter,
127 explicit
List(const label len);
130 List(const label len, const
T& val);
175 List(
std::initializer_list<
T> list);
181 template<
int SizeMin>
207 inline
void resize(const label len);
210 void resize(const label len, const
T& val);
233 template<
int SizeMin>
234 void transfer(DynamicList<T, SizeMin>& list);
246 template<
class... Args>
259 inline void push_back(
const UList<T>& list);
264 inline void push_back(
const IndirectListBase<T, Addr>& list);
287 void operator=(
const IndirectListBase<T, Addr>& list);
306 template<
int SizeMin>
341 template<
class TypeT = T>
342 typename std::enable_if<std::is_same<bool, TypeT>::value,
bool>
::type 343 inline set(
const label i,
bool val =
true)
349 else if (i >= this->
size())
384 void append(
const IndirectListBase<T, Addr>& list)
404 struct Hash<List<
T>> : List<T>::hasher {};
411 Istream&
operator>>(Istream& is, List<T>& list)
413 return list.readList(is);
432 template<
class T,
class ListComparePredicate>
435 const UList<T>&
input,
437 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...
Template class for non-intrusive linked lists.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
label appendUniq(const T &val)
Append an element if not already in the list.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
SubList< T > subList
Declare type of subList.
void operator=(const UList< T > &a)
Assignment to UList operator. Takes linear time.
static const List< T > & null()
Return a null List.
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.
A List obtained as a section of another List.
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...
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
void clear()
Clear the list, i.e. set size to zero.
Istream & operator>>(Istream &, directionInfo &)
static Istream & input(Istream &is, IntRange< T > &range)
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 List.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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...