idlc/gen/cs_lib_gen.cc \
idlc/gen/cs_proxy_gen.cc \
idlc/gen/cs_stub_gen.cc \
+ idlc/gen/cs_group_gen.cc \
idlc/gen/generator.cc \
idlc/gen/replace_all.cc \
idlc/gen_cion/c_cion_body_gen_base.cc \
void CsGeneratorBase::GenSerializer(std::ofstream& stream,
const Structure& st) {
- stream << NLine(1) << Tab(3) << "private static void Serialize(Parcel h, "
- << st.GetID() << " param)" << NLine(1);
- GenBrace(stream, TAB_SIZE * 3, [&]() {
- for (const auto& i : st.GetElements()) {
- auto& t = i->GetType();
- if (!t.IsUserDefinedType() && t.GetMetaType() == nullptr) {
- stream << Tab(4) << "h.Write"
- << ConvertTypeToParcelType(t.ToString())
- << "(param."
- << i->GetID()
- << ");" << NLine(1);
- } else {
- stream << Tab(4) << "Serialize(h, param." << i->GetID()
- << ");" << NLine(1);
- }
- }
- });
- stream << NLine(1);
+ stream << GetSerializer(st);
+}
- stream << Tab(3) << "private static void Deserialize(Parcel h, "
- << st.GetID() << " param)" << NLine(1);
- GenBrace(stream, TAB_SIZE * 3, [&]() {
- for (const auto& i : st.GetElements()) {
- auto& t = i->GetType();
- if (!t.IsUserDefinedType() && t.GetMetaType() == nullptr) {
- stream << Tab(4) << "var " << i->GetID() << " = "
- << "h.Read"
- << ConvertTypeToParcelType(t.ToString())
- << "();" << NLine(1);
- stream << Tab(4) << "param." << i->GetID() << " = " << i->GetID()
- << ";" << NLine(1);
- } else {
- stream << Tab(4) << "param." << i->GetID() << " = new "
- << ConvertTypeToString(t)
- << "();" << NLine(1);
- stream << Tab(4) << "Deserialize(h, param." << i->GetID()
- << ");" << NLine(1);
- }
- }
- });
+std::string CsGeneratorBase::GetSerializer(const Structure& st) {
+ std::string str(ReplaceAll(CB_SERIALIZER)
+ .Change("<TYPE>", st.GetID())
+ .Change("<BODY>", [&]() {
+ std::string ret;
+ for (const auto& i : st.GetElements()) {
+ auto& t = i->GetType();
+ if (!t.IsUserDefinedType() && t.GetMetaType() == nullptr) {
+ ret += Tab(4) + "h.Write"
+ + ConvertTypeToParcelType(t.ToString())
+ + "(param."
+ + i->GetID()
+ + ");" + NLine(1);
+ } else {
+ ret += Tab(4) + "Serialize(h, param." + i->GetID()
+ + ");" + NLine(1);
+ }
+ }
+
+ return ret;
+ }));
+
+ str += ReplaceAll(CB_DESERIALIZER)
+ .Change("<TYPE>", st.GetID())
+ .Change("<BODY>", [&]() {
+ std::string ret;
+ for (const auto& i : st.GetElements()) {
+ auto& t = i->GetType();
+ if (!t.IsUserDefinedType() && t.GetMetaType() == nullptr) {
+ ret += Tab(4) + "var " + i->GetID() + " = "
+ + "h.Read"
+ + ConvertTypeToParcelType(t.ToString())
+ + "();" + NLine(1);
+ ret += Tab(4) + "param." + i->GetID() + " = " + i->GetID()
+ + ";" + NLine(1);
+ } else {
+ ret += Tab(4) + "param." + i->GetID() + " = new "
+ + ConvertTypeToString(t)
+ + "();" + NLine(1);
+ ret += Tab(4) + "Deserialize(h, param." + i->GetID()
+ + ");" + NLine(1);
+ }
+ }
+ return ret;
+ });
+ return str;
}
void CsGeneratorBase::GenSerializer(std::ofstream& stream) {
+ stream << GetSerializer();
+}
+
+std::string CsGeneratorBase::GetSerializer() {
+ std::string str;
for (auto& i : GetDocument().GetBlocks()) {
if (i->GetType() == Block::TYPE_STRUCTURE) {
const Structure& st = static_cast<const Structure&>(*i);
- GenSerializer(stream, st);
+ str += GetSerializer(st);
}
}
+
+ return str;
}
void CsGeneratorBase::AddSerializerList(const BaseType& type) {
void CsGeneratorBase::GenListSerializer(std::ofstream& stream,
const BaseType& type) {
- stream << NLine(1) << Tab(3) << "private static void Serialize(Parcel h, "
- << ConvertTypeToString(type) << " param)" << NLine(1);
- GenBrace(stream, TAB_SIZE * 3, [&]() {
- stream << Tab(4)
- << "h.WriteArrayCount(param.Count);"
- << NLine(1);
- stream << Tab(4) << "foreach (var i in param)" << NLine(1);
- GenBrace(stream, TAB_SIZE * 4, [&]() {
- auto* ptr = type.GetMetaType();
- if (ptr == nullptr) return;
-
- auto& mt = *ptr;
- if (!mt.IsUserDefinedType() && mt.GetMetaType() == nullptr) {
- stream << Tab(5) << "h.Write"
- << ConvertTypeToParcelType(mt.ToString())
- << "(i);" << NLine(1);
- } else {
- stream << Tab(5) << "Serialize(h, i);" << NLine(1);
- }
- });
- });
- stream << NLine(1);
+ stream << GetListSerializer(type);
+}
- stream << Tab(3) << "private static void Deserialize(Parcel h, "
- << ConvertTypeToString(type) << " param)" << NLine(1);
- GenBrace(stream, TAB_SIZE * 3, [&]() {
- stream << Tab(4)
- << "int l = h.ReadArrayCount();"
- << NLine(1);
- stream << Tab(4) << "for (int i = 0; i < l; i++)" << NLine(1);
- GenBrace(stream, TAB_SIZE * 4, [&]() {
- auto* ptr = type.GetMetaType();
- if (ptr == nullptr)
- return;
-
- auto& mt = *ptr;
- if (!mt.IsUserDefinedType() && mt.GetMetaType() == nullptr) {
- stream << Tab(5) << "var v = h.Read"
- << ConvertTypeToParcelType(mt.ToString())
- << "();" << NLine(1);
- } else {
- stream << Tab(5) << "var v = new " << ConvertTypeToString(mt)
- << "();" << NLine(1);
- stream << Tab(5) << "Deserialize(h, v);" << NLine(1);
- }
- if (type.ToString() == "list")
- stream << Tab(5) << "param.AddLast(v);" << NLine(1);
- else
- stream << Tab(5) << "param.Add(v);" << NLine(1);
- });
- });
+std::string CsGeneratorBase::GetListSerializer(const BaseType& type) {
+ std::string str(ReplaceAll(CB_LIST_SERIALIZER)
+ .Change("<TYPE>", ConvertTypeToString(type))
+ .Change("<BODY>", [&]() {
+ std::string ret;
+ auto* ptr = type.GetMetaType();
+ if (ptr == nullptr)
+ return ret;
+
+ auto& mt = *ptr;
+ if (!mt.IsUserDefinedType() && mt.GetMetaType() == nullptr) {
+ ret += Tab(5) + "h.Write"
+ + ConvertTypeToParcelType(mt.ToString())
+ + "(i);" + NLine(1);
+ } else {
+ ret += Tab(5) + "Serialize(h, i);" + NLine(1);
+ }
+ return ret;
+ }));
+
+ str += ReplaceAll(CB_DESERIALIZER)
+ .Change("<TYPE>", ConvertTypeToString(type))
+ .Change("<BODY>", [&]() {
+ std::string ret;
+ auto* ptr = type.GetMetaType();
+ if (ptr == nullptr)
+ return ret;
+
+ auto& mt = *ptr;
+ if (!mt.IsUserDefinedType() && mt.GetMetaType() == nullptr) {
+ ret += Tab(5) + "var v = h.Read"
+ + ConvertTypeToParcelType(mt.ToString())
+ + "();" + NLine(1);
+ } else {
+ ret += Tab(5) + "var v = new " + ConvertTypeToString(mt)
+ + "();" + NLine(1);
+ ret += Tab(5) + "Deserialize(h, v);" + NLine(1);
+ }
+
+ if (type.ToString() == "list")
+ ret += Tab(5) + "param.AddLast(v);" + NLine(1);
+ else
+ ret += Tab(5) + "param.Add(v);" + NLine(1);
+
+ return ret;
+ });
+
+ return str;
}
void CsGeneratorBase::GenListSerializer(std::ofstream& stream) {
+ stream << GetListSerializer();
+}
+
+std::string CsGeneratorBase::GetListSerializer() {
serializer_list_.clear();
for (auto& i : GetDocument().GetBlocks()) {
if (i->GetType() == Block::TYPE_STRUCTURE) {
}
}
+ std::string ret;
for (auto& p : serializer_list_) {
const BaseType* t = p.second;
- GenListSerializer(stream, *t);
+ ret += GetListSerializer(*t);
}
+
+ return ret;
}
std::string CsGeneratorBase::ConvertTypeToString(const BaseType& type) {
});
}
-void CsGeneratorBase::GenMethodId(std::ofstream& stream,
- const Interface& iface) {
- stream << Tab(3) << "private enum MethodId : int" << NLine(1);
- GenBrace(stream, TAB_SIZE * 3, [&]() {
- int cnt = 2;
- stream << Tab(4) << "__Result = 0," << NLine(1);
- stream << Tab(4) << "__Callback = 1," << NLine(1);
- for (const auto& i : iface.GetDeclarations()) {
- if (i->GetMethodType() == Declaration::MethodType::DELEGATE)
- continue;
- stream << Tab(4)
- << i->GetID() << " = " << cnt++ << "," << NLine(1);
- }
- });
+std::string CsGeneratorBase::GetMethodId(const Interface& iface) {
+ return std::string(ReplaceAll(CB_METHOD_IDS)
+ .Change("<METHOD_IDS>", [&](){
+ int cnt = 2;
+ std::string str;
+ for (const auto& i : iface.GetDeclarations()) {
+ if (i->GetMethodType() == Declaration::MethodType::DELEGATE)
+ continue;
+ str += Tab(4) + i->GetID() + " = " + std::to_string(cnt++) + "," + NLine(1);
+ }
+ return str;
+ }));
+}
+
+void CsGeneratorBase::GenMethodId(std::ofstream& stream, const Interface& iface) {
+ stream << GetMethodId(iface);
}
void CsGeneratorBase::GenDelegateId(std::ofstream& stream,
}
void CsGeneratorBase::GenDeclaration(std::ofstream& stream,
- const Declaration& decl, bool semicol) {
- stream << ConvertTypeToString(decl.GetType()) << " "
- << decl.GetID() << "(";
- GenParameters(stream, decl.GetParameters());
+ const Declaration& decl, bool semicol) {
+ stream << GetDeclaration(decl, semicol);
+}
+
+std::string CsGeneratorBase::GetDeclaration(const Declaration& decl, bool semicol) {
+ std::string ret;
+ ret += ConvertTypeToString(decl.GetType()) + " "
+ + decl.GetID() + "(";
+ ret += GetParameters(decl.GetParameters());
if (semicol)
- stream << ");";
+ ret += ");";
else
- stream << ")";
+ ret += ")";
+ return ret;
}
void CsGeneratorBase::GenParameters(std::ofstream& stream,
void GenStructures(std::ofstream& stream);
void GenStructure(std::ofstream& stream, const Structure& st);
void GenSerializer(std::ofstream& stream);
+ std::string GetSerializer();
void GenSerializer(std::ofstream& stream, const Structure& st);
+ std::string GetSerializer(const Structure& st);
void GenListSerializer(std::ofstream& stream);
+ std::string GetListSerializer();
void GenListSerializer(std::ofstream& stream, const BaseType& type);
+ std::string GetListSerializer(const BaseType& type);
void GenMethodId(std::ofstream& stream, const Interface& iface);
+ std::string GetMethodId(const Interface& iface);
void GenDelegateId(std::ofstream& stream, const Interface& iface);
void GenDeclaration(std::ofstream& stream,
const Declaration& decl, bool semicol = true);
+ std::string GetDeclaration(const Declaration& decl, bool semicol = true);
void GenParameters(std::ofstream& stream, const Parameters& ps);
void GenCallbacks(std::ofstream& stream, const Interface& iface,
bool is_proxy);
}
)__cs_cb";
+const char CB_METHOD_IDS[] =
+R"__cs_cb(
+ private enum MethodId : int
+ {
+ __Result = 0,
+ __Callback = 1,
+<METHOD_IDS>
+ }
+)__cs_cb";
+
+const char CB_SERIALIZER[] =
+R"__cs_cb(
+ private static void Serialize(Parcel h, <TYPE> param)
+ {
+<BODY>
+ }
+)__cs_cb";
+
+const char CB_DESERIALIZER[] =
+R"__cs_cb(
+ private static void Deserialize(Parcel h, <TYPE> param)
+ {
+<BODY>
+ }
+)__cs_cb";
+
+const char CB_LIST_SERIALIZER[] =
+R"__cs_cb(
+ private static void Serialize(Parcel h, <TYPE> param)
+ {
+ h.WriteArrayCount(param.Count);
+ foreach (var i in param)
+ {
+<BODY>
+ }
+ }
+)__cs_cb";
+
+const char CB_LIST_DESERIALIZER[] =
+R"__cs_cb(
+ private static void Deserialize(Parcel h, <TYPE> param)
+ {
+ int l = h.ReadArrayCount();
+ for (int i = 0; i < l; i++)
+ {
+<BODY>
+ }
+ }
+)__cs_cb";
+
+
#endif // IDLC_CS_GEN_CS_GEN_BASE_CB_H_
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "idlc/gen/cs_group_gen.h"
+
+namespace {
+#include "idlc/gen/cs_group_gen_cb.h"
+}
+
+namespace tidl {
+
+CsGroupGen::CsGroupGen(std::shared_ptr<Document> doc)
+ : CsGeneratorBase(doc) {}
+
+void CsGroupGen::OnInitGen(std::ofstream& stream) {
+ GenVersion(stream);
+ stream << CB_USING;
+ GenNamespace(stream);
+}
+
+void CsGroupGen::OnFiniGen(std::ofstream& stream) {
+}
+
+void CsGroupGen::GenNamespace(std::ofstream& stream) {
+ stream << NLine(1);
+ stream << "namespace RPCPort" << NLine(1);
+ GenBrace(stream, 0, [&]() {
+ stream << "namespace " << GetFileNamespace() << NLine(1);
+ GenBrace(stream, 0, [&]() {
+ GenStructures(stream);
+ stream << Tab(1) << "namespace Group" << NLine(1);
+ GenBrace(stream, TAB_SIZE, [&]() {
+ GenInterfaces(stream);
+ });
+ });
+ });
+}
+
+void CsGroupGen::GenInterfaces(std::ofstream& stream) {
+ for (auto& i : GetDocument().GetBlocks()) {
+ if (i->GetType() != Block::TYPE_INTERFACE)
+ continue;
+ Interface& iface = static_cast<Interface&>(*i);
+ GenInterface(stream, iface);
+ stream << NLine(1);
+ }
+}
+
+void CsGroupGen::GenInterface(std::ofstream& stream, const Interface& iface) {
+ ReplaceAll(CB_INTERFACE_FULL)
+ .Change("<CLS_NAME>", iface.GetID())
+ .Change("<METHOD_IDS>", GetMethodId(iface))
+ .Change("<SERIALIZER>", GetSerializer())
+ .Change("<LIST_SERIALIZER>", GetListSerializer())
+ .Change("<METHODS>", GetMethods(iface))
+ .Change("<DISPATCHERS>", GetDispatchers(iface))
+ .Out(stream);
+}
+
+std::string CsGroupGen::GetDispatchers(const Interface& iface) {
+ std::string ret;
+ for (const auto& i : iface.GetDeclarations()) {
+ ret += ReplaceAll(CB_DISPATCHER)
+ .Change("<METHOD_ID>", i->GetID())
+ .Change("<PARAM_DESERIALIZER>", GetParamDeserializer(*i))
+ .Change("<CALL_PARAMS>", GetCallParams(*i));
+ }
+
+ return ret;
+}
+
+std::string CsGroupGen::GetMethods(const Interface& iface) {
+ std::string ret;
+ auto& decls = iface.GetDeclarations();
+ for (const auto& i : decls) {
+ ret += ReplaceAll(CB_METHOD)
+ .Change("<PARAMS>", GetParameters(i->GetParameters()))
+ .Change("<COMMENTS>", i->GetComments().empty() ? "" :
+ AddIndent(TAB_SIZE * 3, i->GetComments()))
+ .Change("<DECL>", GetDeclaration(*i, false))
+ .Change("<METHOD_ID>", i->GetID())
+ .Change("<PARAM_SERIALIZER>", GetParamSerializer(*i))
+ .Change("<CLS_NAME>", iface.GetID());
+ }
+
+ return ret;
+}
+
+std::string CsGroupGen::GetParamSerializer(const Declaration& decl) {
+ std::string m;
+ for (const auto& i : decl.GetParameters()) {
+ auto& pt = i->GetParameterType();
+ if (pt.GetDirection() == ParameterType::Direction::OUT)
+ continue;
+ m += Tab(5) + ConvertTypeToSerializer(pt.GetBaseType(), i->GetID(), "p");
+ }
+
+ return m;
+}
+
+std::string CsGroupGen::GetParamDeserializer(const Declaration& decl) {
+ int cnt = 1;
+ std::string m;
+ for (const auto& i : decl.GetParameters()) {
+ if (i->GetParameterType().GetDirection() == ParameterType::Direction::OUT) {
+ cnt++;
+ continue;
+ }
+
+ std::string v = "param" + std::to_string(cnt);
+ std::string c = ConvertTypeToDeserializer(
+ i->GetParameterType().GetBaseType(), v, "p");
+ m += AddIndent(TAB_SIZE * 6, c);
+ cnt++;
+ }
+
+ return m;
+}
+
+std::string CsGroupGen::GetCallParams(const Declaration& decl) {
+ int cnt = 1;
+ std::string m;
+ for (const auto& i : decl.GetParameters()) {
+ if (cnt != 1) {
+ m += ", ";
+ }
+
+ std::string v = "param" + std::to_string(cnt);
+ auto& pt = i->GetParameterType();
+ if (pt.GetDirection() == ParameterType::Direction::OUT) {
+ m += "out " + ConvertTypeToString(pt.GetBaseType()) + " ";
+ } else if (pt.GetDirection() == ParameterType::Direction::REF) {
+ m += "ref ";
+ }
+ m += v;
+ cnt++;
+ }
+
+ return m;
+}
+
+} // namespace tidl
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_CS_GROUP_GEN_H_
+#define IDLC_GEN_CS_GROUP_GEN_H_
+
+#include <memory>
+#include <string>
+
+#include "idlc/gen/cs_gen_base.h"
+
+namespace tidl {
+
+class CsGroupGen : public CsGeneratorBase {
+ public:
+ explicit CsGroupGen(std::shared_ptr<Document> doc);
+ virtual ~CsGroupGen() = default;
+
+ void OnInitGen(std::ofstream& stream) override;
+ void OnFiniGen(std::ofstream& stream) override;
+
+ private:
+ void GenNamespace(std::ofstream& stream);
+ void GenInterfaces(std::ofstream& stream);
+ void GenInterface(std::ofstream& stream, const Interface& iface);
+ std::string GetMethods(const Interface& iface);
+ std::string GetParamSerializer(const Declaration& decl);
+ std::string GetParamDeserializer(const Declaration& decl);
+ std::string GetDispatchers(const Interface& iface);
+ std::string GetCallParams(const Declaration& decl);
+};
+
+} // namespace tidl
+
+#endif // IDLC_GEN_CS_GROUP_GEN_H_
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_CS_GROUP_GEN_CB_H_
+#define IDLC_GEN_CS_GROUP_GEN_CB_H_
+
+const char CB_USING[] =
+R"__cs_cb(
+using System;
+using Tizen.Applications;
+using Tizen.Applications.EventManager;
+using Tizen.Applications.RPCPort;
+
+)__cs_cb";
+
+const char CB_INTERFACE_FULL[] =
+R"__cs_cb(
+ public class <CLS_NAME> : IDisposable
+ {
+ private EventReceiver _eventReceiver;
+ private Object _lock = new Object();
+ private bool _disposedValue = false;
+
+ private Bundle GetBundleFromParcel(Parcel p)
+ {
+ byte[] bytes = p.ToBytes();
+ Bundle b = new Bundle();
+ b.AddItem("TIDL_RAW", bytes);
+ return b;
+ }
+
+ private Parcel GetParcelFromBundle(Bundle b)
+ {
+ byte[] bytes = (byte[])b.GetItem("TIDL_RAW");
+
+ return new Parcel(bytes);
+ }
+
+ private string GetEventName(string appid, string iface_name)
+ {
+ return "event." + appid + ".tidl_iface_" + iface_name;
+ }
+
+ private void OnReceive(Parcel p)
+ {
+ int cmd = p.ReadInt();
+
+ switch ((MethodId)cmd)
+ {
+<DISPATCHERS>
+ }
+ }
+
+<METHOD_IDS>
+<SERIALIZER>
+<LIST_SERIALIZER>
+
+ public <CLS_NAME>(string senderAppid)
+ {
+ string eventName = GetEventName(senderAppid, "<CLS_NAME>");
+ _eventReceiver = new EventReceiver(eventName);
+ _eventReceiver.Received += (obj, args) =>
+ {
+ Bundle b = args.Data;
+ using (var parcel = GetParcelFromBundle(b))
+ {
+ OnReceive(parcel);
+ }
+ };
+ }
+
+ public <CLS_NAME>()
+ {
+ }
+
+ ~<CLS_NAME>()
+ {
+ Dispose(false);
+ }
+
+ protected void Dispose(bool disposing)
+ {
+ if (!_disposedValue)
+ {
+ if (disposing)
+ {
+ if (_eventReceiver != null)
+ {
+ _eventReceiver.Dispose();
+ _eventReceiver = null;
+ }
+ }
+
+ _disposedValue = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+<METHODS>
+
+ }
+)__cs_cb";
+
+const char CB_METHOD[] =
+R"__cs_cb(
+ public delegate void <METHOD_ID>EventHandler(<PARAMS>);
+ public event <METHOD_ID>EventHandler <METHOD_ID>Event;
+<COMMENTS>
+ public <DECL>
+ {
+ using (Parcel p = new Parcel())
+ {
+ p.WriteInt((int)MethodId.<METHOD_ID>);
+<PARAM_SERIALIZER>
+ var bundle = GetBundleFromParcel(p);
+ string eventName = GetEventName(Application.Current.ApplicationInfo.ApplicationId, "<CLS_NAME>");
+ ApplicationEventManager.Publish(eventName, bundle);
+ }
+ }
+)__cs_cb";
+
+const char CB_DISPATCHER[] =
+R"__cs_cb(
+ case MethodId.<METHOD_ID>:
+ {
+<PARAM_DESERIALIZER>
+ <METHOD_ID>Event?.Invoke(<CALL_PARAMS>);
+ break;
+ }
+)__cs_cb";
+
+
+
+#endif // IDLC_GEN_CS_GROUP_GEN_CB_H_
#include "idlc/ast/parser.h"
#include "idlc/gen/cs_proxy_gen.h"
#include "idlc/gen/cs_stub_gen.h"
+#include "idlc/gen/cs_group_gen.h"
#include "idlc/gen/cs_lib_gen.h"
#include "idlc/gen/c_proxy_header_gen.h"
#include "idlc/gen/c_proxy_body_gen.h"
}
case tidl::Options::LANGUAGE_TYPE_CSHARP:
- case tidl::Options::LANGUAGE_TYPE_JAVA:
+ {
+ tidl::CsGroupGen group(ps.GetDoc());
+ group.Run(options->GetOutput() + ".cs");
+ break;
+ }
+
default:
break;
}