Belle II Software development
DiscreteValue< T, ATag > Class Template Reference

Representation for a discrete position in an array of discrete positions. More...

#include <DiscreteValue.h>

Inheritance diagram for DiscreteValue< T, ATag >:

Public Types

using Array = std::vector< T >
 The type of the array which contains the underlying values.
 

Public Member Functions

 DiscreteValue ()=default
 Default constructor for to obtain a valid object in all contexts.
 
 DiscreteValue (const Super &iter)
 Constructor from underlying iterator type.
 
 DiscreteValue (T &value)
 Constructor from a reference to the underlying type Care must be taken to feed it a reference that comes from a vector.
 
 operator const T & () const
 Allow explicit conversion to the container type.
 

Static Public Member Functions

static std::array< This, 2 > getRange (Array &values)
 Extract the range from an array providing the discrete values.
 

Private Types

using Super = typename std::vector< T >::const_iterator
 Type of the base class.
 
using This = DiscreteValue< T, ATag >
 Type of this class.
 

Friends

std::ostream & operator<< (std::ostream &output, const This &discreteValue)
 Output operator for debugging.
 

Detailed Description

template<class T, class ATag = T>
class Belle2::TrackFindingCDC::DiscreteValue< T, ATag >

Representation for a discrete position in an array of discrete positions.

Definition at line 23 of file DiscreteValue.h.

Member Typedef Documentation

◆ Array

using Array = std::vector<T>

The type of the array which contains the underlying values.

Definition at line 55 of file DiscreteValue.h.

◆ Super

using Super = typename std::vector<T>::const_iterator
private

Type of the base class.

Definition at line 27 of file DiscreteValue.h.

◆ This

using This = DiscreteValue<T, ATag>
private

Type of this class.

Definition at line 30 of file DiscreteValue.h.

Constructor & Destructor Documentation

◆ DiscreteValue() [1/2]

DiscreteValue ( const Super iter)
inlineexplicit

Constructor from underlying iterator type.

Definition at line 40 of file DiscreteValue.h.

40: Super(iter) {}
typename std::vector< T >::const_iterator Super
Type of the base class.
Definition: DiscreteValue.h:27

◆ DiscreteValue() [2/2]

DiscreteValue ( T &  value)
inlineexplicit

Constructor from a reference to the underlying type Care must be taken to feed it a reference that comes from a vector.

Definition at line 44 of file DiscreteValue.h.

44: Super(&value) {}

Member Function Documentation

◆ getRange()

static std::array< This, 2 > getRange ( Array values)
inlinestatic

Extract the range from an array providing the discrete values.

Definition at line 59 of file DiscreteValue.h.

60 { return {{ This(values.front()), This(values.back()) }}; }
DiscreteValue< T, ATag > This
Type of this class.
Definition: DiscreteValue.h:30

◆ operator const T &()

operator const T & ( ) const
inlineexplicit

Allow explicit conversion to the container type.

Definition at line 47 of file DiscreteValue.h.

48 { return **this; }

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  output,
const This discreteValue 
)
friend

Output operator for debugging.

Definition at line 51 of file DiscreteValue.h.

52 { return output << *discreteValue; }

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