Line data Source code
1 : // 2 : // Copyright 2024 OpenModelViewer Authors 3 : // 4 : // Licensed under the Apache License, Version 2.0 (the "License"); 5 : // you may not use this file except in compliance with the License. 6 : // You may obtain a copy of the License at 7 : // 8 : // http://www.apache.org/licenses/LICENSE-2.0 9 : // 10 : // Unless required by applicable law or agreed to in writing, software 11 : // distributed under the License is distributed on an "AS IS" BASIS, 12 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 : // See the License for the specific language governing permissions and 14 : // limitations under the License. 15 : // 16 : 17 : #pragma once 18 : 19 : namespace openmodelviewer::core::lifecycle 20 : { 21 : /** 22 : * @brief Interface for components that expose a stoppable behavior. 23 : * 24 : * Intended for components that run an internal process, loop, or behavior 25 : * that can be explicitly halted from the outside. 26 : * 27 : * This interface provides a standardized way to request the termination 28 : * of such autonomous activity, without dictating how or when it began. 29 : */ 30 : class IStoppable 31 : { 32 : public: 33 181 : virtual ~IStoppable() = default; 34 : 35 : /** 36 : * @brief Stops the component's activity. 37 : * 38 : * This call should make the component inactive, typically halting 39 : * its execution loop or background processing. 40 : */ 41 : virtual void stop() = 0; 42 : }; 43 : } // namespace openmodelviewer::core::lifecycle