libpniio
|
![]() |
The classes, functions, and data structures described in this section are only of interest for developers of libpniio
. The formatter framework provided by libpniio
is based on boost::spirit::karma
.
In order to make boost::spirit::karma
recognizing pni::core::mdarray
and pni::core::array
as containers, specializiations for the container traits must be provided in boost::spirit:traits
for those types. Specializations are provided for the following traits
boost::spirit::traits::is_container
- identifying the types as containers boost::spirit::container_iterator
- providing the interator type boost::spirit::begin_container
- returning the iterator the first element boost::spirit::end_container
- returning the iterator for the last elementCustom formatting policies are used for
A custom policiy for floating point numbers was required due to the fact that C++, by default, does not write floating point numbers with their full numerical resolution. This can cause truncation effects where zeros are writting simply because the number is too small. The custom policy avoids this problem.
For some of the types provided by libpnicore
custom generators are provided. Obviously, custom generators are required for the scalar type erasures pni::core::value
and pni::core::value_ref
. Both types are handled by the pni::io::value_generator template.