1 /*
2  * Copyright (c) 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 
16 #ifndef OHOS_IDL_METADATA_H
17 #define OHOS_IDL_METADATA_H
18 
19 #include <cstring>
20 
21 #include "meta_interface.h"
22 #include "meta_namespace.h"
23 #include "meta_sequenceable.h"
24 #include "meta_type.h"
25 
26 namespace OHOS {
27 namespace Idl {
28 static constexpr int METADATA_MAGIC_NUMBER = 0x1DF02ED1;
29 
30 struct MetaComponent {
31     int magic_;
32     int size_;
33     char* name_;
34     int namespaceNumber_;
35     int sequenceableNumber_;
36     int interfaceNumber_;
37     int typeNumber_;
38     bool hasCacheableProxyMethods_;
39     MetaNamespace** namespaces_;
40     MetaSequenceable** sequenceables_;
41     MetaInterface** interfaces_;
42     MetaType** types_;
43     size_t stringPoolSize_;
44     char* stringPool_;
45 };
46 
47 static constexpr unsigned int INTERFACE_PROPERTY_ONEWAY = 0x1;
48 
49 static constexpr unsigned int METHOD_PROPERTY_ONEWAY = 0x1;
50 
51 static constexpr unsigned int ATTR_IN = 0x1;
52 static constexpr unsigned int ATTR_OUT = 0x2;
53 static constexpr unsigned int ATTR_MASK = 0x3;
54 } // namespace Idl
55 } // namespace OHOS
56 #endif // OHOS_IDL_METADATA_H
57