RTC Toolkit 6.0.0-pre2
Loading...
Searching...
No Matches
fitsColumnFormat.hpp
Go to the documentation of this file.
1
12#ifndef RTCTK_COMPONENTFRAMEWORK_FITSCOLUMNFORMAT_HPP
13#define RTCTK_COMPONENTFRAMEWORK_FITSCOLUMNFORMAT_HPP
14
15#include <cstddef>
16#include <fmt/core.h>
17#include <fmt/format.h>
18#include <gsl/span>
19#include <limits>
20#include <optional>
21#include <string>
22#include <vector>
23
25
30template <class T, typename _ = void>
32
36template <class T>
37std::string GetFitsType(const std::optional<size_t> length = FitsColumnFormat<T>::COUNT) {
39 // ignore overide setting for scalar values
40 return std::string{FitsColumnFormat<T>::TYPE};
41 } else if (length == 1) {
42 return std::string{FitsColumnFormat<T>::TYPE};
43 } else if (length == std::nullopt) {
44 return std::string{FitsColumnFormat<T>::PREFIX} + std::string{FitsColumnFormat<T>::TYPE};
45 } else {
46 return fmt::format_int(length.value()).str() + std::string{FitsColumnFormat<T>::TYPE};
47 }
48}
49
54template <class T, class... Args>
55void GetFITSTForm(std::vector<std::string>& input);
56
62template <class T, class... Args>
63void GetFITSTFormWithLength(std::vector<std::string>& input,
64 const gsl::span<std::optional<size_t>, sizeof...(Args) + 1> sizes);
65
66} // namespace rtctk::componentFramework
67
69
70#endif // RTCTK_COMPONENTFRAMEWORK_FITSCOLUMNFORMAT_HPP
fitscolumnFormat is used to get a fits type from a C++ type.
Definition commandReplier.cpp:22
std::string GetFitsType(const std::optional< size_t > length=FitsColumnFormat< T >::COUNT)
Get the TFORM value for a type.
Definition fitsColumnFormat.hpp:37
void GetFITSTFormWithLength(std::vector< std::string > &input, const gsl::span< std::optional< size_t >, sizeof...(Args)+1 > sizes)
Get a vactor of TFORM strings for a list of types using the custom sizes provided.
Definition fitsColumnFormat.ipp:158
void GetFITSTForm(std::vector< std::string > &input)
Get a vactor of TFORM strings for a list of types.
Definition fitsColumnFormat.ipp:150
Type that stores type information for a FITS TFORM string.
Definition fitsColumnFormat.hpp:31