LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar::sparse_vector< T >::reference Class Reference

A class representing a cell in a sparse vector. More...

#include "sparse_vector.h"

Inheritance diagram for lar::sparse_vector< T >::reference:
lar::sparse_vector< T >::const_reference

Public Member Functions

 reference (value_type *pValue=0)
 
 reference (value_type &value)
 
referenceoperator= (const reference &)=default
 
value_typeoperator= (value_type v)
 
 operator value_type & ()
 
 operator value_type () const
 
 operator const value_type & () const
 

Protected Member Functions

 reference (const const_reference &from)
 

Protected Attributes

const value_typeptr
 

Friends

class iterator
 

Detailed Description

template<typename T>
class lar::sparse_vector< T >::reference

A class representing a cell in a sparse vector.

This class is a little box allowing assignment of values into it; if the internal pointer is invalid (as in case of void cell), dereferencing or assigning will provoke a segmentation fault.

Definition at line 1435 of file sparse_vector.h.

Constructor & Destructor Documentation

template<typename T>
lar::sparse_vector< T >::reference::reference ( value_type pValue = 0)
inline

Definition at line 1443 of file sparse_vector.h.

1443 : const_reference(pValue) {}
const_reference(const value_type *pValue=0)
template<typename T>
lar::sparse_vector< T >::reference::reference ( value_type value)
inline

Definition at line 1444 of file sparse_vector.h.

References lar::const_value_box< T >::operator=().

1444 : reference(&value) {}
reference(value_type *pValue=0)
double value
Definition: spectrum.C:18
template<typename T>
lar::sparse_vector< T >::reference::reference ( const const_reference from)
inlineexplicitprotected

Definition at line 1452 of file sparse_vector.h.

1452 : const_reference(from) {}
const_reference(const value_type *pValue=0)

Member Function Documentation

template<typename T>
lar::sparse_vector< T >::const_reference::operator const value_type & ( ) const
inlineinherited

Definition at line 1424 of file sparse_vector.h.

1424 { return ptr ? *ptr : value_zero; }
static constexpr value_type value_zero
a representation of 0
template<typename T>
lar::sparse_vector< T >::const_reference::operator value_type ( ) const
inlineexplicitinherited

Definition at line 1423 of file sparse_vector.h.

1423 { return ptr ? *ptr : value_zero; }
static constexpr value_type value_zero
a representation of 0
template<typename T>
lar::sparse_vector< T >::reference::operator value_type & ( )
inlineexplicit

Definition at line 1449 of file sparse_vector.h.

1449 { return const_cast<value_type&>(*const_reference::ptr); }
T value_type
type of the stored values
template<typename T>
reference& lar::sparse_vector< T >::reference::operator= ( const reference )
default
template<typename T>
value_type& lar::sparse_vector< T >::reference::operator= ( value_type  v)
inline

Definition at line 1447 of file sparse_vector.h.

1447 { return const_cast<value_type&>(*const_reference::ptr) = v; }
T value_type
type of the stored values

Friends And Related Function Documentation

template<typename T>
friend class iterator
friend

Definition at line 1436 of file sparse_vector.h.

Member Data Documentation

template<typename T>
const value_type* lar::sparse_vector< T >::const_reference::ptr
protectedinherited

Definition at line 1417 of file sparse_vector.h.


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