46 <<
"bad size " << this->size_
52 this->v_ =
new T[this->size_];
65 <<
"bad size " << this->size_
71 this->v_ =
new T[this->size_];
89 <<
"bad size " << this->size_
95 this->v_ =
new T[this->size_];
112 this->v_ =
new T[this->size_];
117 memcpy(this->v_, a.v_, this->
byteSize());
150 else if (this->size_)
152 this->v_ =
new T[this->size_];
157 memcpy(this->v_, a.v_, this->
byteSize());
181 this->v_ =
new T[this->size_];
185 this->v_[i] = a[map[i]];
192 template<
unsigned Size>
199 this->v_ =
new T[this->size_];
216 this->v_ =
new T[this->size_];
233 this->v_ =
new T[this->size_];
256 this->v_ =
new T[this->size_];
273 this->v_ =
new T[this->size_];
288 if (this->v_)
delete[] this->v_;
300 <<
"bad set size " << newSize
304 if (newSize != this->size_)
312 label i =
min(this->size_, newSize);
317 memcpy(nv, this->v_, i*
sizeof(
T));
322 T* vv = &this->v_[i];
324 while (i--) *--av = *--vv;
327 if (this->v_)
delete[] this->v_;
329 this->size_ = newSize;
346 if (newSize > oldSize)
348 label i = newSize - oldSize;
349 T* vv = &this->v_[newSize];
350 while (i--) *--vv = a;
358 if (this->v_)
delete[] this->v_;
367 if (this->v_)
delete[] this->v_;
368 this->size_ = a.size_;
377 template<
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
401 if (a.size_ != this->size_)
403 if (this->v_)
delete[] this->v_;
405 this->size_ = a.size_;
406 if (this->size_) this->v_ =
new T[this->size_];
414 memcpy(this->v_, a.v_, this->byteSize());
435 <<
"attempted assignment to self" 446 if (lst.
size() != this->size_)
448 if (this->v_)
delete[] this->v_;
450 this->size_ = lst.
size();
451 if (this->size_) this->v_ =
new T[this->size_];
473 if (lst.
size() != this->size_)
475 if (this->v_)
delete[] this->v_;
477 this->size_ = lst.
size();
478 if (this->size_) this->v_ =
new T[this->size_];
491 if (lst.
size() != this->size_)
493 if (this->v_)
delete[] this->v_;
495 this->size_ = lst.
size();
496 if (this->size_) this->v_ =
new T[this->size_];
A simple container for copying or transferring objects of type <T>.
#define List_CONST_ACCESS(type, f, fp)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A 1D vector of objects of type <T> with a fixed size <Size>.
T & operator[](const label)
Return element of UList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< T > & shrink()
Clear the indices and return a reference to the underlying List.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A list that is sorted upon construction or when explicitly requested with the sort() method...
Template function to specify if the data of a type are contiguous.
An STL-conforming const_iterator.
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
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))
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
label size() const
Return number of elements in list.
void clear()
Clear the list, i.e. set size to zero.
label size() const
Return the number of elements in the list.
Non-intrusive singly-linked list.
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
List<T> is a 1D vector of objects of type T, where the size of the vector is known and used for subsc...
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
#define List_ELEM(f, fp, i)
#define List_ACCESS(type, f, fp)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
label size() const
Return the number of elements in the UList.
#define List_FOR_ALL(f, i)
Indexes into negList (negative index) or posList (zero or positive index).
void operator=(const UList< T > &)
Assignment from UList operator. Takes linear time.
void setSize(const label)
Reset size of List.
label size() const
Return the number of elements in the list.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A List with indirect addressing.
void clearStorage()
Clear the list and delete storage.
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
void transfer(List< T > &)
Transfer the contents of the argument List into this list.