ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Public Member Functions | Public Attributes | List of all members
daq::fits::BasicKeyword< Trait > Struct Template Referencefinal

A type safe version of LiteralKeyword that consist of the three basic components of a FITS keyword keyword record: name, value and optional comment. More...

#include <keyword.hpp>

+ Inheritance diagram for daq::fits::BasicKeyword< Trait >:

Public Member Functions

 BasicKeyword ()=default
 
 BasicKeyword (BasicKeyword const &)=default
 
 BasicKeyword (BasicKeyword &&) noexcept=default
 
 BasicKeyword (std::string name, char const *string_value, std::optional< std::string > comment=std::nullopt)
 
 BasicKeyword (std::string name, ValueType value, std::optional< std::string > comment=std::nullopt)
 
BasicKeywordoperator= (BasicKeyword &&rhs) noexcept=default
 
BasicKeywordoperator= (BasicKeyword const &rhs)=default
 
constexpr KeywordNameView GetName () const &noexcept
 Query logical keyword name. More...
 
KeywordNameView GetName () &&=delete
 
bool operator== (BasicKeyword const &rhs) const noexcept
 Compares all members for equality. More...
 
bool operator!= (BasicKeyword const &rhs) const noexcept
 Compares all members for inequality. More...
 
bool operator< (BasicKeyword const &rhs) const noexcept
 Uses name property as the sorting index. More...
 

Public Attributes

std::string name
 Trimmed keyword name. More...
 
ValueType value
 
std::optional< std::string > comment
 Trimmed keyword comment. More...
 

Additional Inherited Members

- Public Types inherited from daq::fits::BasicKeywordBase
using ValueType = std::variant< std::string, int64_t, uint64_t, double, bool >
 

Detailed Description

template<class Trait>
struct daq::fits::BasicKeyword< Trait >

A type safe version of LiteralKeyword that consist of the three basic components of a FITS keyword keyword record: name, value and optional comment.

Note
name should be used for the logical keyword name, not the keyword name according to FITS standard. E.g. the ESO hiearchical keywords all have the keyword name HIERARCH according to the standard, but this structure should instead use the logical fields where e.g. "HIERARCH ESO DPR CATG" is the logical keyword name.

It does not model any specific unit, only the value type. Therefore it is not strictly necessary to have all possible types represented in ValueType (e.g. both singel and double precision floats).

The idea is that the unit, formatting and ranges is provided provided by dictionaries.

It also typically requires a dictionary to be able to understand how to parse value.

Definition at line 266 of file keyword.hpp.

Constructor & Destructor Documentation

◆ BasicKeyword() [1/5]

template<class Trait >
daq::fits::BasicKeyword< Trait >::BasicKeyword ( )
default

◆ BasicKeyword() [2/5]

template<class Trait >
daq::fits::BasicKeyword< Trait >::BasicKeyword ( BasicKeyword< Trait > const &  )
default

◆ BasicKeyword() [3/5]

template<class Trait >
daq::fits::BasicKeyword< Trait >::BasicKeyword ( BasicKeyword< Trait > &&  )
defaultnoexcept

◆ BasicKeyword() [4/5]

template<class Trait >
daq::fits::BasicKeyword< Trait >::BasicKeyword ( std::string  name,
char const *  string_value,
std::optional< std::string >  comment = std::nullopt 
)

Definition at line 448 of file keyword.cpp.

◆ BasicKeyword() [5/5]

template<class Trait >
daq::fits::BasicKeyword< Trait >::BasicKeyword ( std::string  name,
ValueType  value,
std::optional< std::string >  comment = std::nullopt 
)

Definition at line 456 of file keyword.cpp.

Member Function Documentation

◆ GetName() [1/2]

template<class Trait >
KeywordNameView daq::fits::BasicKeyword< Trait >::GetName ( ) &&
delete

◆ GetName() [2/2]

template<class Trait >
constexpr KeywordNameView daq::fits::BasicKeyword< Trait >::GetName ( ) const &
inlineconstexprnoexcept

Query logical keyword name.

Returns
logical keyword name.

Definition at line 285 of file keyword.hpp.

◆ operator!=()

template<class Trait >
bool daq::fits::BasicKeyword< Trait >::operator!= ( BasicKeyword< Trait > const &  rhs) const
noexcept

Compares all members for inequality.

Definition at line 469 of file keyword.cpp.

◆ operator<()

template<class Trait >
bool daq::fits::BasicKeyword< Trait >::operator< ( BasicKeyword< Trait > const &  rhs) const
noexcept

Uses name property as the sorting index.

Definition at line 474 of file keyword.cpp.

◆ operator=() [1/2]

template<class Trait >
BasicKeyword& daq::fits::BasicKeyword< Trait >::operator= ( BasicKeyword< Trait > &&  rhs)
defaultnoexcept

◆ operator=() [2/2]

template<class Trait >
BasicKeyword& daq::fits::BasicKeyword< Trait >::operator= ( BasicKeyword< Trait > const &  rhs)
default

◆ operator==()

template<class Trait >
bool daq::fits::BasicKeyword< Trait >::operator== ( BasicKeyword< Trait > const &  rhs) const
noexcept

Compares all members for equality.

Definition at line 464 of file keyword.cpp.

Member Data Documentation

◆ comment

template<class Trait >
std::optional<std::string> daq::fits::BasicKeyword< Trait >::comment

Trimmed keyword comment.

Definition at line 311 of file keyword.hpp.

◆ name

template<class Trait >
std::string daq::fits::BasicKeyword< Trait >::name

Trimmed keyword name.

Definition at line 306 of file keyword.hpp.

◆ value

template<class Trait >
ValueType daq::fits::BasicKeyword< Trait >::value

Definition at line 307 of file keyword.hpp.


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