|
vecmem 1.22.0
|
A data wrapper for jagged vectors. More...
#include <vecmem/containers/data/jagged_vector_data.hpp>
Public Types | |
| using | base_type = jagged_vector_view< T > |
| Type of the base class. | |
| using | size_type = typename base_type::size_type |
Use the base class's size_type. | |
| using | value_type = typename base_type::value_type |
Use the base class's value_type. | |
| using | pointer = std::add_pointer_t< value_type > |
| Pointer type to the jagged array. | |
Public Member Functions | |
| jagged_vector_data () | |
| Default constructor. | |
| jagged_vector_data (size_type size, memory_resource &mem) | |
| Construct jagged vector data from raw information. | |
| jagged_vector_data (jagged_vector_data &&) noexcept=default | |
| Move constructor. | |
| jagged_vector_data & | operator= (jagged_vector_data &&) noexcept=default |
| Move assignment. | |
| template<typename OTHERTYPE , std::enable_if_t< std::is_same< std::remove_cv_t< T >, std::remove_cv_t< OTHERTYPE > >::value, bool > = true> | |
| VECMEM_HOST_AND_DEVICE bool | operator== (const jagged_vector_view< OTHERTYPE > &rhs) const |
| Equality check. | |
| template<typename OTHERTYPE , std::enable_if_t< std::is_same< std::remove_cv_t< T >, std::remove_cv_t< OTHERTYPE > >::value, bool > = true> | |
| VECMEM_HOST_AND_DEVICE bool | operator!= (const jagged_vector_view< OTHERTYPE > &rhs) const |
Inequality check. Simply based on operator==. | |
| VECMEM_HOST_AND_DEVICE size_type | size () const |
| Get the "outer" size of the jagged vector. | |
| VECMEM_HOST_AND_DEVICE size_type | capacity () const |
| Get the maximum capacity of the "outer" vector. | |
| VECMEM_HOST_AND_DEVICE pointer | ptr () const |
| Get a pointer to the vector elements. | |
| VECMEM_HOST_AND_DEVICE pointer | host_ptr () const |
| Access the host accessible array describing the inner vectors. | |
A data wrapper for jagged vectors.
This class constructs the relevant administrative data from a vector of vectors, and is designed to be later turned into a jagged_vector_view object.
| vecmem::data::jagged_vector_data< T >::jagged_vector_data | ( | ) |
Default constructor.
A custom implementation for the default constructor is necessary because vecmem::data::jagged_vector_view does not set its members to anything explicitly in its default constructor.
(In order to be trivially default constructible.) So here we need to be explicit.
| vecmem::data::jagged_vector_data< T >::jagged_vector_data | ( | size_type | size, |
| memory_resource & | mem | ||
| ) |
Construct jagged vector data from raw information.
This class converts from std vectors (or rather, vecmem::vectors) to a jagged vector data.
| [in] | size | Size of the "outer vector" |
| [in] | mem | The memory resource to manage the internal state |
|
inherited |
Access the host accessible array describing the inner vectors.
This may or may not return the same pointer as ptr(). If the underlying data is stored in host-accessible memory, then the two will be the same.
If not, then ptr() will return the device accessible array, and this function returns a host-accessible one.
|
inherited |
Equality check.
Two objects are only equal if they point at the same memory.