LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
geo::vect::details::CoordManager< Vector, SetterType > Class Template Reference

Helper class for read/write of a single vector coordinate. More...

#include "geo_vectors_utils.h"

Inheritance diagram for geo::vect::details::CoordManager< Vector, SetterType >:
geo::vect::details::CoordGetter< Vector >

Public Types

using Vector_t = typename Traits_t::Vector_t
 
using Scalar_t = typename Traits_t::Scalar_t
 
using Getter_t = typename Traits_t::Getter_t
 
using Setter_t = typename Traits_t::Setter_t
 

Public Member Functions

constexpr CoordManager (Getter_t getter, Setter_t setter)
 Constructor: sets getter and setter functions. More...
 
void operator() (Vector_t &v, Scalar_t c) const
 Setter: assigns a value to the bound coordinate of specified vector. More...
 
void set (Vector_t &v, Scalar_t c) const
 Setter: assigns a value to the bound coordinate of specified vector. More...
 
void incr (Vector_t &v, Scalar_t c) const
 Increments the coordinate by the specified amount. More...
 
void decr (Vector_t &v, Scalar_t c) const
 Decrements the coordinate by the specified amount. More...
 
void mult (Vector_t &v, Scalar_t f) const
 Multiplies the coordinate by the specified amount. More...
 
void div (Vector_t &v, Scalar_t f) const
 Divides the coordinate by the specified amount. More...
 
Scalar_t operator() (Vector_t const &v) const
 Returns the value of the bound coordinate. More...
 
Scalar_t get (Vector_t const &v) const
 Returns the value of the bound coordinate. More...
 

Private Types

using Base_t = CoordGetter< Vector >
 
using Traits_t = CoordManagerTraits< Vector, SetterType >
 

Private Attributes

Setter_t fSetter
 Member function setting the coordinate value. More...
 

Detailed Description

template<typename Vector, typename SetterType>
class geo::vect::details::CoordManager< Vector, SetterType >

Helper class for read/write of a single vector coordinate.

Definition at line 261 of file geo_vectors_utils.h.

Member Typedef Documentation

template<typename Vector , typename SetterType >
using geo::vect::details::CoordManager< Vector, SetterType >::Base_t = CoordGetter<Vector>
private

Definition at line 262 of file geo_vectors_utils.h.

template<typename Vector , typename SetterType >
using geo::vect::details::CoordManager< Vector, SetterType >::Getter_t = typename Traits_t::Getter_t

Definition at line 268 of file geo_vectors_utils.h.

template<typename Vector , typename SetterType >
using geo::vect::details::CoordManager< Vector, SetterType >::Scalar_t = typename Traits_t::Scalar_t

Definition at line 267 of file geo_vectors_utils.h.

template<typename Vector , typename SetterType >
using geo::vect::details::CoordManager< Vector, SetterType >::Setter_t = typename Traits_t::Setter_t

Definition at line 269 of file geo_vectors_utils.h.

template<typename Vector , typename SetterType >
using geo::vect::details::CoordManager< Vector, SetterType >::Traits_t = CoordManagerTraits<Vector, SetterType>
private

Definition at line 263 of file geo_vectors_utils.h.

template<typename Vector , typename SetterType >
using geo::vect::details::CoordManager< Vector, SetterType >::Vector_t = typename Traits_t::Vector_t

Definition at line 266 of file geo_vectors_utils.h.

Constructor & Destructor Documentation

template<typename Vector , typename SetterType >
constexpr geo::vect::details::CoordManager< Vector, SetterType >::CoordManager ( Getter_t  getter,
Setter_t  setter 
)
inline

Constructor: sets getter and setter functions.

Definition at line 272 of file geo_vectors_utils.h.

273  : Base_t(getter), fSetter(setter) {}
Setter_t fSetter
Member function setting the coordinate value.

Member Function Documentation

template<typename Vector , typename SetterType >
void geo::vect::details::CoordManager< Vector, SetterType >::decr ( Vector_t v,
Scalar_t  c 
) const
inline

Decrements the coordinate by the specified amount.

Definition at line 285 of file geo_vectors_utils.h.

285 { set(v, Base_t::get(v) - c); }
Scalar_t get(Vector_t const &v) const
Returns the value of the bound coordinate.
template<typename Vector , typename SetterType >
void geo::vect::details::CoordManager< Vector, SetterType >::div ( Vector_t v,
Scalar_t  f 
) const
inline

Divides the coordinate by the specified amount.

Definition at line 291 of file geo_vectors_utils.h.

References f.

291 { set(v, Base_t::get(v) / f); }
TFile f
Definition: plotHisto.C:6
Scalar_t get(Vector_t const &v) const
Returns the value of the bound coordinate.
template<typename Vector >
Scalar_t geo::vect::details::CoordGetter< Vector >::get ( Vector_t const &  v) const
inlineinherited

Returns the value of the bound coordinate.

Definition at line 232 of file geo_vectors_utils.h.

232 { return (v.*fGetter)(); }
Getter_t fGetter
Member function returning the coordinate value.
template<typename Vector , typename SetterType >
void geo::vect::details::CoordManager< Vector, SetterType >::incr ( Vector_t v,
Scalar_t  c 
) const
inline

Increments the coordinate by the specified amount.

Definition at line 282 of file geo_vectors_utils.h.

282 { set(v, Base_t::get(v) + c); }
Scalar_t get(Vector_t const &v) const
Returns the value of the bound coordinate.
template<typename Vector , typename SetterType >
void geo::vect::details::CoordManager< Vector, SetterType >::mult ( Vector_t v,
Scalar_t  f 
) const
inline

Multiplies the coordinate by the specified amount.

Definition at line 288 of file geo_vectors_utils.h.

References f.

288 { set(v, Base_t::get(v) * f); }
TFile f
Definition: plotHisto.C:6
Scalar_t get(Vector_t const &v) const
Returns the value of the bound coordinate.
template<typename Vector >
Scalar_t geo::vect::details::CoordGetter< Vector >::operator() ( Vector_t const &  v) const
inlineinherited

Returns the value of the bound coordinate.

Definition at line 229 of file geo_vectors_utils.h.

229 { return get(v); }
template<typename Vector , typename SetterType >
void geo::vect::details::CoordManager< Vector, SetterType >::operator() ( Vector_t v,
Scalar_t  c 
) const
inline

Setter: assigns a value to the bound coordinate of specified vector.

Definition at line 276 of file geo_vectors_utils.h.

276 { set(v, c); }
template<typename Vector , typename SetterType >
void geo::vect::details::CoordManager< Vector, SetterType >::set ( Vector_t v,
Scalar_t  c 
) const
inline

Setter: assigns a value to the bound coordinate of specified vector.

Definition at line 279 of file geo_vectors_utils.h.

279 { (v.*fSetter)(c); }
Setter_t fSetter
Member function setting the coordinate value.

Member Data Documentation

template<typename Vector , typename SetterType >
Setter_t geo::vect::details::CoordManager< Vector, SetterType >::fSetter
private

Member function setting the coordinate value.

Definition at line 294 of file geo_vectors_utils.h.


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