Walker test code coverage report
Current view: top level - Control/Walker/Options - Normalization.hpp (source / functions) Hit Total Coverage
Commit: test_coverage.info Lines: 7 8 87.5 %
Date: 2022-09-21 18:57:21 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 11 22 50.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/Control/Walker/Options/Normalization.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     Normalization variants (used for MixDirichlet)
       9                 :            :   \details   Normalization variants (used for MixDirichlet).
      10                 :            : */
      11                 :            : // *****************************************************************************
      12                 :            : #ifndef NormalizationOptions_h
      13                 :            : #define NormalizationOptions_h
      14                 :            : 
      15                 :            : #include <brigand/sequences/list.hpp>
      16                 :            : 
      17                 :            : #include "Toggle.hpp"
      18                 :            : #include "Keywords.hpp"
      19                 :            : #include "PUPUtil.hpp"
      20                 :            : 
      21                 :            : namespace walker {
      22                 :            : namespace ctr {
      23                 :            : 
      24                 :            : //! Normalization types
      25                 :            : enum class NormalizationType : uint8_t { LIGHT=0
      26                 :            :                                        , HEAVY };
      27                 :            : 
      28                 :            : //! \brief Pack/Unpack NormalizationType: forward overload to generic enum
      29                 :            : //!    class packer
      30                 :         40 : inline void operator|( PUP::er& p, NormalizationType& e )
      31                 :         40 : { PUP::pup( p, e ); }
      32                 :            : 
      33                 :            : //! Normalization variants: outsource to base templated on enum type
      34                 :            : class Normalization : public tk::Toggle< NormalizationType > {
      35                 :            : 
      36                 :            :   public:
      37                 :            :     //! Valid expected choices to make them also available at compile-time
      38                 :            :     using keywords = brigand::list< kw::light
      39                 :            :                                   , kw::heavy
      40                 :            :                                   >;
      41                 :            : 
      42                 :            :     //! \brief Options constructor
      43                 :            :     //! \details Simply initialize in-line and pass associations to base, which
      44                 :            :     //!    will handle client interactions
      45                 :         16 :     explicit Normalization() :
      46                 :            :       tk::Toggle< NormalizationType >(
      47                 :            :         //! Group, i.e., options, name
      48                 :            :         "Normalization",
      49                 :            :         //! Enums -> names
      50         [ +  - ]:         16 :         { { NormalizationType::LIGHT, kw::light::name() },
      51         [ +  - ]:         32 :           { NormalizationType::HEAVY, kw::heavy::name() } },
      52                 :            :         //! keywords -> Enums
      53                 :          0 :         { { kw::light::string(), NormalizationType::LIGHT },
      54 [ +  - ][ +  - ]:        128 :           { kw::heavy::string(), NormalizationType::HEAVY } } )
         [ +  - ][ +  - ]
         [ +  - ][ +  + ]
         [ +  + ][ -  - ]
                 [ -  - ]
      55                 :         16 :     {}
      56                 :            : };
      57                 :            : 
      58                 :            : } // ctr::
      59                 :            : } // walker::
      60                 :            : 
      61                 :            : #endif // NormalizationOptions_h

Generated by: LCOV version 1.14