location_id.h Source File

CPP API: location_id.h Source File
location_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_LOCATION_ID_H
22 #define MIO_ABM_LOCATION_ID_H
23 
25 #include <limits>
26 
27 namespace mio
28 {
29 namespace abm
30 {
31 
33 struct MEMILIO_ENABLE_EBO LocationId : public mio::TypeSafe<uint32_t, LocationId>,
34  public OperatorComparison<LocationId> {
36  LocationId(uint32_t id)
37  : mio::TypeSafe<uint32_t, LocationId>(id)
38  {
39  }
40 
43  : mio::TypeSafe<uint32_t, LocationId>(std::numeric_limits<uint32_t>::max())
44  {
45  }
46 
48  const static LocationId invalid_id()
49  {
50  return LocationId();
51  }
52 };
53 
54 } // namespace abm
55 } // namespace mio
56 
57 #endif // MIO_ABM_LOCATION_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 identifier for a Location within a Model.
Definition: location_id.h:34
LocationId(uint32_t id)
Create an ID.
Definition: location_id.h:36
LocationId()
Create an invalid ID.
Definition: location_id.h:42
static const LocationId invalid_id()
Value for invalid IDs.
Definition: location_id.h:48