Go to the documentation of this file.
39 const bool showSize =
false
45 Info<<
" size=\"" << lst.
size() <<
"\"";
47 Info<<
">" << lst <<
"</" << tag <<
">" <<
endl;
51 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
56 const bool showSize =
false
62 Info<<
" size=\"" << lst.size()
63 <<
"\" capacity=\"" << lst.
capacity() <<
"\"";
65 Info<<
">" << lst <<
"</" << tag <<
">" <<
endl;
72 int main(
int argc,
char *argv[])
81 ldl[0].setCapacity(5);
82 ldl[1].setCapacity(10);
92 Info<<
"<ldl>" << ldl <<
"</ldl>" <<
nl <<
"sizes: ";
95 Info<<
" " << ldl[i].size() <<
"/" << ldl[i].capacity();
103 Info<<
"<ldl>" << ldl <<
"</ldl>" <<
nl <<
"sizes: ";
106 Info<<
" " << ldl[i].size() <<
"/" << ldl[i].capacity();
117 for (
label i = 0; i < 5; i++)
123 Info<<
"<dlA>" << dlA <<
"</dlA>" <<
nl <<
"sizes: "
132 Info<<
"Transferred to dlB" <<
endl;
133 Info<<
"<dlA>" << dlA <<
"</dlA>" <<
nl <<
"sizes: "
135 Info<<
"<dlB>" << dlB <<
"</dlB>" <<
nl <<
"sizes: "
141 Info<<
"Transferred to normal list" <<
endl;
146 for (
label i=0; i < 3; i++)
151 Info<<
"appended list a few times" <<
endl;
160 for (
label i=0; i < 3; i++)
178 Info<<
"Transferred to normal list via the xfer() method" <<
endl;
184 Info<<
"Transfer construct from normal list" <<
endl;
194 for (
label elemI=0; elemI < 5; ++elemI)
232 Info<<
"use UIndirectList " << uil <<
" remapped from " << dlE2 <<
endl;
Xfer< List< T > > xfer()
Transfer contents to the Xfer container as a plain List.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
A class for handling words, derived from string.
ListType reorder(const labelUList &oldToNew, const ListType &)
Reorder the elements (indices, not values) of a list.
label capacity() const
Size of the underlying storage.
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void setCapacity(const label)
Alter the size of the underlying storage.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
int main(int argc, char *argv[])
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &)
Transfer contents of the argument List into this.
void reserve(const label)
Reserve allocation space for at least this size.
A List with indirect addressing.
Various functions to operate on Lists.
label size() const
Return the number of elements in the UList.
void printInfo(const word &tag, const UList< T > &lst, const bool showSize=false)