person_id.h Source File

CPP API: person_id.h Source File
person_id.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2020-2026 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 
25 #include <limits>
26 
27 namespace mio
28 {
29 namespace abm
30 {
31 
33 struct MEMILIO_ENABLE_EBO PersonId : public mio::TypeSafe<uint64_t, PersonId>, public OperatorComparison<PersonId> {
35  PersonId(uint64_t id)
36  : mio::TypeSafe<uint64_t, PersonId>(id)
37  {
38  }
39 
42  : mio::TypeSafe<uint64_t, PersonId>(std::numeric_limits<uint64_t>::max())
43  {
44  }
45 
47  const static PersonId invalid_ID()
48  {
49  return PersonId();
50  }
51 };
52 
53 } // namespace abm
54 } // namespace mio
55 
56 #endif // MIO_ABM_PERSON_ID_H
base class to add operator <, <=, >, >= to a class derived from TypeSafe.
Definition: type_safe.h:205
typesafe wrapper around any type to make function arguments, tuple elements, etc.
Definition: type_safe.h:42
#define MEMILIO_ENABLE_EBO
Definition: compiler_diagnostics.h:75
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
auto max(const Eigen::MatrixBase< A > &a, B &&b)
coefficient wise maximum of two matrices.
Definition: eigen_util.h:171
Definition: io.h:94
Unique ID for a Person within a Model.
Definition: person_id.h:33
static const PersonId invalid_ID()
Value for invalid IDs.
Definition: person_id.h:47
PersonId()
Create an invalid ID.
Definition: person_id.h:41
PersonId(uint64_t id)
Create an ID.
Definition: person_id.h:35