libadc-cxx 1.0.0
Structured logging for scientific computing
Loading...
Searching...
No Matches
Modules | Classes | Macros | Typedefs | Enumerations | Functions | Variables
Factory and interfaces for application use
Collaboration diagram for Factory and interfaces for application use:

Modules

 Builder_add_host_options
 
 Builder_add_mpi_options
 

Classes

class  adc::builder_api
 The builder api is used to construct structured log (json) messages that follow naming conventions. More...
 
class  adc::factory
 provides publishers and builders of application metadata. More...
 
class  adc::multi_publisher_api
 Interface for a group of publishers all being fed the same message(s). More...
 
class  adc::publisher_api
 Publisher plugin interface. More...
 
struct  adc::version
 A version with tags list. More...
 
struct  adc::field
 
class  adc::var_string
 return string for printing from variant v.
More...
 

Macros

#define ADC_SUPPORT_GPU_FLOATS   0
 Set to 1 if 8/16 float types for gpus are supported. ADC_SUPPORT_GPU_FLOATS should be defined by build-time configuration.
 
#define ADC_SUPPORT_EXTENDED_FLOATS   0
 Set to 1 if 80 bit floats for cpus are supported. ADC_SUPPORT_EXTENDED_FLOATS should be defined by build-time configuration.
 
#define ADC_SUPPORT_QUAD_FLOATS   0
 Set to 1 if 128 bit floats for cpus are supported. ADC_SUPPORT_QUAD_FLOATS should be defined by build-time configuration.
 
#define ADC_BOOST_JSON_PUBLIC   0
 include boost::json support in the API ADC_BOOST_JSON_PUBLIC could be defined by build-time configuration. If it is, this library forces boost::json and other boost dependencies on the build of any application which uses it.
 

Typedefs

typedef std::map< const std::string, std::shared_ptr< publisher_api > > adc::plugin_map
 name/plugin map.
 
typedef std::vector< std::shared_ptr< publisher_api > > adc::publisher_vector
 list of publishers
 
typedef std::pair< std::string, std::shared_ptr< publisher_api > > adc::pair_string_publisher_api
 named publisher
 
typedef std::variant< bool, char, char16_t, char32_t, int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, float, double, std::complex< float >, std::complex< double >, std::array< int64_t, 2 >, std::string, std::shared_ptr< bool[]>, std::shared_ptr< char[]>, std::shared_ptr< char16_t[]>, std::shared_ptr< char32_t[]>, std::shared_ptr< int8_t[]>, std::shared_ptr< int16_t[]>, std::shared_ptr< int32_t[]>, std::shared_ptr< int64_t[]>, std::shared_ptr< uint8_t[]>, std::shared_ptr< uint16_t[]>, std::shared_ptr< uint32_t[]>, std::shared_ptr< uint64_t[]>, std::shared_ptr< float[]>, std::shared_ptr< double[]>, std::shared_ptr< std::complex< float >[]>, std::shared_ptr< std::complex< double >[]>, std::shared_ptr< std::string[]> > adc::variant
 variant for querying builder data.
 

Enumerations

enum  adc::scalar_type {
  adc::cp_none , adc::cp_bool , adc::cp_char , adc::cp_char16 ,
  adc::cp_char32 , adc::cp_cstr , adc::cp_json_str , adc::cp_yaml_str ,
  adc::cp_xml_str , adc::cp_json , adc::cp_path , adc::cp_number_str ,
  adc::cp_uint8 , adc::cp_uint16 , adc::cp_uint32 , adc::cp_uint64 ,
  adc::cp_int8 , adc::cp_int16 , adc::cp_int32 , adc::cp_int64 ,
  adc::cp_f32 , adc::cp_f64 , adc::cp_f80 , adc::cp_f128 ,
  adc::cp_f8_e4m3 , adc::cp_f8_e5m2 , adc::cp_f16_e5m10 , adc::cp_f16_e8m7 ,
  adc::cp_c_f32 , adc::cp_c_f64 , adc::cp_c_f80 , adc::cp_c_f128 ,
  adc::cp_timespec , adc::cp_timeval , adc::cp_epoch , adc::cp_last
}
 field types for scientific data encode/decode with json. More...
 
enum  adc::key_type { adc::k_none , adc::k_section , adc::k_value }
 when expanding scalar_type, always update enum.ipp to match. More...
 
enum  adc::object_type { adc::co_list = cp_last , adc::co_map , adc::co_array , adc::co_scalar }
 classification of json-adjacent structure elements. This is not currently in use and may be retired soon. More...
 

Functions

std::string adc::format_timespec_8601 (struct timespec &ts)
 
std::string adc::format_timespec_utc_ns (struct timespec &ts)
 
