summaryrefslogtreecommitdiff
path: root/tools/aidl
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2011-09-06 11:01:17 -0700
committerMike Lockwood <lockwood@google.com>2012-02-10 10:51:20 -0800
commit1eb720446dec3248ba102c4635bf113d450d0d73 (patch)
tree294c1eab4bd71201cf8475f5850a2ce808b797b0 /tools/aidl
parent05ffbe7c020c59ee4fa7e13e04641c954d591951 (diff)
Add RpcData as a built-in marshallable type.
Diffstat (limited to 'tools/aidl')
-rwxr-xr-xtools/aidl/Type.cpp26
-rwxr-xr-xtools/aidl/Type.h11
2 files changed, 35 insertions, 2 deletions
diff --git a/tools/aidl/Type.cpp b/tools/aidl/Type.cpp
index 4ae4d8bbcafb..9a58af00c402 100755
--- a/tools/aidl/Type.cpp
+++ b/tools/aidl/Type.cpp
@@ -130,8 +130,7 @@ register_base_types()
Type::BUILT_IN, false, false);
NAMES.Add(RPC_SERVICE_BASE_TYPE);
- RPC_DATA_TYPE = new Type("com.android.athome.rpc", "RpcData",
- Type::BUILT_IN, false, false);
+ RPC_DATA_TYPE = new RpcDataType();
NAMES.Add(RPC_DATA_TYPE);
RPC_BROKER_TYPE = new Type("com.android.athome.utils", "AndroidAtHomeBroker",
@@ -1207,6 +1206,29 @@ GenericListType::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variabl
new LiteralExpression(classArg))));
}
+
+// ================================================================
+
+RpcDataType::RpcDataType()
+ :Type("com.android.athome.rpc", "RpcData", Type::BUILT_IN, false, false)
+{
+}
+
+void
+RpcDataType::WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
+ Variable* data, int flags)
+{
+ addTo->Add(new MethodCall(data, "putRpcData", 2, k, v));
+}
+
+void
+RpcDataType::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v, Variable* data,
+ Variable** cl)
+{
+ addTo->Add(new Assignment(v, new MethodCall(data, "getRpcData", 1, k)));
+}
+
+
// ================================================================
ClassLoaderType::ClassLoaderType()
diff --git a/tools/aidl/Type.h b/tools/aidl/Type.h
index c22ef757042a..97b3a125c395 100755
--- a/tools/aidl/Type.h
+++ b/tools/aidl/Type.h
@@ -442,6 +442,17 @@ private:
string m_creator;
};
+class RpcDataType : public Type
+{
+public:
+ RpcDataType();
+
+ virtual void WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
+ Variable* data, int flags);
+ virtual void CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
+ Variable* data, Variable** cl);
+};
+
class ClassLoaderType : public Type
{
public: