ifw-daq  1.0.0
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 FormattedKeyword 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) noexcept
 
BasicKeywordoperator= (BasicKeyword &&rhs) noexcept=default
 
BasicKeywordoperator= (BasicKeyword const &rhs)=default
 
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
 
ValueType value
 
std::optional< std::string > comment
 

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 FormattedKeyword 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 51 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 44 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 
)
noexcept

Definition at line 51 of file keyword.cpp.

Member Function Documentation

◆ operator!=()

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

Compares all members for inequality.

Definition at line 63 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 68 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 58 of file keyword.cpp.

Member Data Documentation

◆ comment

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

Definition at line 81 of file keyword.hpp.

◆ name

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

Definition at line 79 of file keyword.hpp.

◆ value

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

Definition at line 80 of file keyword.hpp.


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