ARTS 2.5.11 (git: 6827797f)
Quantum::Number::ValueList Class Reference

A list of many quantum numbers. Should always remain sorted. More...

#include <quantum_numbers.h>

Public Member Functions

 ValueList (std::string_view s, bool legacy=false)
 From text.
 
 ValueList (std::string_view upp, std::string_view low)
 From legacy text.
 
std::strong_ordering operator<=> (const ValueList &v) const
 
 ValueList (Array< Value > values_)
 From values (resorted)
 
 ValueList ()
 Empty.
 
Array< Value >::iterator begin ()
 For iterators.
 
Array< Value >::iterator end ()
 
Array< Value >::iterator cbegin ()
 
Array< Value >::iterator cend ()
 
Array< Value >::const_iterator begin () const
 
Array< Value >::const_iterator end () const
 
Array< Value >::const_iterator cbegin () const
 
Array< Value >::const_iterator cend () const
 
void finalize ()
 Should always be called before this object is handed to another user.
 
Index nelem () const ARTS_NOEXCEPT
 Return number of quantum numbers.
 
bool perpendicular (const ValueList &that) const ARTS_NOEXCEPT
 Finds whether two ValueList describe completely different sets of quantum numbers (e.g., local vs global)
 
template<typename... Types>
bool has (Types... ts) const ARTS_NOEXCEPT
 Returns whether all the Types are part of the list, the types must be sorted.
 
const Valueoperator[] (Type t) const ARTS_NOEXCEPT
 Returns the value of the Type (assumes it exist)
 
Valueoperator[] (Index i)
 Legacy manipulation operator access.
 
Valueadd (Type t)
 Add for manipulation.
 
Valueadd (Value v)
 Add for manipulation.
 
void set (Value v)
 Sets the value if it exists or adds it otherwise.
 
void set (Index i, std::string_view upp, std::string_view low)
 Set a value in value list.
 
CheckMatch check_match (const ValueList &other) const ARTS_NOEXCEPT
 Returns upper and lower matching status.
 
