Skip to content

Commit

Permalink
Merge pull request #13562 from Martin-Grunewald/BXVectorView
Browse files Browse the repository at this point in the history
Implement edm::View support for BXVector
  • Loading branch information
cmsbuild committed Mar 3, 2016
2 parents bdd4dc4 + 106cf28 commit e63bd64
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions DataFormats/L1Trigger/interface/BXVector.h
Expand Up @@ -5,6 +5,8 @@
// designed to store objects corresponding to several time-samples (BX)
// the time sample is addressed by an integer index, eg. -1 to 1

#include "DataFormats/Common/interface/FillView.h"
#include "DataFormats/Common/interface/traits.h"
#include <vector>

template < class T >
Expand Down Expand Up @@ -103,6 +105,10 @@ class BXVector {
T& operator[](std::size_t i) { return data_[i]; }
const T& operator[](std::size_t i) const { return data_[i]; }

// edm::View
void fillView(edm::ProductID const& id,
std::vector<void const*>& pointers,
edm::FillViewHelperVector& helpers) const;

private:

Expand Down
25 changes: 25 additions & 0 deletions DataFormats/L1Trigger/interface/BXVector.impl
Expand Up @@ -257,6 +257,31 @@ if (itrs_[indexFromBX(bx)]==itrs_[indexFromBX(bx+1)])
return false;
}

// edm::View
template <class T>
void BXVector<T>::fillView(edm::ProductID const& id,
std::vector<void const*>& pointers,
edm::FillViewHelperVector& helpers) const {
edm::detail::reallyFillView(*this,id,pointers,helpers);
}
//
namespace edm {
template <class T>
inline
void
fillView(BXVector<T> const& obj,
edm::ProductID const& id,
std::vector<void const*>& pointers,
edm::FillViewHelperVector& helpers) {
obj.fillView(id, pointers, helpers);
}
template <class T>
struct has_fillView<BXVector<T> >
{
static bool const value = true;
};
}

// Local Variables:
// mode: c++
// End:

0 comments on commit e63bd64

Please sign in to comment.