A QuickVec behaves like a std::vector, but does no initialization of its data, making it faster at the cost of having to ensure that uninitialized data is not read.
More...
#include <artdaq-core/Core/QuickVec.hh>
|
typedef TT_ * | iterator |
| Iterator is pointer-to-member type.
|
|
typedef const TT_ * | const_iterator |
| const_iterator is const-pointer-to-member type
|
|
typedef TT_ & | reference |
| reference is reference-to-member tpye
|
|
typedef const TT_ & | const_reference |
| const_reference is const-reference-to-member type
|
|
typedef TT_ | value_type |
| value_type is member type
|
|
typedef ptrdiff_t | difference_type |
| difference_type is ptrdiff_t
|
|
typedef size_t | size_type |
| size_type is size_t
|
|
|
| QuickVec (size_t sz) |
| Allocates a QuickVec object, doing no initialization of allocated memory. More...
|
|
| QuickVec (size_t sz, TT_ val) |
| Allocates a QuickVec object, initializing each element to the given value. More...
|
|
virtual | ~QuickVec () noexcept |
| Destructor calls free on data. QuickVec compiled in non-unique_ptr mode.
|
|
| QuickVec (std::vector< TT_ > &other) |
| Copies the contents of a std::vector into a new QuickVec object. More...
|
|
void | clear () |
| Sets the size to 0. QuickVec does not reinitialize memory, so no further action will be taken.
|
|
| QuickVec (const QuickVec &other) |
| Copy Constructor. More...
|
|
QuickVec< TT_ > & | operator= (const QuickVec &other) |
| Copy assignment operator. More...
|
|
TT_ & | operator[] (int idx) |
| Returns a reference to a given element. More...
|
|
const TT_ & | operator[] (int idx) const |
| Returns a const reference to a given element. More...
|
|
size_t | size () const |
| Accesses the current size of the QuickVec. More...
|
|
size_t | capacity () const |
| Accesses the current capacity of the QuickVec. More...
|
|
iterator | begin () |
| Gets an iterator to the beginning of the QuickVec. More...
|
|
const_iterator | begin () const |
| Gets a const_iterator to the beginning of the QuickVec. More...
|
|
iterator | end () |
| Gets an iterator to the end of the QuickVec. More...
|
|
const_iterator | end () const |
| Gets a const_iterator to the end of the QuickVec. More...
|
|
void | reserve (size_t size) |
| Allocates memory for the QuickVec so that its capacity is at least size. More...
|
|
void | resize (size_t size) |
| Resizes the QuickVec. More...
|
|
void | resize (size_t size, TT_ val) |
| Resizes the QuickVec, initializes new elements with val. More...
|
|
iterator | insert (const_iterator position, size_t nn, const TT_ &val) |
| Inserts an element into the QuickVec. More...
|
|
iterator | insert (const_iterator position, const_iterator first, const_iterator last) |
| Inserts a range of elements into the QuickVec. More...
|
|
iterator | erase (const_iterator first, const_iterator last) |
| Erases elements in given range from the QuickVec. More...
|
|
void | swap (QuickVec &other) noexcept |
| Exchanges references to two QuickVec objects. More...
|
|
void | push_back (const value_type &val) |
| Adds a value to the QuickVec, resizing if necessary (adds 10% capacity) More...
|
|
template<typename TT_>
struct artdaq::QuickVec< TT_ >
A QuickVec behaves like a std::vector, but does no initialization of its data, making it faster at the cost of having to ensure that uninitialized data is not read.
- Template Parameters
-
Definition at line 87 of file QuickVec.hh.
Allocates a QuickVec object, doing no initialization of allocated memory.
- Parameters
-
Definition at line 350 of file QuickVec.hh.
Allocates a QuickVec object, initializing each element to the given value.
- Parameters
-
sz | Size of QuickVec object to allocate |
val | Value with which to initialize elements |
Definition at line 360 of file QuickVec.hh.
Copies the contents of a std::vector into a new QuickVec object.
- Parameters
-
Definition at line 124 of file QuickVec.hh.
Copy Constructor.
- Parameters
-
Definition at line 142 of file QuickVec.hh.
Gets a const_iterator to the beginning of the QuickVec.
- Returns
- A const_iterator to the beginning of the QuickVec
Definition at line 407 of file QuickVec.hh.
Accesses the current capacity of the QuickVec.
- Returns
- The current capacity of the QuickVec
Accesses the current capcity of the QuickVec. Like a vector, the capacity of a QuickVec object is defined as the maximum size it can hold before it must reallocate more memory.
Definition at line 401 of file QuickVec.hh.
Returns the current version of the template code \ *.
\ *
- Returns
- The current version of the QuickVec \ * \ * Class_Version() MUST be updated every time private member data change. \
Definition at line 334 of file QuickVec.hh.
Erases elements in given range from the QuickVec.
- Parameters
-
first | First element to erase |
last | Last element to erase |
- Returns
- iterator to first element after erase range
Erases elements in given range from the QuickVec. Note that since the underlying data structure resembles a std::vector, erase operations are very inefficient! (O(n))
Definition at line 518 of file QuickVec.hh.
Inserts an element into the QuickVec.
- Parameters
-
position | Position at which to isnert |
nn | Number of copies of val to insert |
val | Value to insert |
- Returns
- Iterator to first inserted element
Inserts an element (or copies thereof) into the QuickVec. Note that since the underlying data structure resembles a std::vector, insert operations are very inefficient!
Definition at line 477 of file QuickVec.hh.
Inserts a range of elements into the QuickVec.
- Parameters
-
position | Position at which to insert |
first | const_iterator to first element to insert |
last | const_iterator to last element to insert |
- Returns
- Iterator to first inserted element
Inserts elements into the QuickVec. Note that since the underlying data structure resembles a std::vector, insert operations are very inefficient!
Definition at line 497 of file QuickVec.hh.
Copy assignment operator.
- Parameters
-
- Returns
- Reference to new QuickVec object
Definition at line 157 of file QuickVec.hh.
Returns a reference to a given element.
- Parameters
-
- Returns
- Reference to element
Definition at line 384 of file QuickVec.hh.
Returns a const reference to a given element.
- Parameters
-
- Returns
- const reference to element
Definition at line 391 of file QuickVec.hh.
Adds a value to the QuickVec, resizing if necessary (adds 10% capacity)
- Parameters
-
Definition at line 547 of file QuickVec.hh.
Allocates memory for the QuickVec so that its capacity is at least size.
- Parameters
-
Allocates memory for the QuickVec so that its capacity is at least size. If the QuickVec is already at or above size in capacity, no allocation is performed.
Definition at line 416 of file QuickVec.hh.
Resizes the QuickVec.
- Parameters
-
If size is smaller than the current size of the QuickVec, then it will change its size_ parameter (no reallocation, capacity does not change). If size is greater than the capacity of the QuickVec, a reallocation will occur.
Definition at line 441 of file QuickVec.hh.
Resizes the QuickVec, initializes new elements with val.
- Parameters
-
size | New size of the QuickVec |
val | Value with which to initialize elements |
Definition at line 468 of file QuickVec.hh.
The documentation for this struct was generated from the following file: