Go to the documentation of this file.
50 <<
"bad size " << this->size_
56 this->v_ =
new T[this->size_];
70 <<
"bad size " << this->size_
76 this->v_ =
new T[this->size_];
94 this->v_ =
new T[this->size_];
99 memcpy(this->v_, a.v_, this->byteSize());
134 else if (this->size_)
136 this->v_ =
new T[this->size_];
141 memcpy(this->v_, a.v_, this->byteSize());
160 UList<
T>(NULL, map.size())
166 this->v_ =
new T[this->size_];
170 this->v_[i] = a[map[i]];
178 template<
class InputIterator>
184 InputIterator iter = first;
198 InputIterator iter = first;
203 this->operator[](
s++) = *iter;
210 template<
unsigned Size>
217 this->v_ =
new T[this->size_];
221 this->operator[](i) = lst[i];
231 UList<
T>(NULL, lst.size())
235 this->v_ =
new T[this->size_];
239 this->operator[](i) = lst[i];
249 UList<
T>(NULL, lst.size())
253 this->v_ =
new T[this->size_];
263 this->operator[](i++) = iter();
273 UList<
T>(NULL, lst.size())
277 this->v_ =
new T[this->size_];
281 this->operator[](i) = lst[i];
291 UList<
T>(NULL, lst.size())
295 this->v_ =
new T[this->size_];
299 this->operator[](i) = lst[i];
311 if (this->v_)
delete[] this->v_;
323 <<
"bad set size " << newSize
327 if (newSize != this->size_)
335 label i =
min(this->size_, newSize);
340 memcpy(nv, this->v_, i*
sizeof(
T));
345 T* vv = &this->v_[i];
347 while (i--) *--av = *--vv;
350 if (this->v_)
delete[] this->v_;
352 this->size_ = newSize;
369 if (newSize > oldSize)
371 label i = newSize - oldSize;
372 T* vv = &this->v_[newSize];
373 while (i--) *--vv = a;
381 if (this->v_)
delete[] this->v_;
392 if (this->v_)
delete[] this->v_;
393 this->size_ = a.size_;
404 template<
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
409 transfer(
static_cast<List<T>&
>(a));
421 transfer(
static_cast<List<T>&
>(a));
431 if (a.
size_ != this->size_)
433 if (this->v_)
delete[] this->v_;
435 this->size_ = a.
size_;
436 if (this->size_) this->v_ =
new T[this->size_];
444 memcpy(this->v_, a.
v_, this->byteSize());
466 <<
"attempted assignment to self"
470 operator=(
static_cast<const UList<T>&
>(a));
478 if (lst.size() != this->size_)
480 if (this->v_)
delete[] this->v_;
482 this->size_ = lst.size();
483 if (this->size_) this->v_ =
new T[this->size_];
491 typename SLList<T>::const_iterator iter = lst.begin();
496 this->operator[](i++) = iter();
506 if (lst.size() != this->size_)
508 if (this->v_)
delete[] this->v_;
510 this->size_ = lst.size();
511 if (this->size_) this->v_ =
new T[this->size_];
516 this->operator[](i) = lst[i];
525 if (lst.size() != this->size_)
527 if (this->v_)
delete[] this->v_;
529 this->size_ = lst.size();
530 if (this->size_) this->v_ =
new T[this->size_];
535 this->operator[](i) = lst[i];
points setSize(newPointi)
Non-intrusive singly-linked list.
#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.
#define List_FOR_ALL(f, i)
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
T *__restrict__ v_
Vector of values of type T.
void operator=(const UList< T > &)
Assignment from UList operator. Takes linear time.
A simple container for copying or transferring objects of type <T>.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Indexes into negList (negative index) or posList (zero or positive index).
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
#define List_ELEM(f, fp, i)
List< T > & shrink()
Clear the indices and return a reference to the underlying List.
A list that is sorted upon construction or when explicitly requested with the sort() method.
errorManip< error > abort(error &err)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label size_
Number of elements in UList.
void setSize(const label)
Reset size of List.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define List_CONST_ACCESS(type, f, fp)
Template function to specify if the data of a type are contiguous.
A 1D vector of objects of type <T> with a fixed size <Size>.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void clear()
Clear the list, i.e. set size to zero.
void clearStorage()
Clear the list and delete storage.
#define List_ACCESS(type, f, fp)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
List<T> is a 1D vector of objects of type T, where the size of the vector is known and used for subsc...