CbmRoot
|
#include <CaVector.h>
Public Types | |
typedef std::vector< T > | Tbase |
Public Member Functions | |
template<typename... Tinput> | |
Vector (Tinput... value) | |
Generic constructor from vairadic parameter list. | |
template<typename... Tinput> | |
Vector (const char *name, Tinput... value) | |
Generic constructor from vairadic parameter list including the name of the vector. | |
Vector (const std::string &name, std::initializer_list< T > init) | |
Constructor to make initializations like ca::Vector<int> myVector {"MyVector", {1, 2, 3}}. | |
Vector (const Vector &v) | |
Copy constructor. | |
Vector (Vector &&v) noexcept | |
Move constructor. | |
Vector & | operator= (const Vector &v) |
Copy assignment operator. | |
Vector & | operator= (Vector &&v) noexcept |
Move assignment operator. | |
void | swap (Vector &v) noexcept |
Swap operator. | |
void | SetName (const std::string &s) |
Sets the name of the vector. | |
void | SetName (const std::basic_ostream< char > &s) |
Sets the name of the vector. | |
std::string | GetName () const |
Gets name of the vector. | |
template<typename... Tinput> | |
void | reset (std::size_t count, Tinput... value) |
Clears vector and resizes it to the selected size with selected values. | |
template<typename... Tinput> | |
void | enlarge (std::size_t count, Tinput... value) |
Enlarges the vector to the new size. | |
void | shrink (std::size_t count) |
Reduces the vector to a given size. | |
void | reserve (std::size_t count) |
Reserves a new size for the vector. | |
template<typename Tinput > | |
void | push_back (Tinput value) |
Pushes back a value to the vector. | |
template<typename Tinput > | |
void | push_back_no_warning (Tinput value) |
Pushes back a value to the vector without testing for the memory re-alocation. | |
template<typename... Tinput> | |
void | emplace_back (Tinput &&... value) |
Creates a parameter in the end of the vector. | |
T & | operator[] (std::size_t pos) |
Mutable access to the element by its index. | |
const T & | operator[] (std::size_t pos) const |
Constant access to the element by its index. | |
T & | back () |
Mutable access to the last element of the vector. | |
const T & | back () const |
Constant access to the last element of the vector. | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
Serialization function for the vector. | |
Private Attributes | |
std::string | fName {"no name"} |
Name of the vector. | |
Friends | |
class | boost::serialization::access |
ca::Vector class is a wrapper around std::vector. It does the following:
Definition at line 38 of file CaVector.h.
std::vector<T> cbm::algo::ca::Vector< T >::Tbase |
Definition at line 42 of file CaVector.h.
|
inline |
Generic constructor from vairadic parameter list.
Definition at line 46 of file CaVector.h.
|
inline |
Generic constructor from vairadic parameter list including the name of the vector.
Definition at line 52 of file CaVector.h.
|
inline |
Constructor to make initializations like ca::Vector<int> myVector {"MyVector", {1, 2, 3}}.
Definition at line 58 of file CaVector.h.
|
inline |
|
inlinenoexcept |
Move constructor.
Definition at line 64 of file CaVector.h.
|
inline |
Mutable access to the last element of the vector.
Definition at line 230 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
Referenced by cbm::algo::ca::CloneMerger::Exec().
|
inline |
Constant access to the last element of the vector.
Definition at line 240 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
|
inline |
Creates a parameter in the end of the vector.
value | Variadic list of the parameters, which are passed to the element constructor |
Definition at line 196 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
Referenced by cbm::algo::ca::TripletConstructor::SelectTriplets(), and cbm::ca::TimeSliceReader::StoreHitRecord().
|
inline |
Enlarges the vector to the new size.
count | New size of the vector |
value | Value of the new elements |
Definition at line 133 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
Referenced by cbm::algo::ca::TrackExtender::FindMoreHits().
|
inline |
Gets name of the vector.
Definition at line 110 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
Referenced by cbm::ca::TimeSliceReader::SortQaHits().
|
inline |
Copy assignment operator.
Definition at line 67 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName, and v.
|
inlinenoexcept |
Move assignment operator.
Definition at line 78 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName, and v.
|
inline |
Mutable access to the element by its index.
pos | Index of the element |
Definition at line 207 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName, and pos.
|
inline |
Constant access to the element by its index.
pos | Index of the element |
Definition at line 219 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName, and pos.
|
inline |
Pushes back a value to the vector.
value | New value |
Definition at line 176 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
Referenced by cbm::algo::ca::Branch::AddHit(), cbm::algo::ca::TripletConstructor::CollectHits(), CbmL1RichENNRingFinderParallel::ENNRingFinder(), cbm::algo::ca::CloneMerger::Exec(), cbm::algo::ca::TripletConstructor::FindTripletHits(), CbmL1::IdealTrackFinder(), cbm::algo::TrackingChain::PrepareOutput(), cbm::algo::TrackingChain::ReadHits(), CbmL1::Reconstruct(), cbm::algo::ca::TrackFinderWindow::SelectTracks(), and cbm::ca::TimeSliceReader::StoreHitRecord().
|
inline |
Pushes back a value to the vector without testing for the memory re-alocation.
value | New value |
Definition at line 188 of file CaVector.h.
Referenced by cbm::ca::tools::MCPoint::AddHitID(), cbm::ca::tools::MCTrack::AddHitIndex(), CbmL1Track::AddMCTrackIndex(), cbm::ca::tools::MCTrack::AddPointIndex(), CbmL1MCTrack::AddRecoTrack(), cbm::ca::tools::MCTrack::AddRecoTrackIndex(), CbmL1MCTrack::AddRecoTrackIndex(), CbmL1MCTrack::AddTouchTrack(), cbm::ca::tools::MCTrack::AddTouchTrackIndex(), CbmL1MCTrack::AddTouchTrackIndex(), and CbmL1MCTrack::Init().
|
inline |
Reserves a new size for the vector.
count | New size of the vector |
Definition at line 162 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
Referenced by cbm::algo::ca::Branch::Branch(), cbm::algo::ca::TripletConstructor::CollectHits(), cbm::algo::ca::TrackFinderWindow::ConstructTriplets(), CbmL1RichENNRingFinderParallel::ENNRingFinder(), cbm::algo::ca::CloneMerger::Exec(), cbm::algo::ca::TripletConstructor::FindDoublets(), cbm::algo::ca::TrackExtender::FindMoreHits(), cbm::algo::ca::TrackFinder::FindTracks(), cbm::algo::ca::TripletConstructor::FindTripletHits(), cbm::algo::TrackingChain::PrepareInput(), cbm::ca::TimeSliceReader::ReadHits(), cbm::algo::ca::TrackFinderWindow::ReadWindowData(), CbmL1::Reconstruct(), and cbm::algo::ca::TripletConstructor::SelectTriplets().
|
inline |
Clears vector and resizes it to the selected size with selected values.
count | New size of the vector |
value | Variadic list of the parameters to pass to the base std::vector::resize function |
Definition at line 121 of file CaVector.h.
Referenced by cbm::algo::ca::Grid::BuildBins(), CbmL1RichENNRingFinderParallel::DoFind(), CbmL1RichENNRingFinderParallel::ENNRingFinder(), cbm::algo::ca::CloneMerger::Exec(), cbm::algo::ca::DataManager::InitData(), cbm::algo::ca::TrackFinderWindow::InitTimeslice(), cbm::algo::TrackingChain::PrepareOutput(), cbm::ca::TimeSliceReader::ReadRecoTracks(), cbm::algo::ca::WindowData::ResetHitData(), cbm::algo::ca::WindowData::ResetHitSuppressionFlags(), and cbm::algo::ca::Grid::StoreHits().
|
inlineprivate |
Serialization function for the vector.
Definition at line 271 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
|
inline |
Sets the name of the vector.
s | Name of the vector (string stream) |
Definition at line 102 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
|
inline |
Sets the name of the vector.
s | Name of the vector |
Definition at line 98 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
Referenced by cbm::ca::TimeSliceReader::SortQaHits().
|
inline |
Reduces the vector to a given size.
count | Size of the new vector |
Definition at line 150 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName.
Referenced by cbm::algo::ca::TripletConstructor::FindDoublets(), cbm::algo::ca::DataManager::InitData(), and cbm::algo::ca::Grid::RemoveUsedHits().
|
inlinenoexcept |
Swap operator.
Definition at line 88 of file CaVector.h.
References cbm::algo::ca::Vector< T >::fName, and v.
|
friend |
Definition at line 39 of file CaVector.h.
|
private |
Name of the vector.
Definition at line 264 of file CaVector.h.
Referenced by cbm::algo::ca::Vector< T >::back(), cbm::algo::ca::Vector< T >::back(), cbm::algo::ca::Vector< T >::emplace_back(), cbm::algo::ca::Vector< T >::enlarge(), cbm::algo::ca::Vector< T >::GetName(), cbm::algo::ca::Vector< T >::operator=(), cbm::algo::ca::Vector< T >::operator=(), cbm::algo::ca::Vector< T >::operator[](), cbm::algo::ca::Vector< T >::operator[](), cbm::algo::ca::Vector< T >::push_back(), cbm::algo::ca::Vector< T >::reserve(), cbm::algo::ca::Vector< T >::serialize(), cbm::algo::ca::Vector< T >::SetName(), cbm::algo::ca::Vector< T >::SetName(), cbm::algo::ca::Vector< T >::shrink(), and cbm::algo::ca::Vector< T >::swap().