PandaRoot
PndConstContainer.h
Go to the documentation of this file.
1 
14 #ifndef PNDCONSTCONTAINER_HH
15 #define PNDCONSTCONTAINER_HH
16 
17 #include <vector>
18 
19 #include "PndContainerI.h"
20 #include "PndSTDConstContainer.h"
21 #include "PndTCAConstContainer.h"
22 
23 template <class T>
25 
26  public:
34 
39  virtual ~PndConstContainer(){};
40 
46  void SetConstContainer(PndConstContainerI<T> *t_container) { this->fImp.reset(t_container); }
47 
53  virtual ssize_t GetSize() const final
54  {
55  if (this->fImp != nullptr) {
56  return this->fImp->GetSize();
57  }
58  return 0;
59  }
60 
67  virtual T const *GetElement(Int_t t_index) const final
68  {
69  if (this->fImp != nullptr) {
70  return this->fImp->GetElement(t_index);
71  }
72  return nullptr;
73  }
74 
75  protected:
76  std::unique_ptr<PndConstContainerI<T>> fImp{nullptr};
77 };
78 
79 #endif /*PNDCONSTCONTAINER_HH*/
Input and Output Container implementation of PndConstContainerI using an underlying std::vector<T> (c...
virtual T const * GetElement(Int_t t_index) const final
Get the Element object at t_index.
void SetConstContainer(PndConstContainerI< T > *t_container)
Set the Input Container object.
virtual ~PndConstContainer()
Destroy the PndConstContainer object.
std::unique_ptr< PndConstContainerI< T > > fImp
Interface to a datacontainer to be used in PandaROOT.
virtual ssize_t GetSize() const final
Get the number of members in internal data.
Input and Output Container implementation of PndConstContainerI using an underlying TClonesArray...
PndConstContainer()
Construct a new PndConstContainer object.