1 /* 2 * Copyright (C) 2025 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 #ifndef _ADLT_TEST_CDTORS_A_H_ 16 #define _ADLT_TEST_CDTORS_A_H_ 17 18 namespace liba { 19 20 enum Flags { 21 INIT_0 = 0, 22 INIT_1 = 1, 23 INIT_2 = 2, 24 INIT_3 = 3, 25 FINI_0 = 4, 26 FINI_1 = 5, 27 FINI_2 = 6, 28 FINI_3 = 7, 29 }; 30 31 class ClassA { 32 public: 33 explicit ClassA(unsigned value); 34 ~ClassA(); 35 36 static ClassA& Instance(); 37 void Log(const char* message="") const; 38 39 unsigned Value() const; 40 void SetFlag(unsigned bit); 41 bool HasFlag(unsigned bit) const; 42 43 private: 44 int object_id; 45 unsigned value = 0; 46 }; 47 48 extern "C" const ClassA 49 class_a_instance_0, 50 class_a_instance_1; 51 52 } // namespace liba 53 54 #endif