std::vector< std::string > adc::consolidate_multifile_logs (std::string_view dir, std::string_view match)
 
std::string adc::get_default_affinity ()
 
const std::string adc::to_string (scalar_type st)
 get the string representation of a scalar_type value
 
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
 
scalar_type adc::scalar_type_from_name (const std::string &name)
 get the enum representation of a scalar_type string
 
int adc::test_enum_strings ()
 return non-zero if to_string and enum scalar_type are inconsisent.
 

Variables

version adc::builder_api_version ("1.0.0", {"none"})
 
version adc::adc_factory_version ("1.0.0", {"none"})
 
version adc::multi_publisher_version (MULTI_PUBLISHER_VERSION, MULTI_PUBLISHER_TAGS)
 
version adc::publisher_api_version ("1.0.0", {"none"})
 
version adc::enum_version ("1.0.0", {"none"})
 the version number of enum scalar_type and object_type
 

Detailed Description

Macro Definition Documentation

◆ ADC_SUPPORT_GPU_FLOATS

#define ADC_SUPPORT_GPU_FLOATS   0

Set to 1 if 8/16 float types for gpus are supported. ADC_SUPPORT_GPU_FLOATS should be defined by build-time configuration.

Definition at line 32 of file types.hpp.

◆ ADC_SUPPORT_EXTENDED_FLOATS

#define ADC_SUPPORT_EXTENDED_FLOATS   0

Set to 1 if 80 bit floats for cpus are supported. ADC_SUPPORT_EXTENDED_FLOATS should be defined by build-time configuration.

Definition at line 36 of file types.hpp.

◆ ADC_SUPPORT_QUAD_FLOATS

#define ADC_SUPPORT_QUAD_FLOATS   0

Set to 1 if 128 bit floats for cpus are supported. ADC_SUPPORT_QUAD_FLOATS should be defined by build-time configuration.

Definition at line 40 of file types.hpp.

◆ ADC_BOOST_JSON_PUBLIC

#define ADC_BOOST_JSON_PUBLIC   0

include boost::json support in the API ADC_BOOST_JSON_PUBLIC could be defined by build-time configuration. If it is, this library forces boost::json and other boost dependencies on the build of any application which uses it.

Definition at line 46 of file types.hpp.

Typedef Documentation

◆ plugin_map

typedef std::map< const std::string, std::shared_ptr<publisher_api> > adc::plugin_map

name/plugin map.

Definition at line 97 of file publisher.hpp.

◆ publisher_vector

typedef std::vector< std::shared_ptr<publisher_api> > adc::publisher_vector

list of publishers

Definition at line 100 of file publisher.hpp.

◆ pair_string_publisher_api

typedef std::pair<std::string, std::shared_ptr<publisher_api> > adc::pair_string_publisher_api

named publisher

Definition at line 103 of file publisher.hpp.

◆ variant

typedef std::variant< bool, char, char16_t, char32_t, int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, float, double, std::complex<float>, std::complex<double>, std::array<int64_t, 2>, std::string, std::shared_ptr<bool[]>, std::shared_ptr<char[]>, std::shared_ptr<char16_t[]>, std::shared_ptr<char32_t[]>, std::shared_ptr<int8_t[]>, std::shared_ptr<int16_t[]>, std::shared_ptr<int32_t[]>, std::shared_ptr<int64_t[]>, std::shared_ptr<uint8_t[]>, std::shared_ptr<uint16_t[]>, std::shared_ptr<uint32_t[]>, std::shared_ptr<uint64_t[]>, std::shared_ptr<float[]>, std::shared_ptr<double[]>, std::shared_ptr<std::complex<float>[]>, std::shared_ptr<std::complex<double>[]>, std::shared_ptr<std::string[]> > adc::variant

variant for querying builder data.

Any changes here must be reflected in the var_string operations.

Definition at line 153 of file types.hpp.

Enumeration Type Documentation

◆ scalar_type

field types for scientific data encode/decode with json.

Bit precision and C vs specialized strings are preserved when data is tagged following this enum. The add() functions on the builder api automatically tag with this.

Enumerator
cp_none 
cp_bool 

bool (true/false,1/0)

cp_char 

char (8 bit)

cp_char16 

char16_t

cp_char32 

char32_t

cp_cstr 

c null-terminated string

cp_json_str 

c null-terminated string that contains valid json

cp_yaml_str 

c null-terminated string that contains valid yaml

cp_xml_str 

c null-terminated string that contains valid xml

cp_json 

json value (object, list, etc)

cp_path 

c null-terminated string which names a file-system path

cp_number_str 

c null-terminated string containing an exact decimal representation of arbitrary precision

cp_uint8 

uint8_t

cp_uint16 

uint16_t

cp_uint32 

