LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 300 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 301 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 307 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 306 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 308 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 302 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 305 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 311 of file geo_vectors_utils.h.

311  : Base_t(getter), fSetter(setter)
312  {}
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 324 of file geo_vectors_utils.h.

References util::get().

324 { 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 330 of file geo_vectors_utils.h.

References f, and util::get().

330 { 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 272 of file geo_vectors_utils.h.

272 { 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 321 of file geo_vectors_utils.h.

References util::get().

321 { 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 327 of file geo_vectors_utils.h.

References f, and util::get().

327 { 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 269 of file geo_vectors_utils.h.

269 { 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 315 of file geo_vectors_utils.h.

315 { 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 318 of file geo_vectors_utils.h.

318 { (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 333 of file geo_vectors_utils.h.


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