1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef CPP_ABCKIT_STATIC_ISA_H 17 #define CPP_ABCKIT_STATIC_ISA_H 18 19 #include <memory> 20 21 namespace abckit { 22 23 class Graph; 24 25 class StaticIsa final { 26 // To access private constructor. 27 // We restrict constructors in order to prevent C/C++ API mix-up by user. 28 friend class Graph; 29 30 public: 31 StaticIsa(const StaticIsa &other) = delete; 32 StaticIsa &operator=(const StaticIsa &other) = delete; 33 StaticIsa(StaticIsa &&other) = delete; 34 StaticIsa &operator=(StaticIsa &&other) = delete; 35 ~StaticIsa() = default; 36 37 private: 38 // All static methods impl StaticIsa(const Graph & graph)39 explicit StaticIsa(const Graph &graph) : graph_(graph) {}; 40 // NOTE(nsizov): remove maybe unused, use graph_ 41 [[maybe_unused]] const Graph &graph_; 42 }; 43 44 } // namespace abckit 45 46 #endif // CPP_ABCKIT_STATIC_ISA_H 47