void add_type_wo_sort (Type)
 Add a type without sorting (WARNING, many things might break if you don't sort in the end)
 
bool good () const
 

Private Member Functions

void sort_by_type ()
 Internal sort function. Should be called whenever new items are created.
 
bool has_unique_increasing_types () const
 Internal check function. Remember to sort by type before calling this.
 

Private Attributes

Array< Valuevalues
 

Friends

std::ostream & operator<< (std::ostream &os, const ValueList &vl)
 ouptut stream if all values
 
std::istream & operator>> (std::istream &is, ValueList &vl)
 input stream must have pre-set size
 

Detailed Description

A list of many quantum numbers. Should always remain sorted.

Definition at line 898 of file quantum_numbers.h.

Constructor & Destructor Documentation

◆ ValueList() [1/4]

Quantum::Number::ValueList::ValueList ( std::string_view  s,
bool  legacy = false 
)
explicit

◆ ValueList() [2/4]

Quantum::Number::ValueList::ValueList ( std::string_view  upp,
std::string_view  low 
)

◆ ValueList() [3/4]

Quantum::Number::ValueList::ValueList ( Array< Value values_)
inlineexplicit

From values (resorted)

Definition at line 924 of file quantum_numbers.h.

◆ ValueList() [4/4]

Quantum::Number::ValueList::ValueList ( )
inline

Empty.

Definition at line 929 of file quantum_numbers.h.

Member Function Documentation

◆ add() [1/2]

Value & Quantum::Number::ValueList::add ( Type  t)

Add for manipulation.

Definition at line 330 of file quantum_numbers.cc.

References begin(), end(), finalize(), v, and values.

Referenced by Quantum::Number::from_hitran(), Absorption::ReadFromArtscat5Stream(), set(), and ValueList().

◆ add() [2/2]

Value & Quantum::Number::ValueList::add ( Value  v)

Add for manipulation.

Definition at line 339 of file quantum_numbers.cc.

References begin(), end(), finalize(), v, and values.

◆ add_type_wo_sort()

void Quantum::Number::ValueList::add_type_wo_sort ( Type  t)

Add a type without sorting (WARNING, many things might break if you don't sort in the end)

Definition at line 1048 of file quantum_numbers.cc.

References values.

Referenced by Quantum::Number::LocalState::set_unsorted_qns().

◆ begin() [1/2]

Array< Value >::iterator Quantum::Number::ValueList::begin ( )
inline

◆ begin() [2/2]

Array< Value >::const_iterator Quantum::Number::ValueList::begin ( ) const
inline

Definition at line 936 of file quantum_numbers.h.

◆ cbegin() [1/2]

Array< Value >::iterator Quantum::Number::ValueList::cbegin ( )
inline

Definition at line 934 of file quantum_numbers.h.

◆ cbegin() [2/2]

Array< Value >::const_iterator Quantum::Number::ValueList::cbegin ( ) const
inline

Definition at line 942 of file quantum_numbers.h.

◆ cend() [1/2]

Array< Value >::iterator Quantum::Number::ValueList::cend ( )
inline

Definition at line 935 of file quantum_numbers.h.

◆ cend() [2/2]

Array< Value >::const_iterator Quantum::Number::ValueList::cend ( ) const
inline

Definition at line 945 of file quantum_numbers.h.

◆ check_match()

CheckMatch Quantum::Number::ValueList::check_match ( const ValueList other) const

◆ end() [1/2]

Array< Value >::iterator Quantum::Number::ValueList::end ( )
inline

◆ end() [2/2]

Array< Value >::const_iterator Quantum::Number::ValueList::end ( ) const
inline

Definition at line 939 of file quantum_numbers.h.

◆ finalize()

void Quantum::Number::ValueList::finalize ( )

Should always be called before this object is handed to another user.

Definition at line 279 of file quantum_numbers.cc.

References ARTS_USER_ERROR_IF, has_unique_increasing_types(), and sort_by_type().

Referenced by add(), and ValueList().

◆ good()

bool Quantum::Number::ValueList::good ( ) const

Definition at line 1132 of file quantum_numbers.cc.

◆ has()

template<typename... Types>
bool Quantum::Number::ValueList::has ( Types...  ts) const
inline

◆ has_unique_increasing_types()

bool Quantum::Number::ValueList::has_unique_increasing_types ( ) const
private

Internal check function. Remember to sort by type before calling this.

Definition at line 53 of file quantum_numbers.cc.

References a, b, begin(), end(), and values.

Referenced by finalize().

◆ nelem()

Index Quantum::Number::ValueList::nelem ( ) const
inline

Return number of quantum numbers.

Definition at line 953 of file quantum_numbers.h.

References Array< base >::nelem().

◆ operator<=>()

std::strong_ordering Quantum::Number::ValueList::operator<=> ( const ValueList v) const
inline

Definition at line 914 of file quantum_numbers.h.

References v.

◆ operator[]() [1/2]

Value & Quantum::Number::ValueList::operator[] ( Index  i)
inline

Legacy manipulation operator access.

Definition at line 978 of file quantum_numbers.h.

◆ operator[]() [2/2]

const Value & Quantum::Number::ValueList::operator[] ( Type  t) const

Returns the value of the Type (assumes it exist)

Definition at line 323 of file quantum_numbers.cc.

References ARTS_ASSERT.

◆ perpendicular()

bool Quantum::Number::ValueList::perpendicular ( const ValueList that) const

Finds whether two ValueList describe completely different sets of quantum numbers (e.g., local vs global)

Definition at line 287 of file quantum_numbers.cc.

References ARTS_ASSERT.

◆ set() [1/2]

void Quantum::Number::ValueList::set ( Index  i,
std::string_view  upp,
std::string_view  low 
)

Set a value in value list.

Definition at line 356 of file quantum_numbers.cc.

References values, and var_string().

◆ set() [2/2]

◆ sort_by_type()

void Quantum::Number::ValueList::sort_by_type ( )
private

Internal sort function. Should be called whenever new items are created.

Definition at line 49 of file quantum_numbers.cc.

References a, b, begin(), and end().

Referenced by finalize().

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const ValueList vl 
)
friend

ouptut stream if all values

Definition at line 360 of file quantum_numbers.cc.

◆ operator>>

std::istream & operator>> ( std::istream &  is,
ValueList vl 
)
friend

input stream must have pre-set size

Definition at line 368 of file quantum_numbers.cc.

Member Data Documentation

◆ values

Array<Value> Quantum::Number::ValueList::values
private

Definition at line 899 of file quantum_numbers.h.

Referenced by add(), add_type_wo_sort(), has_unique_increasing_types(), set(), and ValueList().


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