MARLEY (Model of Argon Reaction Low Energy Yields)  v1.0.0
A Monte Carlo event generator for tens-of-MeV neutrino-nucleus interactions in liquid argon
 All Classes Functions Variables Enumerations Pages
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
marley::IteratorToPointerMember< It, T, R > Class Template Reference

Template class that creates an iterator to a class member based on an iterator to a pointer (either bare or smart) to the class object. More...

#include <IteratorToPointerMember.hh>

Public Types

typedef std::iterator_traits
< It >::difference_type 
difference_type
 
typedef std::iterator_traits
< It >::iterator_category 
iterator_category
 
typedef R * pointer
 
typedef R & reference
 
typedef R value_type
 

Public Member Functions

 IteratorToPointerMember (It from, R T::*memptr)
 Construction from an iterator and a pointer to member. More...
 
bool operator!= (const IteratorToPointerMember< It, T, R > &rhs) const
 
virtual reference operator* () const
 
IteratorToPointerMember operator+ (difference_type n) const
 
IteratorToPointerMemberoperator++ ()
 
IteratorToPointerMember operator++ (int)
 Postfix operator++ (dummy argument) More...
 
IteratorToPointerMemberoperator+= (difference_type n)
 
IteratorToPointerMember operator- (difference_type n) const
 
difference_type operator- (const IteratorToPointerMember< It, T, R > &rhs) const
 
IteratorToPointerMemberoperator-- ()
 
IteratorToPointerMember operator-- (int)
 Postfix operator– (see note about the postfix operator++)
 
IteratorToPointerMemberoperator-= (difference_type n)
 
virtual pointer operator-> () const
 
bool operator== (const IteratorToPointerMember< It, T, R > &rhs) const
 
reference operator[] (difference_type n) const
 

Public Attributes

It m_it
 

Protected Attributes

value_type T::* m_memptr
 

Detailed Description

template<typename It, typename T, typename R>
class marley::IteratorToPointerMember< It, T, R >

Template class that creates an iterator to a class member based on an iterator to a pointer (either bare or smart) to the class object.

Ideally this class would inherit from marley::IteratorToMember and merely override the operator*() and operator->() functions, but such behavior doesn't appear to be currently possible (6/2016) using template classes.

Template Parameters
Ittype of the original iterator
Ttype pointed to by pointer pointed to by the original iterator
Rtype of the member we want to point to

Constructor & Destructor Documentation

template<typename It, typename T, typename R>
marley::IteratorToPointerMember< It, T, R >::IteratorToPointerMember ( It  from,
R T::*  memptr 
)
inline

Construction from an iterator and a pointer to member.

Parameters
fromIterator to the object
memptrPointer to the member of interest

Member Function Documentation

template<typename It , typename T , typename R >
IteratorToPointerMember< It, T, R > marley::IteratorToPointerMember< It, T, R >::operator++ ( int  )
inline

Postfix operator++ (dummy argument)

Note
The standard behavior for this operator is to return the un-incremented value while incrementing the operand. See discussion here.

The documentation for this class was generated from the following file: