LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 const_reference () const
 
 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 1218 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 1226 of file sparse_vector.h.

1226 : 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 1227 of file sparse_vector.h.

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

1227 : reference(&value) {}
reference(value_type *pValue=0)
std::string value(boost::any const &)
template<typename T>
lar::sparse_vector< T >::reference::reference ( const const_reference from)
inlineexplicitprotected

Definition at line 1239 of file sparse_vector.h.

1239 : 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 1205 of file sparse_vector.h.

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

Definition at line 1233 of file sparse_vector.h.

const_reference(const value_type *pValue=0)
template<typename T>
lar::sparse_vector< T >::const_reference::operator value_type ( ) const
inlineexplicitinherited

Definition at line 1204 of file sparse_vector.h.

1204 { 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 1235 of file sparse_vector.h.

1236  { 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 1230 of file sparse_vector.h.

1231  { 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 1219 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 1199 of file sparse_vector.h.


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