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_LOCATION_ID_H 22 : #define MIO_ABM_LOCATION_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 Location within a Model. 33 : struct MEMILIO_ENABLE_EBO LocationId : public mio::TypeSafe<uint32_t, LocationId>, 34 : public OperatorComparison<LocationId> { 35 : /// @brief Create an ID. 36 26263 : LocationId(uint32_t id) 37 26263 : : mio::TypeSafe<uint32_t, LocationId>(id) 38 : { 39 26263 : } 40 : 41 : /// @brief Create an invalid ID. 42 35946 : LocationId() 43 35946 : : mio::TypeSafe<uint32_t, LocationId>(std::numeric_limits<uint32_t>::max()) 44 : { 45 35946 : } 46 : 47 : /// @brief Value for invalid IDs. 48 35910 : const static LocationId invalid_id() 49 : { 50 35910 : return LocationId(); 51 : } 52 : }; 53 : 54 : } // namespace abm 55 : } // namespace mio 56 : 57 : #endif // MIO_ABM_LOCATION_ID_H