LCOV - code coverage report
Current view: top level - models/abm - test_type.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 2 2 100.0 %
Date: 2024-11-18 12:45:26 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /* 
       2             : * Copyright (C) 2020-2024 MEmilio
       3             : *
       4             : * Authors: Khoa Nguyen
       5             : *
       6             : * Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de>
       7             : *
       8             : * Licensed under the Apache License, Version 2.0 (the "License");
       9             : * you may not use this file except in compliance with the License.
      10             : * You may obtain a copy of the License at
      11             : *
      12             : *     http://www.apache.org/licenses/LICENSE-2.0
      13             : *
      14             : * Unless required by applicable law or agreed to in writing, software
      15             : * distributed under the License is distributed on an "AS IS" BASIS,
      16             : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      17             : * See the License for the specific language governing permissions and
      18             : * limitations under the License.
      19             : */
      20             : #ifndef MIO_ABM_TEST_TYPE_H
      21             : #define MIO_ABM_TEST_TYPE_H
      22             : 
      23             : #include "abm/time.h"
      24             : #include "memilio/io/default_serialize.h"
      25             : 
      26             : #include <cstdint>
      27             : 
      28             : namespace mio
      29             : {
      30             : namespace abm
      31             : {
      32             : 
      33             : /**
      34             :  * @brief Type of a Test.
      35             :  */
      36             : enum class TestType : std::uint32_t
      37             : {
      38             :     Generic,
      39             :     Antigen,
      40             :     PCR,
      41             : 
      42             :     Count
      43             : };
      44             : 
      45             : /**
      46             : * @brief The TestResult of a Person.
      47             : */
      48             : struct TestResult {
      49             :     TimePoint time_of_testing{std::numeric_limits<int>::min()}; ///< The TimePoint when the Person performs the test.
      50             :     bool result{false}; ///< The test result.
      51             : 
      52             :     /// This method is used by the default serialization feature.
      53          18 :     auto default_serialize()
      54             :     {
      55          36 :         return Members("TestResult").add("time_of_testing", time_of_testing).add("result", result);
      56             :     }
      57             : };
      58             : 
      59             : } // namespace abm
      60             : } // namespace mio
      61             : 
      62             : #endif

Generated by: LCOV version 1.14