Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::DynArr< T >::IndexingProvider< D > Class Template Reference

#include <AbsArr.h>

Public Member Functions

 IndexingProvider (DynArr< D > &farr, long fq_deref_ind, long fcurrent_pos)
 
 operator D& () const
 
D & operator= (const D &f)
 
IndexingProvider< D > & operator[] (long n)
 
const IndexingProvider< D > & operator[] (long n) const
 

Public Attributes

DynArr< D > & arr
 
long q_deref_ind
 
long current_pos
 

Detailed Description

template<class T>
template<class D>
class Heed::DynArr< T >::IndexingProvider< D >

Definition at line 1566 of file AbsArr.h.

Constructor & Destructor Documentation

◆ IndexingProvider()

template<class T >
template<class D >
Heed::DynArr< T >::IndexingProvider< D >::IndexingProvider ( DynArr< D > &  farr,
long  fq_deref_ind,
long  fcurrent_pos 
)
inline

Definition at line 1571 of file AbsArr.h.

1572 : arr(farr), q_deref_ind(fq_deref_ind), current_pos(fcurrent_pos) {}

Member Function Documentation

◆ operator D&()

template<class T >
template<class D >
Heed::DynArr< T >::IndexingProvider< D >::operator D& ( ) const
inline

Definition at line 1573 of file AbsArr.h.

1573 {
1574 if (q_deref_ind != arr.qel.get_qel()) {
1575 mcerr << "ERROR in IndexingProvider::operator D& (): q_deref_ind != "
1576 "qel.get_qel()\n";
1578 mcerr << "Type of T is (in internal notations) " << typeid(D).name()
1579 << '\n';
1580 spexit(mcerr);
1581 }
1582#ifdef ALR_CHECK_BOUND
1583 return arr.el[current_pos];
1584#else
1585 return arr.el.acu(current_pos);
1586#endif
1587 }
#define spexit(stream)
Definition: FunNameStack.h:256
long get_qel(void) const
Definition: AbsArr.h:283
T & acu(long n)
Definition: AbsArr.h:247
#define mcerr
Definition: prstream.h:128
#define Iprint2n(file, name1, name2)
Definition: prstream.h:220

◆ operator=()

template<class T >
template<class D >
D & Heed::DynArr< T >::IndexingProvider< D >::operator= ( const D &  f)
inline

Definition at line 1588 of file AbsArr.h.

1588 {
1589 if (q_deref_ind != arr.get_qel().get_qel()) {
1590 mcerr << "ERROR in T& IndexingProvider::operator=(T& f): q_deref_ind "
1591 "!= arr.get_qel().get_qel()\n";
1593 mcerr << "Type of T is (in internal notations) " << typeid(D).name()
1594 << '\n';
1595 spexit(mcerr);
1596 }
1597#ifdef ALR_CHECK_BOUND
1598 arr.ac_lin(current_pos) = f;
1599#else
1600 arr.acu_lin(current_pos) = f;
1601#endif
1602 // return arr.el[current_pos];
1603 }
T & ac_lin(long n)
Definition: AbsArr.h:2134
const DynLinArr< long > & get_qel(void) const
Definition: AbsArr.h:2169
T & acu_lin(long n)
Definition: AbsArr.h:2163

◆ operator[]() [1/2]

template<class T >
template<class D >
IndexingProvider< D > & Heed::DynArr< T >::IndexingProvider< D >::operator[] ( long  n)
inline

Definition at line 1605 of file AbsArr.h.

1605 {
1606 if (q_deref_ind >= arr.get_qel().get_qel()) {
1607 mcerr << "ERROR in DynArr::IndexingProvider& DynArr::operator[](long "
1608 "n): q_deref_ind >= arr.get_qel().get_qel()\n";
1610 mcerr << "Type of T is (in internal notations) " << typeid(D).name()
1611 << '\n';
1612 spexit(mcerr);
1613 }
1614#ifdef ALR_CHECK_EACH_BOUND
1615 if (n >= 0 && n < arr.qel.acu(q_deref_ind)) {
1616#endif
1618 q_deref_ind++;
1619 return *this;
1620#ifdef ALR_CHECK_EACH_BOUND
1621 } else {
1622 mcerr << "Error in IndexingProvider<D>& "
1623 "IndexingProvider::operator[](long n): n < 0 || n >= "
1624 "qel.acu(q_deref_ind)\n";
1625 Iprint2n(mcout, n, arr.qel.acu(q_deref_ind));
1626 mcerr << "Type of T is (in internal notations) " << typeid(T).name()
1627 << '\n';
1628 spexit(mcerr);
1629 }
1630#endif
1631 }
const DynLinArr< long > & get_cum_qel(void) const
Definition: AbsArr.h:2173
#define mcout
Definition: prstream.h:126

◆ operator[]() [2/2]

template<class T >
template<class D >
const IndexingProvider< D > & Heed::DynArr< T >::IndexingProvider< D >::operator[] ( long  n) const
inline

Definition at line 1633 of file AbsArr.h.

1633 {
1634 if (q_deref_ind >= arr.get_qel().get_qel()) {
1635 mcerr << "ERROR in DynArr::IndexingProvider& DynArr::operator[](long "
1636 "n): q_deref_ind >= arr.get_qel().get_qel()\n";
1638 mcerr << "Type of T is (in internal notations) " << typeid(D).name()
1639 << '\n';
1640 spexit(mcerr);
1641 }
1642#ifdef ALR_CHECK_EACH_BOUND
1643 if (n >= 0 && n < arr.qel.acu(q_deref_ind)) {
1644#endif
1646 q_deref_ind++;
1647 return *this;
1648#ifdef ALR_CHECK_EACH_BOUND
1649 } else {
1650 mcerr << "Error in IndexingProvider<D>& "
1651 "IndexingProvider::operator[](long n): n < 0 || n >= "
1652 "qel.acu(q_deref_ind)\n";
1653 Iprint2n(mcout, n, arr.qel.acu(q_deref_ind));
1654 mcerr << "Type of T is (in internal notations) " << typeid(T).name()
1655 << '\n';
1656 spexit(mcerr);
1657 }
1658#endif
1659 }

Member Data Documentation

◆ arr

◆ current_pos

◆ q_deref_ind


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