ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Classes | Public Member Functions | Related Functions | List of all members
daq::fits::LiteralKeyword Class Referencefinal

Represents the literal 80-character FITS keyword record. More...

#include <keyword.hpp>

Classes

struct  Components
 Decomposed components a literal keyword. More...
 

Public Member Functions

 LiteralKeyword () noexcept
 Initializes an empty record (filled with ' ' characters) More...
 
 LiteralKeyword (std::array< char, constants::RECORD_LENGTH > record)
 Construct literal keyword from a fixed size record. More...
 
 LiteralKeyword (std::string_view record)
 Construct literal keyword from string_view. More...
 
 LiteralKeyword (LiteralKeyword const &other) noexcept
 
LiteralKeywordoperator= (LiteralKeyword const &other) noexcept
 
constexpr KeywordType GetType () const noexcept
 
constexpr KeywordNameView GetName () const &noexcept
 Query logical keyword name. More...
 
KeywordNameView GetName () &&noexcept=delete
 
std::string_view GetRecord () const &noexcept
 
constexpr std::string_view GetRecord () &&noexcept=delete
 
constexpr Components GetComponents () const &noexcept
 Get components of the keyword in its literal form with insignifant whitespaces removed. More...
 

Related Functions

(Note that these are not member functions.)

bool operator< (LiteralKeyword const &, LiteralKeyword const &) noexcept
 Sort by logical keyword name (not DICD sort) More...
 
bool operator== (LiteralKeyword const &lhs, LiteralKeyword const &rhs) noexcept
 Compares equally if keyword record in lhs is the same as rhs (char for char). More...
 
bool operator!= (LiteralKeyword const &, LiteralKeyword const &) noexcept
 Compares inequally if keyword record in lhs is not the same as rhs (char for char). More...
 
bool operator< (LiteralKeyword const &, ValueKeyword const &) noexcept
 Keyword sorting function. More...
 
bool operator< (ValueKeyword const &, LiteralKeyword const &) noexcept
 Keyword sorting function. More...
 

Detailed Description

Represents the literal 80-character FITS keyword record.

Definition at line 125 of file keyword.hpp.


Class Documentation

◆ daq::fits::LiteralKeyword::Components

struct daq::fits::LiteralKeyword::Components

Decomposed components a literal keyword.

Definition at line 130 of file keyword.hpp.

Class Members
string_view comment Comment may be empty.
string_view name
KeywordType type
string_view value

Constructor & Destructor Documentation

◆ LiteralKeyword() [1/4]

daq::fits::LiteralKeyword::LiteralKeyword ( )
noexcept

Initializes an empty record (filled with ' ' characters)

Definition at line 363 of file keyword.cpp.

◆ LiteralKeyword() [2/4]

daq::fits::LiteralKeyword::LiteralKeyword ( std::array< char, constants::RECORD_LENGTH >  record)
explicit

Construct literal keyword from a fixed size record.

Parameters
recordFITS keyword record literal.

Definition at line 369 of file keyword.cpp.

◆ LiteralKeyword() [3/4]

daq::fits::LiteralKeyword::LiteralKeyword ( std::string_view  record)
explicit

Construct literal keyword from string_view.

Note
If string_view is empty this will be interpreted as the (valid) keyword " ".
Parameters
recordliteral keyword record.
Exceptions
std::invalid_argumentif record is invalid (size() > 80).

Definition at line 378 of file keyword.cpp.

◆ LiteralKeyword() [4/4]

daq::fits::LiteralKeyword::LiteralKeyword ( LiteralKeyword const &  other)
noexcept

Definition at line 393 of file keyword.cpp.

Member Function Documentation

◆ GetComponents()

constexpr Components daq::fits::LiteralKeyword::GetComponents ( ) const &
inlineconstexprnoexcept

Get components of the keyword in its literal form with insignifant whitespaces removed.

Definition at line 202 of file keyword.hpp.

◆ GetName() [1/2]

KeywordNameView daq::fits::LiteralKeyword::GetName ( ) &&
deletenoexcept

◆ GetName() [2/2]

constexpr KeywordNameView daq::fits::LiteralKeyword::GetName ( ) const &
inlineconstexprnoexcept

Query logical keyword name.

The logical keyword name depends on the type of keyword:

  • Type::Value: Returns same value as GetName() but without trailing whitespaces.
  • Type::Eso: Returns the logical keyword name following "HIEARCH ESO" up to the first "=", without leading or trailing whitespaces.
  • Type::Commentary: Keywords that do not fall into
Returns
the logical keyword name which depends on the type of keyword and the type.

Definition at line 186 of file keyword.hpp.

◆ GetRecord() [1/2]

constexpr std::string_view daq::fits::LiteralKeyword::GetRecord ( ) &&
constexprdeletenoexcept

◆ GetRecord() [2/2]

std::string_view daq::fits::LiteralKeyword::GetRecord ( ) const &
noexcept
Returns
the FITS keyword record without trailing blank characters.
Todo:
Rename to GetLogicalRecord?

Definition at line 415 of file keyword.cpp.

◆ GetType()

constexpr KeywordType daq::fits::LiteralKeyword::GetType ( ) const
inlineconstexprnoexcept
Returns
Keyword type.

Definition at line 170 of file keyword.hpp.

◆ operator=()

LiteralKeyword & daq::fits::LiteralKeyword::operator= ( LiteralKeyword const &  other)
noexcept

Definition at line 398 of file keyword.cpp.

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( LiteralKeyword const &  ,
LiteralKeyword const &   
)
related

Compares inequally if keyword record in lhs is not the same as rhs (char for char).

Definition at line 428 of file keyword.cpp.

◆ operator<() [1/3]

bool operator< ( LiteralKeyword const &  ,
LiteralKeyword const &   
)
related

Sort by logical keyword name (not DICD sort)

Definition at line 420 of file keyword.cpp.

◆ operator<() [2/3]

bool operator< ( LiteralKeyword const &  ,
ValueKeyword const &   
)
related

Keyword sorting function.

Definition at line 504 of file keyword.cpp.

◆ operator<() [3/3]

bool operator< ( ValueKeyword const &  ,
LiteralKeyword const &   
)
related

Keyword sorting function.

Definition at line 511 of file keyword.cpp.

◆ operator==()

bool operator== ( LiteralKeyword const &  lhs,
LiteralKeyword const &  rhs 
)
related

Compares equally if keyword record in lhs is the same as rhs (char for char).

Definition at line 424 of file keyword.cpp.


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