Quinoa all test code coverage report
Current view: top level - Control/Options - TxtFloatFormat.hpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 3 3 100.0 %
Date: 2024-04-29 14:42:33 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 9 22 40.9 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/Control/Options/TxtFloatFormat.hpp
       4                 :            :   \copyright 2012-2015 J. Bakosi,
       5                 :            :              2016-2018 Los Alamos National Security, LLC.,
       6                 :            :              2019-2021 Triad National Security, LLC.
       7                 :            :              All rights reserved. See the LICENSE file for details.
       8                 :            :   \brief     Text floating-point output options
       9                 :            :   \details   Text floating-point output options
      10                 :            : */
      11                 :            : // *****************************************************************************
      12                 :            : #ifndef TxtFloatFormatOptions_h
      13                 :            : #define TxtFloatFormatOptions_h
      14                 :            : 
      15                 :            : #include <brigand/sequences/list.hpp>
      16                 :            : 
      17                 :            : #include "Toggle.hpp"
      18                 :            : #include "PUPUtil.hpp"
      19                 :            : 
      20                 :            : namespace tk {
      21                 :            : namespace ctr {
      22                 :            : 
      23                 :            : //! Txt floating-point format types
      24                 :            : enum class TxtFloatFormatType : uint8_t { DEFAULT=0,
      25                 :            :                                           FIXED,
      26                 :            :                                           SCIENTIFIC };
      27                 :            : 
      28                 :            : //! \brief Pack/Unpack TxtFloatFormatType: forward overload to generic enum
      29                 :            : //!   class packer
      30                 :            : inline void operator|( PUP::er& p, TxtFloatFormatType& e ) { PUP::pup( p, e ); }
      31                 :            : 
      32                 :            : //! \brief TxtFloatFormat options: outsource searches to base templated on enum
      33                 :            : //!   type
      34                 :        111 : class TxtFloatFormat : public tk::Toggle< TxtFloatFormatType > {
      35                 :            : 
      36                 :            :   public:
      37                 :            :     //! \brief Options constructor
      38                 :            :     //! \details Simply initialize in-line and pass associations to base, which
      39                 :            :     //!    will handle client interactions
      40                 :        111 :     explicit TxtFloatFormat() :
      41                 :            :       tk::Toggle< TxtFloatFormatType >(
      42                 :            :         //! Group, i.e., options, name
      43                 :            :         "floating-point format",
      44                 :            :         //! Enums -> names
      45                 :            :         { { TxtFloatFormatType::DEFAULT, "default" },
      46                 :            :           { TxtFloatFormatType::FIXED, "fixed" },
      47                 :            :           { TxtFloatFormatType::SCIENTIFIC, "scientific" } },
      48                 :            :         //! keywords -> Enums
      49                 :            :         { { "default", TxtFloatFormatType::DEFAULT },
      50                 :            :           { "fixed", TxtFloatFormatType::FIXED },
      51                 :            :         { "scientific", TxtFloatFormatType::SCIENTIFIC } }
      52 [ +  - ][ +  - ]:       1110 :       ) {}
         [ +  - ][ +  + ]
         [ -  + ][ +  + ]
         [ -  + ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
      53                 :            : };
      54                 :            : 
      55                 :            : } // ctr::
      56                 :            : } // tk:::
      57                 :            : 
      58                 :            : #endif // TxtFloatFormatOptions_h

Generated by: LCOV version 1.14