#include <Collection.hpp>
Public Types | |
| typedef T | value_type |
| typedef size_t | size_type |
| typedef T * | pointer_type |
| typedef T & | reference_type |
| typedef const T * | const_pointer_type |
| typedef const T & | const_reference_type |
Public Member Functions | |
| Collection (TObjArray *data) | |
| Pass in array. | |
| Collection (const Collection< T > &other) | |
| Copy constructor. | |
| Collection (void) | |
| Default constructor. | |
| virtual | ~Collection () |
| Delete the collection if there are no more elemements in it. | |
| Collection< T > & | operator= (const Collection< T > &other) |
| Assign other collection to this one. | |
| void | push_back (const T &item) |
| Add an item to the array. | |
| void | push_back (T *item) |
| Add an item to the array. | |
| const T & | operator[] (size_t index) const |
| Easy [] access. | |
| size_t | size () const |
| Return size of collection. | |
| template<typename compare> void | sort (iterator from, iterator to, compare CompFun) |
| Sort a cafe::Collection<T>. | |
| ClassDef (Collection, 0) | |
Iterator access | |
| iterator | begin () |
| Iterators to first element in collection. | |
| const_iterator | begin () const |
| iterator | end () |
| Iterator to one past the last element in collection. | |
| const_iterator | end () const |
| iterator | erase (iterator it) |
| Erase entry at iterator position. Return 'next' position. | |
| iterator | erase (iterator first, iterator last) |
| Erase entries between iterator positions first and last. | |
Private Member Functions | |
| void | make_us_owner_of_data (void) |
| If we don't own the data array, make a copy and assume ownership. | |
| template<typename compare> void | insert_sort (TObjArray &array, int const from, int const to, compare CompFun) |
| template<typename compare> void | partial_quicksort (TObjArray &array, int indLow, int indHigh, compare CompFun) |
| template<typename compare> void | full_sort (TObjArray &array, int const from, int const to, compare CompFun) |
| void | swap (TObjArray &array, int i, int j) |
Private Attributes | |
| array_holder * | _data |
| Holds pointer to the TObjArray and a reference count. | |
By default the Collection<T> does not own the TObjArray that is passed to it and will not delete it.
The exception is an empty collection or an assignment to it. In this case it implements copy-on-write semantics.
The TObjArray is deleted using a "delete" statement, so unless you set the kOwned bit, it shouldn't delete its contents.
Definition at line 23 of file Collection.hpp.
|
|||||
|
Definition at line 29 of file Collection.hpp. Referenced by cafe::Collection< T >::const_iterator::operator->(). |
|
|||||
|
Definition at line 30 of file Collection.hpp. Referenced by cafe::Collection< T >::const_iterator::operator *(). |
|
|||||
|
Definition at line 27 of file Collection.hpp. Referenced by cafe::Collection< T >::iterator::operator->(). |
|
|||||
|
Definition at line 28 of file Collection.hpp. Referenced by cafe::Collection< T >::iterator::operator *(). |
|
|||||
|
Definition at line 26 of file Collection.hpp. |
|
|||||
|
Definition at line 25 of file Collection.hpp. |
|
||||||||||
|
Pass in array. The TObjArray will not be deleted when Collection goes out of scope. Definition at line 34 of file Collection.hpp. |
|
||||||||||
|
Copy constructor. TObjArray won't be deleted unless it is owned and the last one. Definition at line 45 of file Collection.hpp. |
|
||||||||||
|
Default constructor. New tobj array. Will be deleted when it does out of scope. Definition at line 52 of file Collection.hpp. |
|
|||||||||
|
Delete the collection if there are no more elemements in it.
Definition at line 57 of file Collection.hpp. |
|
|||||||||
|
Definition at line 100 of file Collection.hpp. |
|
|||||||||
|
||||||||||||||||
|
|
|
|||||||||
|
Definition at line 104 of file Collection.hpp. |
|
|||||||||
|
Iterator to one past the last element in collection.
Definition at line 103 of file Collection.hpp. Referenced by caf_util::EMJetMatching::after(), caf_util::ApplyJES::after(), caf_util::VertexSelector::before(), caf_util::MuonSelector::before(), caf_util::JetSelector::before(), caf_util::ElectronSelector::before(), caf_util::TreeHandler::FillBranch(), caf_util::TRefFinder::FindTrack(), caf_util::TRefFinder::FindVertex(), cafe::Trigger::processEvent(), caf_util::TopologicalSelector::processEvent(), cafe::SelectUserObjects< T >::processEvent(), caf_util::ReComputeMET::processEvent(), and caf_util::VertexSelector::selectObject(). |
|
||||||||||||||||
|
Erase entries between iterator positions first and last.
Definition at line 117 of file Collection.hpp. |
|
||||||||||
|
Erase entry at iterator position. Return 'next' position.
Definition at line 107 of file Collection.hpp. |
|
||||||||||||||||||||||||||||
|
Definition at line 377 of file Collection.hpp. Referenced by cafe::Collection< TMBJet >::sort(). |
|
||||||||||||||||||||||||||||
|
Definition at line 310 of file Collection.hpp. Referenced by cafe::Collection< TMBJet >::full_sort(). |
|
||||||||||
|
If we don't own the data array, make a copy and assume ownership. This is so we can add to a static item. Definition at line 296 of file Collection.hpp. Referenced by cafe::Collection< TMBJet >::erase(), cafe::Collection< TMBJet >::push_back(), and cafe::Collection< TMBJet >::sort(). |
|
||||||||||
|
Assign other collection to this one.
Definition at line 62 of file Collection.hpp. |
|
||||||||||
|
Easy [] access.
Definition at line 91 of file Collection.hpp. |
|
||||||||||||||||||||||||||||
|
Definition at line 331 of file Collection.hpp. Referenced by cafe::Collection< TMBJet >::full_sort(), and cafe::Collection< TMBJet >::partial_quicksort(). |
|
||||||||||
|
Add an item to the array. The collection will delete this item when it is done. Definition at line 84 of file Collection.hpp. |
|
||||||||||
|
Add an item to the array. This item must be have been dynamically allocated and not on the stack. The Collection does not take ownership of the item. Definition at line 75 of file Collection.hpp. |
|
|||||||||
|
Return size of collection.
Definition at line 132 of file Collection.hpp. Referenced by caf_util::ApplyJES::after(), caf_util::TopologicalSelector::processEvent(), caf_util::JetSelector::processEvent(), and caf_util::VertexSelector::selectObject(). |
|
||||||||||||||||||||||||
|
Sort a cafe::Collection<T>. The predicate CompFun should be a function or a class that provides a boolean result. This predicate should be callable like bool lessThan(T const& a, T const& b); and should return true if a belongs before b in the sorted collection. Definition at line 145 of file Collection.hpp. Referenced by caf_util::VertexSelector::before(), caf_util::MuonSelector::before(), caf_util::JetSelector::before(), and caf_util::ElectronSelector::before(). |
|
||||||||||||||||||||
|
Definition at line 388 of file Collection.hpp. Referenced by cafe::Collection< TMBJet >::partial_quicksort(). |
|
|||||
|
Holds pointer to the TObjArray and a reference count. Prevent root from trying to save it for now. Definition at line 292 of file Collection.hpp. Referenced by cafe::Collection< TMBJet >::begin(), cafe::Collection< TMBJet >::Collection(), cafe::Collection< TMBJet >::end(), cafe::Collection< TMBJet >::erase(), cafe::Collection< TMBJet >::make_us_owner_of_data(), cafe::Collection< TMBJet >::operator=(), cafe::Collection< TMBJet >::size(), cafe::Collection< TMBJet >::sort(), and cafe::Collection< TMBJet >::~Collection(). |
1.3.4