vecmem 1.14.0
Loading...
Searching...
No Matches
view_traits.hpp
1/* VecMem project, part of the ACTS project (R&D line)
2 *
3 * (c) 2023 CERN for the benefit of the ACTS project
4 *
5 * Mozilla Public License Version 2.0
6 */
7#pragma once
8
9// Local include(s).
10#include "vecmem/containers/data/jagged_vector_view.hpp"
11#include "vecmem/containers/data/vector_view.hpp"
12#include "vecmem/edm/schema.hpp"
13
14// System include(s).
15#include <type_traits>
16
17namespace vecmem {
18namespace edm {
19namespace details {
20
23
24template <typename TYPE>
26 using payload_type = TYPE;
27 using payload_ptr = std::add_pointer_t<payload_type>;
28 using size_type = unsigned int;
29 using size_ptr = std::add_pointer_t<size_type>;
30}; // struct view_type_base
31
32template <typename TYPE>
33struct view_type : public view_type_base<TYPE> {};
34
35template <typename TYPE>
36struct view_type<type::scalar<TYPE> > : public view_type_base<TYPE> {
37 using layout_type = int;
38 using layout_ptr = std::add_pointer_t<layout_type>;
39 using type = typename view_type_base<TYPE>::payload_ptr;
40}; // struct view_type
41
42template <typename TYPE>
43struct view_type<type::vector<TYPE> > : public view_type_base<TYPE> {
44 using layout_type = int;
45 using layout_ptr = std::add_pointer_t<layout_type>;
47}; // struct view_type
48
49template <typename TYPE>
50struct view_type<type::jagged_vector<TYPE> > : public view_type_base<TYPE> {
52 using layout_ptr = std::add_pointer_t<layout_type>;
54}; // struct view_type
55
57
58} // namespace details
59} // namespace edm
60} // namespace vecmem
Class holding data about a 1 dimensional vector/array.
Definition vector_view.hpp:38
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
vector< vector< T > > jagged_vector
Alias type for jagged vectors with our polymorphic allocator.
Definition jagged_vector.hpp:30
std::vector< T, vecmem::polymorphic_allocator< T > > vector
Alias type for vectors with our polymorphic allocator.
Definition vector.hpp:35
Definition view_traits.hpp:25
Definition view_traits.hpp:33