9 #ifndef ThePEG_Rebinder_H 10 #define ThePEG_Rebinder_H 12 #include "ThePEG/Config/ThePEG.h" 13 #include "Rebinder.fh" 59 const_iterator it =
theMap.find(r);
69 template <
typename OutputIterator,
typename InputIterator>
71 InputIterator first, InputIterator last)
const {
72 while ( first != last ) *r++ =
translate(*first++);
84 const_iterator it =
theMap.find(r);
86 if ( !ret )
throw std::runtime_error(
"Rebinder exception");
96 template <
typename OutputIterator,
typename InputIterator>
98 const throw(std::runtime_error) {
const MapType & map() const
Acces the underlying map representation.
R translate(const R &r) const
Return a pointer to the object associated with the argument.
MapType::const_iterator const_iterator
The iterator of the underlying map.
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Rebinder is a class associating pairs of pointers to objects.
T1 dynamic_ptr_cast(const T2 &t2)
Replacement for the standard dynamic_cast.
This is the main namespace within which all identifiers in ThePEG are declared.
#define ThePEG_DECLARE_TEMPLATE_POINTERS(full, abbrev)
This macro helps us to declare pointers and stuff to standard classes.
R alwaysTranslate(const R &r) const
Return a pointer to the object associated with the argument.
TPtr & operator[](tcTPtr t)
Return a pointer to the object associated with the argument.
Rebinder()
Default constructor.
MapType theMap
The underlying map representation.
RCPtr is a reference counted (smart) pointer.
std::map< cTPtr, TPtr > MapType
Map associating pairs of objects.
Rebinder & operator=(const Rebinder &)
The assignment operator is private and not implemented.
void translate(OutputIterator r, InputIterator first, InputIterator last) const
Insert pointers to objects into the output iterator, pointers to objects corresponding to the ones gi...
void alwaysTranslate(OutputIterator r, InputIterator first, InputIterator last) const
Insert pointers to objects into the output iterator, pointers to objects corresponding to the ones gi...