Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | Friends | List of all members
RPDUtils::OptionalToolProperty< T > Class Template Reference

#include <RPDUtils.h>

Collaboration diagram for RPDUtils::OptionalToolProperty< T >:

Public Member Functions

 OptionalToolProperty ()
 
 OptionalToolProperty (T value)
 
bool has_value () const
 
T constvalue () const
 
 operator T& ()
 

Private Attributes

m_value {}
 
bool m_hasValue = false
 

Friends

template<class V >
std::ostream & operator<< (std::ostream &os, OptionalToolProperty< V > const &obj)
 

Detailed Description

template<class T>
class RPDUtils::OptionalToolProperty< T >

Definition at line 44 of file RPDUtils.h.

Constructor & Destructor Documentation

◆ OptionalToolProperty() [1/2]

template<class T >
RPDUtils::OptionalToolProperty< T >::OptionalToolProperty ( )
default

◆ OptionalToolProperty() [2/2]

template<class T >
RPDUtils::OptionalToolProperty< T >::OptionalToolProperty ( value)
explicit

Definition at line 27 of file RPDUtils.cxx.

27 : m_value(std::move(value)) {}

Member Function Documentation

◆ has_value()

template<class T >
bool RPDUtils::OptionalToolProperty< T >::has_value

Definition at line 28 of file RPDUtils.cxx.

28  {
29  return m_hasValue;
30  }

◆ operator T&()

template<class T >
RPDUtils::OptionalToolProperty< T >::operator T&

Definition at line 47 of file RPDUtils.cxx.

47  {
48  // this method is called when the value is set from python, so this now has a value
49  m_hasValue = true;
50  return m_value;
51  }

◆ value()

template<class T >
T const & RPDUtils::OptionalToolProperty< T >::value

Definition at line 31 of file RPDUtils.cxx.

31  {
32  if (!m_hasValue) {
33  throw std::runtime_error("accessed null OptionalToolProperty!");
34  }
35  return m_value;
36  }

Friends And Related Function Documentation

◆ operator<<

template<class T >
template<class V >
std::ostream& operator<< ( std::ostream &  os,
OptionalToolProperty< V > const obj 
)
friend

Member Data Documentation

◆ m_hasValue

template<class T >
bool RPDUtils::OptionalToolProperty< T >::m_hasValue = false
private

Definition at line 57 of file RPDUtils.h.

◆ m_value

template<class T >
T RPDUtils::OptionalToolProperty< T >::m_value {}
private

Definition at line 56 of file RPDUtils.h.


The documentation for this class was generated from the following files:
RPDUtils::OptionalToolProperty::m_value
T m_value
Definition: RPDUtils.h:56
RPDUtils::OptionalToolProperty::m_hasValue
bool m_hasValue
Definition: RPDUtils.h:57
RPDUtils::OptionalToolProperty::value
T const & value() const
Definition: RPDUtils.cxx:31