LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
cluster::details::MultiValue Class Reference

Class holding a value of one among some selected types... More...

#include "OverriddenClusterParamsAlg.h"

Public Types

using Measure_t = cluster::details::Measure_t< float >
 

Public Member Functions

 MultiValue ()
 
template<typename T >
MultiValueoperator= (T)
 Sets the value from a value of type T; undefined by default. More...
 
template<typename T >
 operator T () const
 Converts the value to type T; undefined by default. More...
 
template<>
MultiValueoperator= (size_t value)
 
template<>
MultiValueoperator= (float value)
 
template<>
MultiValueoperator= (Measure_t value)
 

Public Attributes

union {
   Measure_t   measure_value
 
   float   float_value
 
   size_t   size_t_value
 
}; 
 

Detailed Description

Class holding a value of one among some selected types...

The result of default construction is not defined. That's basically throwing away one of the pillars of C++.

This horrible class is supposed to keep a value that you give to it, and give it back to you if you ask nicely. Of course, if you ask something you did not give it first, it will become naughty. In other words, it's caller's responsibility not to ask float when it assigned size_t.

Definition at line 41 of file OverriddenClusterParamsAlg.h.

Member Typedef Documentation

Constructor & Destructor Documentation

cluster::details::MultiValue::MultiValue ( )
inline

Default constructor; it's here only to allow for vectors to be resized and its effect is undefined. This class is not to be considered valid until it's assigned a value with the operator= .

Definition at line 55 of file OverriddenClusterParamsAlg.h.

References operator=().

55 {}

Member Function Documentation

template<typename T >
cluster::details::MultiValue::operator T ( ) const

Converts the value to type T; undefined by default.

template<typename T >
MultiValue& cluster::details::MultiValue::operator= ( )

Sets the value from a value of type T; undefined by default.

Referenced by MultiValue().

template<>
MultiValue& cluster::details::MultiValue::operator= ( size_t  value)

Definition at line 339 of file OverriddenClusterParamsAlg.h.

References size_t_value, and fhicl::detail::atom::value().

340  { size_t_value = value; return *this; }
std::string value(boost::any const &)
template<>
MultiValue& cluster::details::MultiValue::operator= ( float  value)

Definition at line 347 of file OverriddenClusterParamsAlg.h.

References float_value, and fhicl::detail::atom::value().

348  { float_value = value; return *this; }
std::string value(boost::any const &)
template<>
MultiValue& cluster::details::MultiValue::operator= ( Measure_t  value)

Definition at line 355 of file OverriddenClusterParamsAlg.h.

References measure_value, and fhicl::detail::atom::value().

356  { measure_value = value; return *this; }
std::string value(boost::any const &)

Member Data Documentation

union { ... }
float cluster::details::MultiValue::float_value

Definition at line 48 of file OverriddenClusterParamsAlg.h.

Referenced by operator=().

Measure_t cluster::details::MultiValue::measure_value

Definition at line 47 of file OverriddenClusterParamsAlg.h.

Referenced by operator=().

size_t cluster::details::MultiValue::size_t_value

Definition at line 49 of file OverriddenClusterParamsAlg.h.

Referenced by operator=().


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