Quinoa all test code coverage report
Current view: top level - Control/Options - Error.hpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 4 7 57.1 %
Date: 2024-04-29 14:59:56 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 12 24 50.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/Control/Options/Error.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     Error type options
       9                 :            :   \details   Error type options
      10                 :            : */
      11                 :            : // *****************************************************************************
      12                 :            : #ifndef ErrorOptions_h
      13                 :            : #define ErrorOptions_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                 :            : //! Error types
      24                 :            : enum class ErrorType : uint8_t { L2=0,
      25                 :            :                                  LINF };
      26                 :            : 
      27                 :            : //! \brief Pack/Unpack ErrorType: forward overload to generic enum
      28                 :            : //!   class packer
      29                 :       1820 : inline void operator|( PUP::er& p, ErrorType& e ) { PUP::pup( p, e ); }
      30                 :            : 
      31                 :            : //! \brief Error options: outsource searches to base templated on enum type
      32                 :            : class Error : public tk::Toggle< ErrorType > {
      33                 :            : 
      34                 :            :   public:
      35                 :            :     //! \brief Options constructor
      36                 :            :     //! \details Simply initialize in-line and pass associations to base, which
      37                 :            :     //!    will handle client interactions
      38                 :        301 :     explicit Error() :
      39                 :            :       tk::Toggle< ErrorType >(
      40                 :            :         //! Group, i.e., options, name
      41                 :            :         "error",
      42                 :            :         //! Enums -> names
      43                 :          0 :         { { ErrorType::L2, "L2" },
      44                 :          0 :           { ErrorType::LINF, "Linf" } },
      45                 :            :         //! keywords -> Enums
      46                 :        602 :         { { "l2", ErrorType::L2 },
      47                 :          0 :           { "linf", ErrorType::LINF } }
      48 [ +  - ][ +  - ]:       1505 :       ) {}
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  + ][ +  + ]
         [ -  - ][ -  - ]
      49                 :            : };
      50                 :            : 
      51                 :            : } // ctr::
      52                 :            : } // tk:::
      53                 :            : 
      54                 :            : #endif // ErrorOptions_h

Generated by: LCOV version 1.14