Base class for group of detector components. More...
#include "det/ComponentGroup.h"
Classes | |
struct | InternalConstFunctor |
Const functor to convert id to Counter. More... | |
struct | InternalFunctor |
Functor to convert id to Counter. More... | |
Public Types | |
typedef C | ComponentType |
The type of the contained component. More... | |
typedef boost::transform_iterator < InternalConstFunctor, IdIterator, const C & > | ConstIterator |
Convenience alias for constant iterators over components. More... | |
typedef boost::transform_iterator < InternalFunctor, IdIterator, C & > | Iterator |
Convenience alias for iterators over components. More... | |
typedef IdList::size_type | SizeType |
Type for number of components. More... | |
Public Member Functions | |
Iterator | Begin () |
Begin iterator over components. More... | |
ComponentGroup (const P &p) | |
Construct with parent. More... | |
Iterator | End () |
End iterator over components. More... | |
bool | Exists (int i) const |
Check for existence by id. More... | |
const C & | Get (int i) const |
Retrieve component by id. More... | |
C & | Get (int i) |
Retrieve component by id. More... | |
SizeType | GetNumberOfComponents () const |
Returns the number of components. More... | |
void | Update (const VManager::IndexMap &m, const bool invalidateData=true, const bool invalidateComponents=true) |
Updates the components. More... | |
Public Attributes | |
ConstIterator | const |
Begin iterator over components. More... | |
Private Types | |
typedef boost::ptr_map< int, C > | ComponentMap |
typedef ComponentMap::const_iterator | ComponentMapConstIterator |
typedef ComponentMap::iterator | ComponentMapIterator |
typedef IdList::const_iterator | IdIterator |
typedef std::list< int > | IdList |
typedef std::set< int > | IdSet |
Private Attributes | |
ComponentMap | fComponentsById |
Id to object conversion map. More... | |
IdList | fComponentsIds |
List of contained ids. More... | |
IdSet | fComponentsIdsSet |
Set of contained ids. More... | |
SizeType | fNumberOfIds |
The number of Ids. We keep the number of IDs separately because in a std::list the query for number is linear. More... | |
const P & | fParent |
The parent of the components. More... | |
Base class for group of detector components.
This class handles the parent-child relationship for one-to-many relations. Keeps a collection of the childs, handling the creation (with proper id management) and providing iterators over it.
P | The parent class. |
C | The child class. |
Creator | Policy for obect creation. |
ManagerProvider | Policy for Manager resolution. |
In C
it's also assumed to have this field:
ManagerProvider
an static function with the following signature is expected
In det::DetectorComponent a friendship declaration to this template class is provided: needs to be kept in sync (ie same template argument list).
Definition at line 127 of file Detector/ComponentGroup.h.
|
private |
Definition at line 129 of file Detector/ComponentGroup.h.
|
private |
Definition at line 150 of file Detector/ComponentGroup.h.
|
private |
Definition at line 149 of file Detector/ComponentGroup.h.
typedef C det::ComponentGroup< P, C, Creator, ManagerProvider >::ComponentType |
The type of the contained component.
Definition at line 203 of file Detector/ComponentGroup.h.
typedef boost::transform_iterator< InternalConstFunctor, IdIterator, const C& > det::ComponentGroup< P, C, Creator, ManagerProvider >::ConstIterator |
Convenience alias for constant iterators over components.
Definition at line 193 of file Detector/ComponentGroup.h.
|
private |
Definition at line 148 of file Detector/ComponentGroup.h.
|
private |
Definition at line 138 of file Detector/ComponentGroup.h.
|
private |
Definition at line 147 of file Detector/ComponentGroup.h.
typedef boost::transform_iterator< InternalFunctor, IdIterator, C& > det::ComponentGroup< P, C, Creator, ManagerProvider >::Iterator |
Convenience alias for iterators over components.
Definition at line 200 of file Detector/ComponentGroup.h.
typedef IdList::size_type det::ComponentGroup< P, C, Creator, ManagerProvider >::SizeType |
Type for number of components.
Definition at line 275 of file Detector/ComponentGroup.h.
|
inline |
Construct with parent.
Definition at line 206 of file Detector/ComponentGroup.h.
|
inline |
Begin iterator over components.
Definition at line 243 of file Detector/ComponentGroup.h.
References det::ComponentGroup< P, C, Creator, ManagerProvider >::fComponentsIds.
|
inline |
End iterator over components.
Definition at line 251 of file Detector/ComponentGroup.h.
References det::ComponentGroup< P, C, Creator, ManagerProvider >::fComponentsIds.
bool det::ComponentGroup< P, C, Creator, ManagerProvider >::Exists | ( | int | i | ) | const |
Check for existence by id.
Definition at line 413 of file Detector/ComponentGroup.h.
const C & det::ComponentGroup< P, C, Creator, ManagerProvider >::Get | ( | int | i | ) | const |
Retrieve component by id.
i | The id of the contained component. |
Definition at line 346 of file Detector/ComponentGroup.h.
References RdGeoCeLDFFitter::c, and ERROR.
Referenced by det::ComponentGroup< P, C, Creator, ManagerProvider >::Get().
C & det::ComponentGroup< P, C, Creator, ManagerProvider >::Get | ( | int | i | ) |
Retrieve component by id.
i | The id of the contained component. |
Definition at line 372 of file Detector/ComponentGroup.h.
References det::ComponentGroup< P, C, Creator, ManagerProvider >::Get().
|
inline |
Returns the number of components.
Definition at line 278 of file Detector/ComponentGroup.h.
References det::ComponentGroup< P, C, Creator, ManagerProvider >::fNumberOfIds.
void det::ComponentGroup< P, C, Creator, ManagerProvider >::Update | ( | const VManager::IndexMap & | m, |
const bool | invalidateData = true , |
||
const bool | invalidateComponents = true |
||
) |
Updates the components.
Usual detector Update method.
m | The map with the id identifying within the hierarchy. |
invalidateData | On non-first calls to update, this triggers a data invalidation so as to discard values loaded previously. |
invalidateComponents | On non-first call to update, this trigger a component list invalidation so as to discard (sub) components loaded previously. |
Definition at line 304 of file Detector/ComponentGroup.h.
References det::VManager::eNotFound, det::VManager::GetData(), utl::s, and det::ComponentUpdater::UpdateComponent().
ConstIterator det::ComponentGroup< P, C, Creator, ManagerProvider >::const |
Begin iterator over components.
End iterator over components.
Definition at line 227 of file Detector/ComponentGroup.h.
|
mutableprivate |
Id to object conversion map.
Definition at line 285 of file Detector/ComponentGroup.h.
|
mutableprivate |
List of contained ids.
Definition at line 288 of file Detector/ComponentGroup.h.
Referenced by det::ComponentGroup< P, C, Creator, ManagerProvider >::Begin(), and det::ComponentGroup< P, C, Creator, ManagerProvider >::End().
|
mutableprivate |
Set of contained ids.
Definition at line 298 of file Detector/ComponentGroup.h.
|
mutableprivate |
The number of Ids. We keep the number of IDs separately because in a std::list the query for number is linear.
Definition at line 295 of file Detector/ComponentGroup.h.
Referenced by det::ComponentGroup< P, C, Creator, ManagerProvider >::GetNumberOfComponents().
|
private |
The parent of the components.
Definition at line 282 of file Detector/ComponentGroup.h.