ARTS 2.5.4 (git: 31ce4f0e)
Quantum::Number::Value Struct Reference

A complete quantum number value with type information. More...

#include <quantum_numbers.h>

Public Member Functions

constexpr Value (Type t=Type::FINAL)
 
 Value (const Value &)=default
 
 Value (Value &&) noexcept=default
 
Valueoperator= (const Value &)=default
 
Valueoperator= (Value &&) noexcept=default
 
constexpr Value (Type t, Rational upp_, Rational low_)
 
constexpr Value (std::string_view s)
 Default constructor from some string of values. More...
 
constexpr Rational upp () const noexcept
 Returns the upper quantum number rational if it exists or an undefined. More...
 
constexpr Rational low () const noexcept
 Returns the lower quantum number rational if it exists or an undefined. More...
 
String str_upp () const noexcept
 Returns the upper quantum number string copy. More...
 
String str_low () const noexcept
 Returns the lower quantum number string copy. More...
 
void swap_values (Value &x)
 Legacy way to swap the values between two Values. More...
 
constexpr void set (std::string_view s, bool upp)
 Set level value. More...
 
constexpr LevelMatch operator== (Value other) const noexcept
 Returns a description of whether both levels match. More...
 
bofstreamwrite (bofstream &bof) const
 
bifstreamread (bifstream &bif)
 
constexpr bool good () const
 

Public Attributes

Type type
 
TwoLevelValueHolder qn
 

Friends

std::ostream & operator<< (std::ostream &os, Value x)
 Standard output. More...
 
std::istream & operator>> (std::istream &is, Value &x)
 Standard input. More...
 

Detailed Description

A complete quantum number value with type information.

Definition at line 686 of file quantum_numbers.h.

Constructor & Destructor Documentation

◆ Value() [1/5]

constexpr Quantum::Number::Value::Value ( Type  t = Type::FINAL)
inlineconstexpr

Definition at line 690 of file quantum_numbers.h.

Referenced by swap_values().

◆ Value() [2/5]

Quantum::Number::Value::Value ( const Value )
default

◆ Value() [3/5]

Quantum::Number::Value::Value ( Value &&  )
defaultnoexcept

◆ Value() [4/5]

◆ Value() [5/5]

constexpr Quantum::Number::Value::Value ( std::string_view  s)
inlineconstexpr

Default constructor from some string of values.

Definition at line 716 of file quantum_numbers.h.

References ARTS_USER_ERROR_IF, Quantum::Number::count_items(), Quantum::Number::items(), Quantum::Number::ValueHolder::s, and Quantum::Number::value_holder().

Member Function Documentation

◆ good()

constexpr bool Quantum::Number::Value::good ( ) const
inlineconstexpr

Definition at line 810 of file quantum_numbers.h.

References operator==().

◆ low()

constexpr Rational Quantum::Number::Value::low ( ) const
inlineconstexprnoexcept

◆ operator=() [1/2]

Value & Quantum::Number::Value::operator= ( const Value )
default

◆ operator=() [2/2]

Value & Quantum::Number::Value::operator= ( Value &&  )
defaultnoexcept

◆ operator==()

constexpr LevelMatch Quantum::Number::Value::operator== ( Value  other) const
inlineconstexprnoexcept

Returns a description of whether both levels match.

Note that the LevelMatch type should automatically transform to bool so there's no need for extra work if this is your target question

Parameters
otherAnother value
Returns
constexpr LevelMatch

Definition at line 784 of file quantum_numbers.h.

References Quantum::Number::common_value_type(), Quantum::Number::TwoLevelValueHolder::low, Quantum::Number::ValueHolder::s, Quantum::Number::TwoLevelValueHolder::upp, and Quantum::Number::StringValue::x.

◆ read()

bifstream & Quantum::Number::Value::read ( bifstream bif)

◆ set()

constexpr void Quantum::Number::Value::set ( std::string_view  s,
bool  upp 
)
inlineconstexpr

◆ str_low()

String Quantum::Number::Value::str_low ( ) const
noexcept

◆ str_upp()

String Quantum::Number::Value::str_upp ( ) const
noexcept

◆ swap_values()

void Quantum::Number::Value::swap_values ( Value x)

Legacy way to swap the values between two Values.

Definition at line 1028 of file quantum_numbers.cc.

References qn, Value(), and var_string().

◆ upp()

constexpr Rational Quantum::Number::Value::upp ( ) const
inlineconstexprnoexcept

◆ write()

bofstream & Quantum::Number::Value::write ( bofstream bof) const

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
Value  x 
)
friend

Standard output.

Definition at line 35 of file quantum_numbers.cc.

◆ operator>>

std::istream & operator>> ( std::istream &  is,
Value x 
)
friend

Standard input.

Definition at line 39 of file quantum_numbers.cc.

Member Data Documentation

◆ qn

TwoLevelValueHolder Quantum::Number::Value::qn

Definition at line 688 of file quantum_numbers.h.

Referenced by str_low(), str_upp(), and swap_values().

◆ type

Type Quantum::Number::Value::type

Definition at line 687 of file quantum_numbers.h.

Referenced by str_low(), and str_upp().


The documentation for this struct was generated from the following files: