Line data Source code
1 : /* 2 : * Copyright (C) 2020-2024 MEmilio 3 : * 4 : * Authors: Carlotta Gerstein, Martin J. Kuehn 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 : #include "abm/mask_type.h" 22 : #include "abm/parameters.h" 23 : #include "abm/mask.h" 24 : #include "abm/time.h" 25 : 26 : namespace mio 27 : { 28 : namespace abm 29 : { 30 1971 : Mask::Mask(MaskType type, TimePoint t) 31 1971 : : m_type(type) 32 1971 : , m_time_first_usage(t) 33 : { 34 1971 : } 35 : 36 369 : void Mask::change_mask(MaskType new_mask_type, TimePoint t) 37 : { 38 369 : m_type = new_mask_type; 39 369 : m_time_first_usage = t; 40 369 : } 41 : 42 27 : const TimeSpan Mask::get_time_used(TimePoint curr_time) const 43 : { 44 27 : return curr_time - m_time_first_usage; 45 : } 46 : 47 : } // namespace abm 48 : } // namespace mio