1 #ifndef _evt_ComponentGroup_h_
2 #define _evt_ComponentGroup_h_
4 #include <utl/ErrorLogger.h>
5 #include <utl/AugerException.h>
10 #include <boost/ptr_container/ptr_map.hpp>
11 #include <boost/iterator/transform_iterator.hpp>
19 template<
class Iterator>
21 Check(
const Iterator& i,
const Iterator& e,
const int id)
24 std::ostringstream error;
26 error <<
"Id " <<
id <<
" not present.";
79 template<
class Component>
91 template<
class RetType,
class ArgType>
110 typedef typename InternalComponentCollection::key_type
KeyType;
111 typedef typename InternalComponentCollection::mapped_type
MappedType;
116 typedef typename InternalComponentCollection::reference
Reference;
139 typedef boost::transform_iterator<ConstComponentResolver, PairConstIterator>
145 typedef boost::transform_iterator<ComponentResolver, PairIterator>
177 Component*
const c =
new Component(
id);
191 std::ostringstream error;
193 error <<
id <<
" already present.";
ComponentIterator Begin()
ComponentConstIterator Begin() const
result_type operator()(const argument_type &p) const
const Component * ConstMappedType
boost::transform_iterator< ConstComponentResolver, PairConstIterator > ComponentConstIterator
Alias for constant iterator over contained components.
boost::transform_iterator< ComponentResolver, PairIterator > ComponentIterator
Alias for non-constant iterator over contained components.
boost::ptr_map< int, Component > InternalComponentCollection
InternalComponentCollection::key_type KeyType
void Make(int id)
Construct by id.
SecondResolver< MappedReference, Reference > ComponentResolver
static constexpr const ConstComponentResolver kConstResolver
Instance of the (stateless) helper class (stored on a class for the containing class) for const compo...
Base class for exceptions trying to access non-existing components.
InternalComponentCollection::mapped_reference MappedReference
bool Has(const int id) const
Query existence.
InternalComponentCollection::const_iterator PairConstIterator
int GetNumberOf() const
Query quantity.
InternalComponentCollection::reference Reference
const PairConstIterator e
SecondResolver< ConstMappedReference, ConstReference > ConstComponentResolver
void Check(const Iterator &i, const Iterator &e, const int id)
InternalComponentCollection::mapped_type MappedType
#define WARNING(message)
Macro for logging warning messages.
static constexpr const ComponentResolver kResolver
Non-const resolving.
Common class for groups of components of the Event hierarchy.
InternalComponentCollection::const_reference ConstReference
ComponentConstIterator End() const
InternalComponentCollection fComponents
InternalComponentCollection::iterator PairIterator
#define ERROR(message)
Macro for logging error messages.
Component & Get(const int id)
Retrieve by id.
InternalComponentCollection::const_mapped_reference ConstMappedReference