uint32_t

cp_uint64 

uint64_t

cp_int8 

int8_t

cp_int16 

int16_t

cp_int32 

int32_t

cp_int64 

int64_t

cp_f32 

32 bit float

cp_f64 

64 bit float

cp_f80 

80 bit float; requires ADC_SUPPORT_EXTENDED_FLOATS support

cp_f128 

128 bit float; requires ADC_SUPPORT_QUAD_FLOATS support

cp_f8_e4m3 

8 bit float (3 mantissa, 4 exponent); requires ADC_SUPPORT_GPU_FLOATS support

cp_f8_e5m2 

8 bit float (2 mantissa, 5 exponent); requires ADC_SUPPORT_GPU_FLOATS support

cp_f16_e5m10 

16 bit float (10 mantissa, 5 exponent); requires ADC_SUPPORT_GPU_FLOATS support

cp_f16_e8m7 

16 bit bfloat (7 mantissa, 8 exponent); requires ADC_SUPPORT_GPU_FLOATS support

cp_c_f32 

complex<float>

cp_c_f64 

complex<double>

cp_c_f80 

complex<extended>; requires ADC_SUPPORT_EXTENDED_FLOATS support

cp_c_f128 

complex<quad>; requires ADC_SUPPORT_QUAD_FLOATS support

cp_timespec 

(second, nanosecond) as int64_t, int64_t pair from clock_gettime

cp_timeval 

gettimeofday struct timeval (second, microsecond) as int64_t pair

cp_epoch 

time(NULL) seconds since the epoch (UNIX) as int64_t

cp_last 

Definition at line 58 of file types.hpp.

◆ key_type

when expanding scalar_type, always update enum.ipp to match.

Enumerator
k_none 
k_section 
k_value 

Definition at line 106 of file types.hpp.

◆ object_type

classification of json-adjacent structure elements. This is not currently in use and may be retired soon.

Enumerator
co_list 

ordered list of arbitrary values

co_map 

string keyed map of arbitrary values

co_array 

0-indexed continguous array of type-identical values

co_scalar 

single value

Definition at line 187 of file types.hpp.

Function Documentation

◆ format_timespec_8601()

std::string adc::format_timespec_8601 ( struct timespec &  ts)
Returns
iso 8601 formatted string based on ts

Definition at line 50 of file builder.ipp.

◆ format_timespec_utc_ns()

std::string adc::format_timespec_utc_ns ( struct timespec &  ts)
Returns
utc seconds.nanoseconds formatted string based on ts

Definition at line 65 of file builder.ipp.

◆ consolidate_multifile_logs()

std::vector< std::string > adc::consolidate_multifile_logs ( std::string_view  dir,
std::string_view  match 
)

◆ get_default_affinity()

std::string adc::get_default_affinity ( )

Get the default processor affinity list. This may be useful to publishers that spawn processes.

Definition at line 81 of file builder.ipp.

◆ to_string() [1/4]

ADC_VISIBLE const std::string adc::to_string ( scalar_type  st)

get the string representation of a scalar_type value

Definition at line 352 of file enums.ipp.

◆ to_string() [2/4]

ADC_VISIBLE const std::string adc::to_string ( float  f)

get string of float using to_chars.

Definition at line 128 of file enums.ipp.

◆ to_string() [3/4]

ADC_VISIBLE const std::string adc::to_string ( double  f)

get string of double using to_chars.

Definition at line 143 of file enums.ipp.

◆ to_string() [4/4]

ADC_VISIBLE const std::string adc::to_string ( void *  data,
scalar_type  cptype,
size_t  count 
)

get string of array

Definition at line 190 of file enums.ipp.

◆ scalar_type_from_name()

ADC_VISIBLE scalar_type adc::scalar_type_from_name ( const std::string &  name)

get the enum representation of a scalar_type string

Definition at line 100 of file enums.ipp.

◆ test_enum_strings()

ADC_VISIBLE int adc::test_enum_strings ( )

return non-zero if to_string and enum scalar_type are inconsisent.

Definition at line 358 of file enums.ipp.

Variable Documentation

◆ builder_api_version

version adc::builder_api_version("1.0.0", {"none"}) ( "1.0.0"  ,
{"none"}   
)
inline

◆ adc_factory_version

version adc::adc_factory_version("1.0.0", {"none"}) ( "1.0.0"  ,
{"none"}   
)
inline

◆ multi_publisher_version

◆ publisher_api_version

version adc::publisher_api_version("1.0.0", {"none"}) ( "1.0.0"  ,
{"none"}   
)
inline

◆ enum_version

version adc::enum_version("1.0.0", {"none"}) ( "1.0.0"  ,
{"none"}   
)
inline

the version number of enum scalar_type and object_type