1 /* 2 Copyright (c) 2022-2023 Intel Corporation 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 _TBB_threading_control_client_H 18 #define _TBB_threading_control_client_H 19 20 #include "oneapi/tbb/detail/_assert.h" 21 22 namespace tbb { 23 namespace detail { 24 namespace r1 { 25 26 class pm_client; 27 class thread_dispatcher_client; 28 29 class threading_control_client { 30 public: 31 threading_control_client() = default; 32 threading_control_client(const threading_control_client&) = default; 33 threading_control_client& operator=(const threading_control_client&) = default; 34 threading_control_client(pm_client * p,thread_dispatcher_client * t)35 threading_control_client(pm_client* p, thread_dispatcher_client* t) : my_pm_client(p), my_thread_dispatcher_client(t) { 36 __TBB_ASSERT(my_pm_client, nullptr); 37 __TBB_ASSERT(my_thread_dispatcher_client, nullptr); 38 } 39 get_pm_client()40 pm_client* get_pm_client() { 41 return my_pm_client; 42 } 43 get_thread_dispatcher_client()44 thread_dispatcher_client* get_thread_dispatcher_client() { 45 return my_thread_dispatcher_client; 46 } 47 48 private: 49 pm_client* my_pm_client{nullptr}; 50 thread_dispatcher_client* my_thread_dispatcher_client{nullptr}; 51 }; 52 53 54 } 55 } 56 } 57 58 #endif // _TBB_threading_control_client_H 59