|
CbmRoot
|
A vector that is partitioned into multiple subvectors. More...
#include <PartitionedVector.h>
Public Types | |
| using | Container_t = std::vector<T, Allocator> |
Public Member Functions | |
| PartitionedVector () | |
| Default constructor. Creates an empty vector. | |
| PartitionedVector (Container_t &&data, gsl::span< const size_t > sizes, gsl::span< const uint32_t > addresses) | |
| Constructor. Creates a vector with n partitions. | |
| template<typename OtherAllocator> | |
| PartitionedVector (const PartitionedVector< T, OtherAllocator > &other) | |
| Copy constructor. Copy the data from other vector. | |
| PartitionedVector (const PartitionedVector< T, Allocator > &other) | |
| Copy constructor for a given type (to satisfy the rule of five) | |
| PartitionedVector (PartitionedVector< T, Allocator > &&other) | |
| Move constructor. | |
| template<typename U> | |
| PartitionedVector (PartitionedSpan< U > other) | |
| PartitionedVector & | operator= (const PartitionedVector< T, Allocator > &other) |
| Copy assignment operator. | |
| PartitionedVector & | operator= (PartitionedVector< T, Allocator > &&other) |
| Move assignment operator. | |
| gsl::span< T > | operator[] (size_t i) |
| Access data at partition i. | |
| gsl::span< const T > | operator[] (size_t i) const |
| Access data at partition i. | |
| uint32_t | Address (size_t i) const |
| Get the hardware address of partition i. | |
| void | Clear () |
| Clears the vector. | |
| std::pair< gsl::span< T >, uint32_t > | Partition (size_t i) |
| Get a pair of the data and the hardware address of partition i. | |
| std::pair< gsl::span< const T >, uint32_t > | Partition (size_t i) const |
| Get a pair of the data and the hardware address of partition i. | |
| size_t | NPartitions () const |
| Get the number of partitions. | |
| size_t | Size (size_t i) const |
| Get the size of partition i. | |
| size_t | NElements () const |
| Get the total number of elements in the container across all partitions. | |
| size_t | SizeBytes () const |
| Return total size in bytes of the underlying data. | |
| gsl::span< T > | Data () |
| Get the underlying data. | |
| gsl::span< const T > | Data () const |
| Get the underlying data. | |
| const std::vector< uint32_t > & | Addresses () const |
| Get the addresses. | |
| const std::vector< size_t > & | Offsets () const |
| Get the underlying offsets. | |
Private Member Functions | |
| void | EnsureDimensions () const |
| void | EnsureBounds (size_t i) const |
| void | ComputeOffsets (gsl::span< const size_t > sizes) |
| size_t | UnsafeSize (size_t i) const |
| gsl::span< T > | UnsafePartitionSpan (size_t i) |
| gsl::span< const T > | UnsafePartitionSpan (size_t i) const |
| template<class Archive> | |
| void | serialize (Archive &ar, unsigned int) |
Private Attributes | |
| Container_t | fData |
| Data. | |
| std::vector< size_t > | fOffsets |
| Offsets of the partitions in fData. | |
| std::vector< uint32_t > | fAddresses |
| Addresses of the partitions. | |
Friends | |
| class | boost::serialization::access |
A vector that is partitioned into multiple subvectors.
| T | Type of the elements |
| Allocator | Allocator for the underlying container |
Definition at line 29 of file PartitionedVector.h.
| using cbm::PartitionedVector< T, Allocator >::Container_t = std::vector<T, Allocator> |
Definition at line 32 of file PartitionedVector.h.
|
inline |
Default constructor. Creates an empty vector.
Definition at line 37 of file PartitionedVector.h.
|
inline |
Constructor. Creates a vector with n partitions.
| data | Underlying data. Assusmes that the data is already partitioned and takes ownership of it. |
| sizes | Sizes of each partitions |
| addresses | Hardware addresses of each partition |
Definition at line 48 of file PartitionedVector.h.
|
inline |
Copy constructor. Copy the data from other vector.
Definition at line 61 of file PartitionedVector.h.
|
inline |
Copy constructor for a given type (to satisfy the rule of five)
Definition at line 74 of file PartitionedVector.h.
|
inline |
Move constructor.
Definition at line 85 of file PartitionedVector.h.
|
inline |
Definition at line 95 of file PartitionedVector.h.
|
inline |
Get the hardware address of partition i.
Definition at line 151 of file PartitionedVector.h.
|
inline |
Get the addresses.
Definition at line 223 of file PartitionedVector.h.
|
inline |
Clears the vector.
Definition at line 160 of file PartitionedVector.h.
|
inlineprivate |
Definition at line 254 of file PartitionedVector.h.
|
inline |
Get the underlying data.
Definition at line 213 of file PartitionedVector.h.
|
inline |
Get the underlying data.
Definition at line 218 of file PartitionedVector.h.
|
inlineprivate |
Definition at line 249 of file PartitionedVector.h.
|
inlineprivate |
Definition at line 236 of file PartitionedVector.h.
|
inline |
Get the total number of elements in the container across all partitions.
Definition at line 203 of file PartitionedVector.h.
|
inline |
Get the number of partitions.
Definition at line 189 of file PartitionedVector.h.
|
inline |
Get the underlying offsets.
Definition at line 228 of file PartitionedVector.h.
|
inline |
Copy assignment operator.
Definition at line 106 of file PartitionedVector.h.
|
inline |
Move assignment operator.
Definition at line 119 of file PartitionedVector.h.
|
inline |
Access data at partition i.
Definition at line 133 of file PartitionedVector.h.
|
inline |
Access data at partition i.
Definition at line 142 of file PartitionedVector.h.
|
inline |
Get a pair of the data and the hardware address of partition i.
Definition at line 171 of file PartitionedVector.h.
|
inline |
Get a pair of the data and the hardware address of partition i.
Definition at line 180 of file PartitionedVector.h.
|
inlineprivate |
Definition at line 276 of file PartitionedVector.h.
|
inline |
Get the size of partition i.
Definition at line 194 of file PartitionedVector.h.
|
inline |
Return total size in bytes of the underlying data.
Definition at line 208 of file PartitionedVector.h.
|
inlineprivate |
Definition at line 265 of file PartitionedVector.h.
|
inlineprivate |
Definition at line 267 of file PartitionedVector.h.
|
inlineprivate |
Definition at line 263 of file PartitionedVector.h.
|
friend |
Definition at line 273 of file PartitionedVector.h.
|
private |
Addresses of the partitions.
Definition at line 234 of file PartitionedVector.h.
|
private |
Data.
Definition at line 232 of file PartitionedVector.h.
|
private |
Offsets of the partitions in fData.
Definition at line 233 of file PartitionedVector.h.