Garfield++ 4.0
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 1563 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 1568 of file AbsArr.h.

1569 : 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 1570 of file AbsArr.h.

1570 {
1571 if (q_deref_ind != arr.qel.get_qel()) {
1572 mcerr << "ERROR in IndexingProvider::operator D& (): q_deref_ind != "
1573 "qel.get_qel()\n";
1575 mcerr << "Type of T is (in internal notations) " << typeid(D).name()
1576 << '\n';
1577 spexit(mcerr);
1578 }
1579#ifdef ALR_CHECK_BOUND
1580 return arr.el[current_pos];
1581#else
1582 return arr.el.acu(current_pos);
1583#endif
1584 }
#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:219

◆ operator=()

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

Definition at line 1585 of file AbsArr.h.

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

◆ operator[]() [1/2]

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

Definition at line 1602 of file AbsArr.h.

1602 {
1603 if (q_deref_ind >= arr.get_qel().get_qel()) {
1604 mcerr << "ERROR in DynArr::IndexingProvider& DynArr::operator[](long "
1605 "n): q_deref_ind >= arr.get_qel().get_qel()\n";
1607 mcerr << "Type of T is (in internal notations) " << typeid(D).name()
1608 << '\n';
1609 spexit(mcerr);
1610 }
1611#ifdef ALR_CHECK_EACH_BOUND
1612 if (n < 0 || n >= arr.qel.acu(q_deref_ind)) {
1613 mcerr << "Error in IndexingProvider<D>& "
1614 "IndexingProvider::operator[](long n): n < 0 || n >= "
1615 "qel.acu(q_deref_ind)\n";
1616 Iprint2n(mcout, n, arr.qel.acu(q_deref_ind));
1617 mcerr << "Type of T is (in internal notations) " << typeid(T).name()
1618 << '\n';
1619 spexit(mcerr);
1620 }
1621#endif
1623 q_deref_ind++;
1624 return *this;
1625 }
const DynLinArr< long > & get_cum_qel(void) const
Definition: AbsArr.h:2156
#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 1627 of file AbsArr.h.

1627 {
1628 if (q_deref_ind >= arr.get_qel().get_qel()) {
1629 mcerr << "ERROR in DynArr::IndexingProvider& DynArr::operator[](long "
1630 "n): q_deref_ind >= arr.get_qel().get_qel()\n";
1632 mcerr << "Type of T is (in internal notations) " << typeid(D).name()
1633 << '\n';
1634 spexit(mcerr);
1635 }
1636#ifdef ALR_CHECK_EACH_BOUND
1637 if (n < 0 || n >= arr.qel.acu(q_deref_ind)) {
1638 mcerr << "Error in IndexingProvider<D>& "
1639 "IndexingProvider::operator[](long n): n < 0 || n >= "
1640 "qel.acu(q_deref_ind)\n";
1641 Iprint2n(mcout, n, arr.qel.acu(q_deref_ind));
1642 mcerr << "Type of T is (in internal notations) " << typeid(T).name()
1643 << '\n';
1644 spexit(mcerr);
1645 }
1646#endif
1648 q_deref_ind++;
1649 return *this;
1650 }

Member Data Documentation

◆ arr

◆ current_pos

◆ q_deref_ind


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