ARTS 2.5.4 (git: 31ce4f0e)
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. More...
 
 ValueList (std::string_view upp, std::string_view low)
 From legacy text. More...
 
 ValueList (Array< Value > values_)
 From values (resorted) More...
 
 ValueList ()
 Empty. More...
 
Array< Value >::iterator begin ()
 For iterators. More...
 
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. More...
 
Index nelem () const
 Return number of quantum numbers. More...
 
bool perpendicular (const ValueList &that) const ARTS_NOEXCEPT
 Finds whether two ValueList describe completely different sets of quantum numbers (e.g., local vs global) More...
 
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. More...
 
const Valueoperator[] (Type t) const ARTS_NOEXCEPT
 Returns the value of the Type (assumes it exist) More...
 
Valueoperator[] (Index i)
 Legacy manipulation operator access. More...
 
Valueadd (Type t)
 Add for manipulation. More...
 
Valueadd (Value v)
 Add for manipulation. More...
 
void set (Value v)
 Sets the value if it exists or adds it otherwise. More...
 
void set (Index i, std::string_view upp, std::string_view low)
 Set a value in value list. More...
 
CheckMatch operator== (const ValueList &other) const noexcept
 Returns upper and lower matching status. More...
 
void add_type_wo_sort (Type)
 Add a type without sorting (WARNING, many things might break if you don't sort in the end) More...
 
bool good () const
 

Private Member Functions

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

Private Attributes

Array< Valuevalues
 

Friends

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

Detailed Description

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

Definition at line 862 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 879 of file quantum_numbers.h.

◆ ValueList() [4/4]

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

Empty.

Definition at line 884 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 1057 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 891 of file quantum_numbers.h.

◆ cbegin() [1/2]

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

Definition at line 889 of file quantum_numbers.h.

◆ cbegin() [2/2]

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

Definition at line 897 of file quantum_numbers.h.

◆ cend() [1/2]

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

Definition at line 890 of file quantum_numbers.h.

◆ cend() [2/2]

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

Definition at line 900 of file quantum_numbers.h.

◆ 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 894 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 1141 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 908 of file quantum_numbers.h.

References Array< base >::nelem().

◆ operator==()

CheckMatch Quantum::Number::ValueList::operator== ( const ValueList other) const
noexcept

◆ operator[]() [1/2]

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

Legacy manipulation operator access.

Definition at line 933 of file quantum_numbers.h.

References Quantum::Number::ValueHolder::i.

◆ 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 863 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: