KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVRefVec< T > Class Template Reference

Detailed Description

template<typename T>
class KVRefVec< T >

Vector of references to objects.

The KVRefVec class behaves like a std::vector of references T& i.e. with

SomeObject obj;
RefVec<SomeObject> i(1);
i.set(0,obj);

we have r_vec[0] -> SomeObject& reference to obj, and we can do r_vec[0].some_method()

Author
John Frankland
Date
Fri Mar 29 10:43:31 2024
Examples
ExampleAnalysis_KVEventMixerN_2Body.cpp, and ExampleAnalysis_KVEventMixerN_3Body.cpp.

Definition at line 24 of file KVRefVec.h.

#include <KVRefVec.h>

Classes

struct  iterator
 

Public Member Functions

 KVRefVec (size_t N)
 
iterator begin ()
 
iterator end ()
 
const Toperator[] (size_t i) const
 
void set (size_t i, T *t)
 
size_t size () const
 

Private Attributes

std::vector< T * > objects
 

Constructor & Destructor Documentation

◆ KVRefVec()

template<typename T >
KVRefVec< T >::KVRefVec ( size_t  N)
inline

Definition at line 27 of file KVRefVec.h.

Member Function Documentation

◆ begin()

template<typename T >
iterator KVRefVec< T >::begin ( )
inline

Definition at line 94 of file KVRefVec.h.

◆ end()

template<typename T >
iterator KVRefVec< T >::end ( )
inline

Definition at line 98 of file KVRefVec.h.

◆ operator[]()

template<typename T >
const T & KVRefVec< T >::operator[] ( size_t  i) const
inline

Definition at line 28 of file KVRefVec.h.

◆ set()

template<typename T >
void KVRefVec< T >::set ( size_t  i,
T t 
)
inline

Definition at line 32 of file KVRefVec.h.

◆ size()

template<typename T >
size_t KVRefVec< T >::size ( ) const
inline

Definition at line 36 of file KVRefVec.h.

Member Data Documentation

◆ objects

template<typename T >
std::vector<T*> KVRefVec< T >::objects
private

Definition at line 25 of file KVRefVec.h.