14 #include <podio/Frame.h>
15 #include <podio/UserDataCollection.h>
17 namespace Acts::podio_detail {
24 virtual std::any
get(
size_t i)
const = 0;
26 virtual size_t size()
const = 0;
35 virtual std::any
get(
size_t i) = 0;
36 std::any
get(
size_t i)
const override = 0;
38 virtual void add() = 0;
39 virtual void clear() = 0;
40 virtual void erase(
size_t i) = 0;
44 virtual std::unique_ptr<DynamicColumnBase>
clone(
45 bool empty =
false)
const = 0;
53 podio::UserDataCollection<T> collection = {})
56 std::any
get(
size_t i)
override {
return &m_collection.vec().at(
i); }
58 std::any
get(
size_t i)
const override {
return &m_collection.vec().at(
i); }
60 void add()
override { m_collection.vec().emplace_back(); }
61 void clear()
override { m_collection.clear(); }
62 void erase(
size_t i)
override {
63 m_collection.vec().erase(m_collection.vec().begin() +
i);
65 size_t size()
const override {
return m_collection.size(); }
67 std::unique_ptr<DynamicColumnBase>
clone(
bool empty)
const override {
69 return std::make_unique<DynamicColumn<T>>(
m_name);
71 podio::UserDataCollection<T> copy;
72 copy.vec().reserve(m_collection.size());
73 for (
const T&
v : m_collection) {
80 size_t srcIdx)
override {
81 const auto* other =
dynamic_cast<const DynamicColumn<T>*
>(&src);
83 "Source column is not of same type as destination");
84 m_collection.vec().at(dstIdx) = other->m_collection.vec().at(srcIdx);
91 podio::UserDataCollection<T> m_collection;
97 const podio::UserDataCollection<T>& collection)
100 std::any
get(
size_t i)
const override {
return &m_collection.vec().at(i); }
101 size_t size()
const override {
return m_collection.size(); }
103 const podio::UserDataCollection<T>& m_collection;