PandaRoot
PndInputContainerI.h
Go to the documentation of this file.
1 #ifndef PNDINPUTCONTAINERI_HH
2 #define PNDINPUTCONTAINERI_HH
3 
4 #include "PndContainerI.h"
5 
6 template <class T>
7 class PndInputContainerI : public PndContainerI<T> {
8 
9  public:
18  virtual ~PndInputContainerI(){};
19 
26  virtual T const *GetElement(Int_t t_index) const = 0;
27 
34  virtual T const *GetConstElementPtr(Int_t t_index) const { return this->GetElement(t_index); }
35 
41  std::vector<T const *> GetVector() const
42  {
43  std::vector<T const *> result{};
44  result.reserve(this->GetSize());
45  for (Int_t i = 0; i < this->GetSize(); ++i) {
46  result.push_back(this->GetElement(i));
47  }
48  return result;
49  }
50 };
51 
52 #endif /*PNDINPUTCONTAINERI_HH*/
std::vector< T const * > GetVector() const
return vector of ptrs pointing at internal data, to be used to access data independent of underlying ...
PndInputContainerI()
Construct a new PndInputContainerI object.
virtual T const * GetElement(Int_t t_index) const =0
Get the Element object at t_index.
virtual T const * GetConstElementPtr(Int_t t_index) const
Get the Element object at t_index.
unsigned int i
Definition: P4_F32vec4.h:21
virtual ssize_t GetSize() const =0
Get the number of members in internal data.
Interface to a datacontainer to be used in PandaROOT.