1 /* 2 * Copyright (c) 2021-2022 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 OHOS_ABILITY_BASE_BASE_TYPES_H 16 #define OHOS_ABILITY_BASE_BASE_TYPES_H 17 18 #include <stdint.h> 19 #include <string.h> 20 21 namespace OHOS { 22 namespace AAFwk { 23 using HANDLE = uintptr_t; 24 using byte = char; 25 using zchar = char32_t; 26 27 using Uuid = struct Uuid { 28 static constexpr int UUID_SUB5_SIZE = 12; 29 30 unsigned int mData1; 31 unsigned short mData2; 32 unsigned short mData3; 33 unsigned short mData4; 34 unsigned char mData5[UUID_SUB5_SIZE]; 35 36 static const struct Uuid Empty; 37 }; 38 39 using InterfaceID = Uuid; 40 using ClassID = Uuid; 41 42 inline bool operator==(const InterfaceID &iid1, /* [in] */ 43 const InterfaceID &iid2) /* [in] */ 44 { 45 return !memcmp(&iid1, &iid2, sizeof(InterfaceID)); 46 } 47 48 inline bool operator!=(const InterfaceID &iid1, /* [in] */ 49 const InterfaceID &iid2) /* [in] */ 50 { 51 return memcmp(&iid1, &iid2, sizeof(InterfaceID)); 52 } 53 } // namespace AAFwk 54 } // namespace OHOS 55 #endif // OHOS_ABILITY_BASE_BASE_TYPES_H 56