blob: 7d76546b1990c5c751a9df9063346b4728a5ff62 [file] [log] [blame]
Andreas Huber4b2cf352016-08-31 13:58:19 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
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
Hridya Valsarajua32bde82016-12-27 11:47:46 -080017#ifndef FMQ_TYPE_H_
Andreas Huber4b2cf352016-08-31 13:58:19 -070018
Hridya Valsarajua32bde82016-12-27 11:47:46 -080019#define FMQ_TYPE_H_
Andreas Huber4b2cf352016-08-31 13:58:19 -070020
21#include "Type.h"
22
Neel Mehta69920a62019-07-22 16:22:13 -070023#include <string>
24
Andreas Huber4b2cf352016-08-31 13:58:19 -070025namespace android {
26
Hridya Valsarajua32bde82016-12-27 11:47:46 -080027struct FmqType : public TemplatedType {
Neel Mehta69920a62019-07-22 16:22:13 -070028 FmqType(const std::string& nsp, const std::string& name, Scope* parent,
29 const std::string& definedName);
Andreas Huber4b2cf352016-08-31 13:58:19 -070030
Neel Mehtad3375f12019-08-19 09:58:46 -070031 bool isFmq() const override;
Yifan Hong244e82d2016-11-11 11:13:57 -080032
Neel Mehtad3375f12019-08-19 09:58:46 -070033 std::string fullName() const;
Yi Kongc8c053e2019-03-25 02:13:39 -070034 std::string templatedTypeName() const override;
Steven Moreland0ecc7b82017-07-19 12:59:23 -070035
Andreas Huber4c865b72016-09-14 15:26:27 -070036 std::string getCppType(
37 StorageMode mode,
Andreas Huber4c865b72016-09-14 15:26:27 -070038 bool specifyNamespaces) const override;
Andreas Huber4b2cf352016-08-31 13:58:19 -070039
40 void emitReaderWriter(
41 Formatter &out,
42 const std::string &name,
43 const std::string &parcelObj,
44 bool parcelObjIsPointer,
45 bool isReader,
46 ErrorMode mode) const override;
47
48 void emitReaderWriterEmbedded(
49 Formatter &out,
Andreas Huberf9d49f12016-09-12 14:58:36 -070050 size_t depth,
Andreas Huber4b2cf352016-08-31 13:58:19 -070051 const std::string &name,
Yifan Hongbe2a3732016-10-05 13:33:41 -070052 const std::string &sanitizedName,
Andreas Huber4b2cf352016-08-31 13:58:19 -070053 bool nameIsPointer,
54 const std::string &parcelObj,
55 bool parcelObjIsPointer,
56 bool isReader,
57 ErrorMode mode,
58 const std::string &parentName,
59 const std::string &offsetText) const override;
60
Timur Iskhakov5dc72fe2017-09-07 23:13:44 -070061 bool deepIsJavaCompatible(std::unordered_set<const Type*>* visited) const override;
Andreas Huber4b2cf352016-08-31 13:58:19 -070062
Andreas Huber60d3b222017-03-30 09:10:56 -070063 void getAlignmentAndSize(size_t *align, size_t *size) const override;
64
Andreas Huber4b2cf352016-08-31 13:58:19 -070065 bool needsEmbeddedReadWrite() const override;
66 bool resultNeedsDeref() const override;
Timur Iskhakov24e605b2017-08-30 14:02:55 -070067 bool isCompatibleElementType(const Type* elementType) const override;
Zhuoyao Zhange9667842017-01-19 12:35:32 -080068
69 std::string getVtsType() const override;
70 std::string getVtsValueName() const override;
71 private:
Yifan Hong244e82d2016-11-11 11:13:57 -080072 std::string mNamespace;
Andreas Huber4b2cf352016-08-31 13:58:19 -070073 std::string mName;
74
Hridya Valsarajua32bde82016-12-27 11:47:46 -080075 DISALLOW_COPY_AND_ASSIGN(FmqType);
Andreas Huber4b2cf352016-08-31 13:58:19 -070076};
77
78} // namespace android
79
Hridya Valsarajua32bde82016-12-27 11:47:46 -080080#endif // FMQ_TYPE_H_