libadc-cxx 1.0.0
Structured logging for scientific computing
Loading...
Searching...
No Matches
Namespaces | Macros | Functions | Variables
enums.ipp File Reference
#include <mutex>
#include <charconv>
Include dependency graph for enums.ipp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  adc
 
namespace  adc::impl
 

Macros

#define adc_builder_impl_enums_ipp_hpp
 
#define elt_to_string(CTYPE)
 
#define f_elt_to_string(CTYPE)
 
#define cf_elt_to_string(CTYPE)
 
#define BAD_ST   "UNKNOWN_scalar_type"
 
#define check_enum(X)   if (to_string(cp_##X) != #X) { err++; std::cout << "enum " << #X << " is inconsistent with " << cp_##X << " from " << to_string(cp_##X) << std::endl; }
 

Functions

boost::json::kind adc::scalar_type_representation (scalar_type st)
 
scalar_type adc::scalar_type_from_name (const std::string &name)
 get the enum representation of a scalar_type string
 
const std::string adc::to_string (float)
 get string of float using to_chars.
 
const std::string adc::to_string (double)
 get string of double using to_chars.
 
const std::string adc::to_string (void *data, scalar_type cptype, size_t count)
 get string of array
 
const std::string adc::to_string (scalar_type st)
 get the string representation of a scalar_type value
 
int adc::test_enum_strings ()
 return non-zero if to_string and enum scalar_type are inconsisent.
 

Variables

std::map< adc::scalar_type, std::string > adc::impl::scalar_type_name
 
std::map< adc::scalar_type, boost::json::kind > adc::impl::scalar_type_representation
 

Macro Definition Documentation

◆ adc_builder_impl_enums_ipp_hpp

#define adc_builder_impl_enums_ipp_hpp

Definition at line 2 of file enums.ipp.

◆ elt_to_string

#define elt_to_string (   CTYPE)
Value:
{ \
CTYPE *a = (CTYPE *)data; \
for (size_t i=0; i < count; i++) { \
o << a[i]; \
if (i < count-1) \
o << ", "; \
} \
}

Definition at line 158 of file enums.ipp.

◆ f_elt_to_string

#define f_elt_to_string (   CTYPE)
Value:
{ \
CTYPE *a = (CTYPE *)data; \
for (size_t i=0; i < count; i++) { \
o << to_string(a[i]); \
if (i < count-1) \
o << ", "; \
} \
}

Definition at line 168 of file enums.ipp.

◆ cf_elt_to_string

#define cf_elt_to_string (   CTYPE)
Value:
{ \
std::complex<CTYPE> *a = (std::complex<CTYPE> *)data; \
for (size_t i=0; i < count; i++) { \
o << "{" << to_string(a[i].real()); \
o << ", " << to_string(a[i].imag()); \
o << " }"; \
if (i < count-1) \
o << ", "; \
} \
}

Definition at line 178 of file enums.ipp.

◆ BAD_ST

#define BAD_ST   "UNKNOWN_scalar_type"

Definition at line 350 of file enums.ipp.

◆ check_enum

#define check_enum (   X)    if (to_string(cp_##X) != #X) { err++; std::cout << "enum " << #X << " is inconsistent with " << cp_##X << " from " << to_string(cp_##X) << std::endl; }