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

          Line data    Source code
       1             : /* 
       2             : * Copyright (C) 2020-2024 MEmilio
       3             : *
       4             : * Authors: Rene Schmieding
       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             : 
      21             : #ifndef MIO_ABM_PERSON_ID_H
      22             : #define MIO_ABM_PERSON_ID_H
      23             : 
      24             : #include "memilio/utils/type_safe.h"
      25             : #include <limits>
      26             : 
      27             : namespace mio
      28             : {
      29             : namespace abm
      30             : {
      31             : 
      32             : /// Unique identifier for a Person within a Model.
      33             : struct MEMILIO_ENABLE_EBO PersonId : public mio::TypeSafe<uint32_t, PersonId>, public OperatorComparison<PersonId> {
      34             :     /// @brief Create an ID.
      35       13104 :     PersonId(uint32_t id)
      36       13104 :         : mio::TypeSafe<uint32_t, PersonId>(id)
      37             :     {
      38       13104 :     }
      39             : 
      40             :     /// @brief Create an invalid ID.
      41        1944 :     PersonId()
      42        1944 :         : mio::TypeSafe<uint32_t, PersonId>(std::numeric_limits<uint32_t>::max())
      43             :     {
      44        1944 :     }
      45             : 
      46             :     /// @brief Value for invalid IDs.
      47        1926 :     const static PersonId invalid_id()
      48             :     {
      49        1926 :         return PersonId();
      50             :     }
      51             : };
      52             : 
      53             : } // namespace abm
      54             : } // namespace mio
      55             : 
      56             : #endif // MIO_ABM_PERSON_ID_H

Generated by: LCOV version 1.14