ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TTN::ConstBuffer_t Class Reference

Read only reference to one of the halves provided by the DoubleBuffer_t. More...

#include <TargetBuffer_t.h>

Inheritance diagram for TTN::ConstBuffer_t:
Collaboration diagram for TTN::ConstBuffer_t:

Public Member Functions

 ConstBuffer_t (const Buffer_t &buffer)
 
 ConstBuffer_t (const std::vector< double > &buffer)
 
ConstBuffer_toperator= (const Buffer_t &buffer)
 
const double & operator[] (typename std::vector< double >::size_type idx) const
 
const double & upper_bound_at (typename std::vector< double >::size_type idx) const
 

Protected Member Functions

std::vector< double >::size_type optionalRangeCheck (typename std::vector< double >::size_type idx) const
 
std::vector< double >::size_type optionalRangeCheckUpperBound (typename std::vector< double >::size_type idx) const
 
void throwRangeError (typename std::vector< double >::size_type idx) const
 

Protected Attributes

const double * m_ptr
 
std::vector< double >::size_type m_maxIndex
 
const double * m_bufferStart
 
const double * m_bufferEnd
 

Detailed Description

Read only reference to one of the halves provided by the DoubleBuffer_t.

The base class of this helper class provides compile-time optional range checks.

Definition at line 145 of file TargetBuffer_t.h.

Constructor & Destructor Documentation

◆ ConstBuffer_t() [1/2]

TTN::ConstBuffer_t::ConstBuffer_t ( const Buffer_t buffer)
inline

Definition at line 148 of file TargetBuffer_t.h.

148 : BufferBase_t<double,const double, const std::vector<double> >(buffer) {}

◆ ConstBuffer_t() [2/2]

TTN::ConstBuffer_t::ConstBuffer_t ( const std::vector< double > &  buffer)
inline

Definition at line 149 of file TargetBuffer_t.h.

149 : BufferBase_t<double,const double, const std::vector<double> >(buffer) {}

Member Function Documentation

◆ operator=()

ConstBuffer_t& TTN::ConstBuffer_t::operator= ( const Buffer_t buffer)
inline

Definition at line 151 of file TargetBuffer_t.h.

151 { BufferBase_t<double,const double, const std::vector<double> >::operator=(buffer); return *this;}

◆ operator[]()

const double & TTN::BufferBase_t< double , const double , const std::vector< double > >::operator[] ( typename std::vector< double >::size_type  idx) const
inlineinherited

Definition at line 79 of file TargetBuffer_t.h.

79  {
80  return m_ptr[optionalRangeCheck(idx)];
81  }

◆ optionalRangeCheck()

std::vector<double >::size_type TTN::BufferBase_t< double , const double , const std::vector< double > >::optionalRangeCheck ( typename std::vector< double >::size_type  idx) const
inlineprotectedinherited

Definition at line 98 of file TargetBuffer_t.h.

98  {
99  if (idx>=m_maxIndex || &(m_ptr[idx])<m_bufferStart || &(m_ptr[idx])>=m_bufferEnd) {
101  }
102  return idx;
103  }

◆ optionalRangeCheckUpperBound()

std::vector<double >::size_type TTN::BufferBase_t< double , const double , const std::vector< double > >::optionalRangeCheckUpperBound ( typename std::vector< double >::size_type  idx) const
inlineprotectedinherited

Definition at line 104 of file TargetBuffer_t.h.

104  {
105  // allow for idx==0
106  if (idx>0 && (idx-1>=m_maxIndex || &(m_ptr[idx-1])<m_bufferStart || &(m_ptr[idx-1])>=m_bufferEnd)) {
108  }
109  return idx;
110  }

◆ throwRangeError()

void TTN::BufferBase_t< double , const double , const std::vector< double > >::throwRangeError ( typename std::vector< double >::size_type  idx) const
protectedinherited

◆ upper_bound_at()

const double & TTN::BufferBase_t< double , const double , const std::vector< double > >::upper_bound_at ( typename std::vector< double >::size_type  idx) const
inlineinherited

Definition at line 83 of file TargetBuffer_t.h.

83  {
85  }

Member Data Documentation

◆ m_bufferEnd

const double * TTN::BufferBase_t< double , const double , const std::vector< double > >::m_bufferEnd
protectedinherited

Definition at line 115 of file TargetBuffer_t.h.

◆ m_bufferStart

const double * TTN::BufferBase_t< double , const double , const std::vector< double > >::m_bufferStart
protectedinherited

Definition at line 114 of file TargetBuffer_t.h.

◆ m_maxIndex

std::vector<double >::size_type TTN::BufferBase_t< double , const double , const std::vector< double > >::m_maxIndex
protectedinherited

Definition at line 113 of file TargetBuffer_t.h.

◆ m_ptr

const double * TTN::BufferBase_t< double , const double , const std::vector< double > >::m_ptr
protectedinherited

Definition at line 88 of file TargetBuffer_t.h.


The documentation for this class was generated from the following file:
TTN::BufferBase_t< double, const double, const std::vector< double > >::optionalRangeCheck
std::vector< double >::size_type optionalRangeCheck(typename std::vector< double >::size_type idx) const
Definition: TargetBuffer_t.h:98
TTN::BufferBase_t< double, const double, const std::vector< double > >::m_bufferStart
const double * m_bufferStart
Definition: TargetBuffer_t.h:114
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
TTN::BufferBase_t< double, const double, const std::vector< double > >::m_ptr
const double * m_ptr
Definition: TargetBuffer_t.h:88
TTN::BufferBase_t< double, const double, const std::vector< double > >::m_bufferEnd
const double * m_bufferEnd
Definition: TargetBuffer_t.h:115
TTN::BufferBase_t< double, const double, const std::vector< double > >::throwRangeError
void throwRangeError(typename std::vector< double >::size_type idx) const
TTN::BufferBase_t< double, const double, const std::vector< double > >::m_maxIndex
std::vector< double >::size_type m_maxIndex
Definition: TargetBuffer_t.h:113
TTN::BufferBase_t< double, const double, const std::vector< double > >::optionalRangeCheckUpperBound
std::vector< double >::size_type optionalRangeCheckUpperBound(typename std::vector< double >::size_type idx) const
Definition: TargetBuffer_t.h:104
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69