1 /* 2 * Copyright 2019 The libgav1 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 #ifndef LIBGAV1_SRC_UTILS_EXECUTOR_H_ 18 #define LIBGAV1_SRC_UTILS_EXECUTOR_H_ 19 20 #include <functional> 21 22 namespace libgav1 { 23 24 class Executor { 25 public: 26 virtual ~Executor(); 27 28 // Schedules the specified "callback" for execution in this executor. 29 // Depending on the subclass implementation, this may block in some 30 // situations. 31 virtual void Schedule(std::function<void()> callback) = 0; 32 }; 33 34 } // namespace libgav1 35 36 #endif // LIBGAV1_SRC_UTILS_EXECUTOR_H_ 37