PandaRoot
PndSTDConstContainer< T > Class Template Reference

PndSTDConstContainer implementation of PndConstContainerI<T> for FairRootManager and std::vector<T> More...

#include <PndSTDConstContainer.h>

Inheritance diagram for PndSTDConstContainer< T >:
PndConstContainerI< T > PndContainerI< T > PndContainerBaseI

Public Member Functions

 PndSTDConstContainer ()
 Construct a new PndSTDConstContainer object. More...
 
virtual ~PndSTDConstContainer ()
 Destroy the PndSTDConstContainer object. More...
 
virtual T const * GetElement (Int_t t_idx) const final
 Get the t_idx Element. More...
 
virtual ssize_t GetSize () const final
 Get the number of elements. More...
 
void SetData (std::vector< T > const *t_container)
 Set the Data. More...
 
std::vector< T > const * GetData ()
 Get the Data. More...
 
- Public Member Functions inherited from PndConstContainerI< T >
 PndConstContainerI ()
 Construct a new PndConstContainerI object. More...
 
virtual T const * GetConstElementPtr (Int_t t_index) const
 Get the Element object at t_index. More...
 
std::vector< T const * > GetVector () const
 return vector of ptrs pointing at internal data, to be used to access data independent of underlying data container More...
 
- Public Member Functions inherited from PndContainerI< T >
 PndContainerI ()
 Construct a new PndContainerI object. More...
 
virtual ~PndContainerI ()
 Destroy the PndContainerI object. More...
 
std::vector< T const * > GetVectorOfPtrToConst () const
 return vector of const ptrs pointing at internal data, to be used to access data independent of underlying data container More...
 
TString GetClassName () const
 
- Public Member Functions inherited from PndContainerBaseI
 PndContainerBaseI ()
 Construct a new PndContainerBaseI object. More...
 
virtual ~PndContainerBaseI ()
 Destroy the PndContainerBaseI object. More...
 
const TString & GetBranchName () const
 Get the BranchName. More...
 
void SetBranchName (const TString &t_branchname)
 Set the Branch Name. More...
 

Additional Inherited Members

- Protected Attributes inherited from PndContainerBaseI
TString fBranchName {""}
 

Detailed Description

template<class T>
class PndSTDConstContainer< T >

PndSTDConstContainer implementation of PndConstContainerI<T> for FairRootManager and std::vector<T>

Input data retrieved from FairRootManager is immutable (std::vector<T> const *)

Template Parameters
T

Definition at line 48 of file PndSTDConstContainer.h.

Constructor & Destructor Documentation

◆ PndSTDConstContainer()

template<class T >
PndSTDConstContainer< T >::PndSTDConstContainer ( )
inline

Construct a new PndSTDConstContainer object.

Definition at line 54 of file PndSTDConstContainer.h.

◆ ~PndSTDConstContainer()

template<class T >
virtual PndSTDConstContainer< T >::~PndSTDConstContainer ( )
inlinevirtual

Destroy the PndSTDConstContainer object.

Definition at line 59 of file PndSTDConstContainer.h.

59 {};

Member Function Documentation

◆ GetData()

template<class T >
std::vector<T> const* PndSTDConstContainer< T >::GetData ( )
inline

Get the Data.

Returns
std::vector<T> const*

Definition at line 100 of file PndSTDConstContainer.h.

100 { return fSTD; }

◆ GetElement()

template<class T >
virtual T const* PndSTDConstContainer< T >::GetElement ( Int_t  t_idx) const
inlinefinalvirtual

Get the t_idx Element.

Parameters
t_idx
Returns
T const *

Implements PndConstContainerI< T >.

Definition at line 67 of file PndSTDConstContainer.h.

68  {
69  if (fSTD != nullptr) {
70  return &(fSTD->at(t_idx));
71  }
72 
73  return nullptr;
74  }

◆ GetSize()

template<class T >
virtual ssize_t PndSTDConstContainer< T >::GetSize ( ) const
inlinefinalvirtual

Get the number of elements.

Returns
ssize_t

Implements PndContainerBaseI.

Definition at line 81 of file PndSTDConstContainer.h.

82  {
83  if (fSTD != nullptr) {
84  return fSTD->size();
85  }
86  return 0;
87  }

◆ SetData()

template<class T >
void PndSTDConstContainer< T >::SetData ( std::vector< T > const *  t_container)
inline

Set the Data.

Parameters
t_container

Definition at line 93 of file PndSTDConstContainer.h.

93 { fSTD = t_container; }

The documentation for this class was generated from the following file: