idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen.cc \
idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen.cc \
idlc/gen_aitt_plugin/aitt_plugin_loader.cc \
+ idlc/gen_aitt_plugin/aitt_plugin_java_transportable.cc \
idlc/options.cc \
idlc/main.cc
--- /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_aitt_plugin/aitt_plugin_java_transportable.h"
+
+#include <utility>
+
+#include "idlc/gen/replace_all.h"
+
+namespace {
+
+constexpr const char __CLIENT_BASE_CONSTRUCTOR[] =
+R"__java_cb(
+ /**
+ * Constructor
+ * @param mContext The Context
+ * @param serviceName Service name
+ */
+ public ClientBase(Context mContext, String serviceName, String brokerIp) {
+ mClient = new <CLIENT_CHANNEL>(mContext, serviceName, brokerIp);
+ this.mContext = mContext;
+ }
+)__java_cb";
+
+constexpr const char __SERVER_BASE_CONSTRUCTOR[] =
+R"__java_cb(
+ /**
+ * Constructor
+ * @param mContext Context
+ * @param mServiceName Service name
+ * @param mDisplayName Display name
+ */
+ public ServerBase(Context mContext, String mServiceName, String mDisplayName, String brokerIp) {
+ mServer = new <SERVER_CHANNEL>(mContext, mServiceName, mDisplayName, brokerIp);
+ this.mContext = mContext;
+ this.mServiceName = mServiceName;
+ this.mDisplayName = mDisplayName;
+ }
+)__java_cb";
+
+constexpr const char __GROUP_BASE_CONSTRUCTOR[] =
+R"__java_cb(
+ /**
+ * Constructor
+ * @param mContext The Context
+ * @param topicName Topic name
+ */
+ public GroupBase(Context mContext, String topicName, String brokerIp) {
+ mGroup = new <GROUP_CHANNEL>(mContext, topicName, brokerIp);
+ this.mContext = mContext;
+ }
+)__java_cb";
+
+} // namespace
+
+namespace tidl {
+
+std::string AittPluginJavaTransportable::GenInclude() const {
+ return "import org.tizen.aitt.*;";
+}
+
+std::string AittPluginJavaTransportable::GenParcelInclude() const {
+ return "import org.tizen.aitt.AittParcel;";
+}
+
+std::string AittPluginJavaTransportable::GenParcel() const {
+ return "AittParcel";
+}
+
+std::string AittPluginJavaTransportable::GenClientBaseConstructor() const {
+ return __CLIENT_BASE_CONSTRUCTOR;
+}
+
+std::string AittPluginJavaTransportable::GenServerBaseConstructor() const {
+ return __SERVER_BASE_CONSTRUCTOR;
+}
+
+std::string AittPluginJavaTransportable::GenGroupBaseConstructor() const {
+ return __GROUP_BASE_CONSTRUCTOR;
+}
+
+} // 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_AITT_PLUGIN_JAVA_TRANSPORTABLE_H_
+#define IDLC_GEN_AITT_PLUGIN_JAVA_TRANSPORTABLE_H_
+
+#include <string>
+
+#include "idlc/gen_cion/default_java_transportable.h"
+
+namespace tidl {
+
+class AittPluginJavaTransportable : public DefaultJavaTransportable {
+ public:
+ std::string GenInclude() const override;
+ std::string GenParcelInclude() const override;
+ std::string GenParcel() const override;
+ std::string GenClientBaseConstructor() const override;
+ std::string GenServerBaseConstructor() const override;
+ std::string GenGroupBaseConstructor() const override;
+};
+
+} // namespace tidl
+
+#endif // IDLC_GEN_AITT_PLUGIN_JAVA_TRANSPORTABLE_H_
#include "idlc/gen_aitt_plugin/aitt_plugin_loader.h"
#include "idlc/gen_aitt_plugin/aitt_plugin_c_transportable.h"
+#include "idlc/gen_aitt_plugin/aitt_plugin_java_transportable.h"
#include "idlc/gen_cion/default_cpp_transportable.h"
#include "idlc/gen_cion/default_java_transportable.h"
#include "idlc/gen_cion/default_cs_transportable.h"
C_.reset(new AittPluginCTransportable());
// Cpp_.reset(new DefaultCppTransportable());
// Cs_.reset(new DefaultCsTransportable());
-// Java_.reset(new DefaultJavaTransportable());
+ Java_.reset(new AittPluginJavaTransportable());
} else {
// TODO
}
constexpr const char __PEER_INFO_GET_UUID[] =
"<PEER>.getUuid()";
+constexpr const char __CLIENT_BASE_CONSTRUCTOR[] =
+R"__java_cb(
+ /**
+ * Constructor
+ * @param mContext The Context
+ * @param serviceName Service name
+ */
+ public ClientBase(Context mContext, String serviceName) {
+ mClient = new <CLIENT_CHANNEL>(mContext, serviceName);
+ this.mContext = mContext;
+ }
+
+ /**
+ * Constructor with security information
+ * @param mContext The context
+ * @param serviceName Service name
+ * @param sec Security information
+ */
+ public ClientBase(Context mContext, String serviceName, <SECURITY_T> sec) {
+ mClient = new <CLIENT_CHANNEL>(mContext, serviceName, sec);
+ this.mContext = mContext;
+ }
+)__java_cb";
+
+constexpr const char __SERVER_BASE_CONSTRUCTOR[] =
+R"__java_cb(
+ /**
+ * Constructor
+ * @param mContext Context
+ * @param mServiceName Service name
+ * @param mDisplayName Display name
+ */
+ public ServerBase(Context mContext, String mServiceName, String mDisplayName) {
+ mServer = new <SERVER_CHANNEL>(mContext, mServiceName, mDisplayName);
+ this.mContext = mContext;
+ this.mServiceName = mServiceName;
+ this.mDisplayName = mDisplayName;
+ }
+
+ /**
+ * Constructor with security information
+ * @param mContext Context
+ * @param mServiceName Service name
+ * @param mDisplayName Display name
+ * @param sec Security information
+ */
+ public ServerBase(Context mContext, String mServiceName, String mDisplayName, <SECURITY_T> sec) {
+ mServer = new <SERVER_CHANNEL>(mContext, mServiceName, mDisplayName, sec);
+ this.mContext = mContext;
+ this.mServiceName = mServiceName;
+ this.mDisplayName = mDisplayName;
+ }
+)__java_cb";
+
+constexpr const char __GROUP_BASE_CONSTRUCTOR[] =
+R"__java_cb(
+ /**
+ * Constructor
+ * @param mContext The Context
+ * @param topicName Topic name
+ */
+ public GroupBase(Context mContext, String topicName) {
+ mGroup = new <GROUP_CHANNEL>(mContext, topicName);
+ this.mContext = mContext;
+ }
+
+ /**
+ * Constructor with security information
+ * @param mContext The context
+ * @param topicName Topic name
+ * @param sec Security information
+ */
+ public GroupBase(Context mContext, String topicName, <SECURITY_T> sec) {
+ mGroup = new <GROUP_CHANNEL>(mContext, topicName, sec);
+ this.mContext = mContext;
+ }
+)__java_cb";
+
} // namespace
namespace tidl {
return "import org.tizen.cion.*;";
}
+std::string DefaultJavaTransportable::GenParcelInclude() const {
+ return "import org.tizen.cion.CionParcel;";
+}
+
+std::string DefaultJavaTransportable::GenParcel() const {
+ return "CionParcel";
+}
+
std::string DefaultJavaTransportable::GenClientChannel() const {
return "ClientChannel";
}
{ "<PEER>", peer} }));
}
+std::string DefaultJavaTransportable::GenClientBaseConstructor() const {
+ return __CLIENT_BASE_CONSTRUCTOR;
+}
+
+std::string DefaultJavaTransportable::GenServerBaseConstructor() const {
+ return __SERVER_BASE_CONSTRUCTOR;
+}
+
+std::string DefaultJavaTransportable::GenGroupBaseConstructor() const {
+ return __GROUP_BASE_CONSTRUCTOR;
+}
+
} // namespace tidl
public:
virtual ~DefaultJavaTransportable() = default;
std::string GenInclude() const override;
+ std::string GenParcelInclude() const override;
+ std::string GenParcel() const override;
std::string GenClientChannel() const override;
std::string GenServerChannel() const override;
std::string GenGroupChannel() const override;
std::string peer) const override;
std::string GenPeerInfoGetAppID(std::string peer) const override;
std::string GenPeerInfoGetUUID(std::string peer) const override;
+ std::string GenClientBaseConstructor() const override;
+ std::string GenServerBaseConstructor() const override;
+ std::string GenGroupBaseConstructor() const override;
};
} // namespace tidl
stream.open(fname + "/DelegatorBase.java");
stream << "package org.tizen.gen." << FileName + ".common;" << NLine(1);
- stream << ReplaceAll(DELEGATOR_BASE, "<DELEGATOR_IDS>", GetDelegateId());
+ stream << ReplaceAll(DELEGATOR_BASE, {
+ { "<DELEGATOR_IDS>", GetDelegateId() },
+ { "<PARCEL_INCLUDE>", GetTransportable().Java().GenParcelInclude() },
+ { "<PARCEL>", GetTransportable().Java().GenParcel() }
+ });
stream.close();
stream.open(fname + "/NotConnectedSocketException.java");
void JavaCionGeneratorBase::GenSerializer(std::ofstream& stream,
const Structure& st) {
- stream << Tab(1) << "private static void serialize(CionParcel h, "
- << st.GetID() << " param) ";
+ stream << Tab(1) << ReplaceAll("private static void serialize(<PARCEL> h, ",
+ "<PARCEL>", GetTransportable().Java().GenParcel())
+ << st.GetID() << " param) ";
GenBrace(stream, TAB_SIZE * 1, [&]() {
for (const auto& i : st.GetElements()) {
auto& t = i->GetType();
}
}, false);
stream << NLine(1);
- stream << Tab(1) << "private static void deserialize(CionParcel h, "
- << st.GetID() << " param) ";
+ stream << Tab(1) << ReplaceAll("private static void deserialize(<PARCEL> h, ",
+ "<PARCEL>", GetTransportable().Java().GenParcel())
+ << st.GetID() << " param) ";
GenBrace(stream, TAB_SIZE * 1, [&]() {
for (const auto& i : st.GetElements()) {
auto& t = i->GetType();
return;
auto& mt = *ptr;
- stream << Tab(1) << "private static void serialize(CionParcel h, "
- << ConvertTypeToString(type) << " param, "
- << ConvertTypeToString(mt, true) << " a) ";
+ stream << Tab(1) << ReplaceAll("private static void serialize(<PARCEL> h, ",
+ "<PARCEL>", GetTransportable().Java().GenParcel())
+ << ConvertTypeToString(type) << " param, "
+ << ConvertTypeToString(mt, true) << " a) ";
GenBrace(stream, TAB_SIZE, [&]() {
stream << Tab(2)
<< "h.write(param.size());"
}, false);
stream << NLine(1);
- stream << Tab(1) << "private static void deserialize(CionParcel h, "
- << ConvertTypeToString(type) << " param, "
- << ConvertTypeToString(mt, true) << " a) ";
+ stream << Tab(1) << ReplaceAll("private static void deserialize(<PARCEL> h, ",
+ "<PARCEL>", GetTransportable().Java().GenParcel())
+ << ConvertTypeToString(type) << " param, "
+ << ConvertTypeToString(mt, true) << " a) ";
GenBrace(stream, TAB_SIZE, [&]() {
stream << Tab(2)
<< "int l = h.readInt();"
const Declaration& decl, const std::string& id) {
std::string str;
- str = ReplaceAll(CB_CALLBACK_CLASS_PROXY, "<CLS_NAME>", decl.GetID());
+ str = ReplaceAll(CB_CALLBACK_CLASS_PROXY, {
+ { "<CLS_NAME>", decl.GetID() },
+ { "<PARCEL>", GetTransportable().Java().GenParcel() }
+ });
str = ReplaceAll(str, "<CALLBACK_PARAMS>",
GetParameters(decl.GetParameters()));
str = ReplaceAll(str, "<METHOD_ON_INVOKED>",
std::string str;
str = ReplaceAll(CB_CALLBACK_CLASS_STUB, {
{ "<CLS_NAME>", decl.GetID() },
- { "<PEER_INFO_T>", GetTransportable().Java().GenPeerInfoType() }
+ { "<PEER_INFO_T>", GetTransportable().Java().GenPeerInfoType() },
+ { "<PARCEL>", GetTransportable().Java().GenParcel() }
});
str = ReplaceAll(str, "<CALLBACK_PARAMS>",
GetParameters(decl.GetParameters()));
private <CLIENT_CHANNEL> mClient;
private Context mContext;
-
- /**
- * Constructor
- * @param mContext The Context
- * @param serviceName Service name
- */
- public ClientBase(Context mContext, String serviceName) {
- mClient = new <CLIENT_CHANNEL>(mContext, serviceName);
- this.mContext = mContext;
- }
-
- /**
- * Constructor with security information
- * @param mContext The context
- * @param serviceName Service name
- * @param sec Security information
- */
- public ClientBase(Context mContext, String serviceName, <SECURITY_T> sec) {
- mClient = new <CLIENT_CHANNEL>(mContext, serviceName, sec);
- this.mContext = mContext;
- }
-
+<CLIENT_BASE_CONSTRUCTOR>
/**
* Disconnects server
*/
private String mServiceName;
private String mDisplayName;
-
- /**
- * Constructor
- * @param mContext Context
- * @param mServiceName Service name
- * @param mDisplayName Display name
- */
- public ServerBase(Context mContext, String mServiceName, String mDisplayName) {
- mServer = new <SERVER_CHANNEL>(mContext, mServiceName, mDisplayName);
- this.mContext = mContext;
- this.mServiceName = mServiceName;
- this.mDisplayName = mDisplayName;
- }
-
- /**
- * Constructor with security information
- * @param mContext Context
- * @param mServiceName Service name
- * @param mDisplayName Display name
- * @param sec Security information
- */
- public ServerBase(Context mContext, String mServiceName, String mDisplayName, <SECURITY_T> sec) {
- mServer = new <SERVER_CHANNEL>(mContext, mServiceName, mDisplayName, sec);
- this.mContext = mContext;
- this.mServiceName = mServiceName;
- this.mDisplayName = mDisplayName;
- }
-
+<SERVER_BASE_CONSTRUCTOR>
/**
* Gets context
* @return Context
private <GROUP_CHANNEL> mGroup;
private Context mContext;
-
- /**
- * Constructor
- * @param mContext The Context
- * @param topicName Topic name
- */
- public GroupBase(Context mContext, String topicName) {
- mGroup = new <GROUP_CHANNEL>(mContext, topicName);
- this.mContext = mContext;
- }
-
- /**
- * Constructor with security information
- * @param mContext The context
- * @param topicName Topic name
- * @param sec Security information
- */
- public GroupBase(Context mContext, String topicName, <SECURITY_T> sec) {
- mGroup = new <GROUP_CHANNEL>(mContext, topicName, sec);
- this.mContext = mContext;
- }
-
+<GROUP_BASE_CONSTRUCTOR>
/**
* Subscribes the topic.
*/
const char DELEGATOR_BASE[] =
R"__java_cb(
-import org.tizen.cion.CionParcel;
+<PARCEL_INCLUDE>
/**
* Abstract class for making delegator
* This method will be invoked when the remote callback is called
* @param parcel Data
*/
- public abstract void onInvoked(CionParcel parcel);
+ public abstract void onInvoked(<PARCEL> parcel);
/**
* Gets sequence ID
return mOnce;
}
- public static void serialize(CionParcel h, DelegatorBase from) {
+ public static void serialize(<PARCEL> h, DelegatorBase from) {
h.write(from.mId);
h.write(from.mSeqId);
h.write(from.mOnce);
}
- public static void deserialize(CionParcel h, DelegatorBase to) {
+ public static void deserialize(<PARCEL> h, DelegatorBase to) {
to.mId = h.readInt();
to.mSeqId = h.readInt();
to.mOnce = h.readBoolean();
}
@Override
- public final void onInvoked(CionParcel parcel) {
+ public final void onInvoked(<PARCEL> parcel) {
<METHOD_ON_INVOKED>
}
}
@Override
- public final void onInvoked(CionParcel parcel) {}
+ public final void onInvoked(<PARCEL> parcel) {}
/**
* Invokes a remote callback
if (isOnce() && !mValid)
throw new InvalidCallbackException();
- CionParcel p = new CionParcel();
+ <PARCEL> p = new <PARCEL>();
p.write(__CALLBACK);
serialize(p, this);
void JavaCionGroupGen::GenCionPayloadReceivedEvent(std::ofstream& stream,
const Interface& iface) {
- stream << ReplaceAll(CB_ON_PAYLOAD_RECEIVED_FRONT,
- "<PEER_INFO_T>", GetTransportable().Java().GenPeerInfoType());
+ stream << ReplaceAll(CB_ON_PAYLOAD_RECEIVED_FRONT, {
+ { "<PEER_INFO_T>", GetTransportable().Java().GenPeerInfoType() },
+ { "<PARCEL>", GetTransportable().Java().GenParcel() }
+ });
for (const auto& i : iface.GetDeclarations()) {
if (i->GetMethodType() == Declaration::MethodType::DELEGATE ||
}
void JavaCionGroupGen::GenInvocation(std::ofstream& stream, const Declaration& decl) {
- GenTemplate(CB_INVOCATION_PRE, stream,
+ GenTemplate(std::string(ReplaceAll(CB_INVOCATION_PRE,
+ "<PARCEL>", GetTransportable().Java().GenParcel())), stream,
[&]()->std::string {
std::string st;
st += Tab(2)
return;
}
- CionParcel parcelReceived;
+ <PARCEL> parcelReceived;
- parcelReceived = new CionParcel(((DataPayload)payload).getData());
+ parcelReceived = new <PARCEL>(((DataPayload)payload).getData());
int cmd = parcelReceived.readInt();
switch (cmd)
{
)__java_cb";
const char CB_INVOCATION_PRE[] =
-R"__java_cb( CionParcel p = new CionParcel();
+R"__java_cb( <PARCEL> p = new <PARCEL>();
$$
)__java_cb";
stream << "package org.tizen.gen." << FileName + ".group;" << NLine(2);
stream << ReplaceAll(DEFAULT_GROUP_REPO, {
{ "<INCLUDE>", GetTransportable().Java().GenInclude() },
+ { "<GROUP_BASE_CONSTRUCTOR>",
+ GetTransportable().Java().GenGroupBaseConstructor() },
{ "<GROUP_CHANNEL>", GetTransportable().Java().GenGroupChannel() },
{ "<GROUP_SUBSCRIBE>",
GetTransportable().Java().GenGroupSubscribe("mGroup") },
GenCallbacks(stream, iface, true);
GenDelegateId(stream, iface);
GenMethodId(stream, iface);
- stream << ReplaceAll(CB_EVENT_METHODS,
- "<PEER_INFO_T>", GetTransportable().Java().GenPeerInfoType());
+ stream << ReplaceAll(CB_EVENT_METHODS, {
+ { "<PEER_INFO_T>", GetTransportable().Java().GenPeerInfoType() },
+ { "<PARCEL>", GetTransportable().Java().GenParcel() },
+ });
GenSerializer(stream);
GenListSerializer(stream);
GenShareFile(stream, iface, true);
}
void JavaCionProxyGen::GenInvocation(std::ofstream& stream, const Declaration& decl) {
- GenTemplate(CB_INVOCATION_PRE, stream,
+ GenTemplate(std::string(ReplaceAll(CB_INVOCATION_PRE, "<PARCEL>",
+ GetTransportable().Java().GenParcel())), stream,
[&]()->std::string {
std::string st;
st += Tab(2)
if (decl.GetMethodType() == Declaration::MethodType::ASYNC) {
st += CB_ASYNC_INVOCATION_MID;
} else {
- st += CB_SYNC_INVOCATION_MID;
+ st += ReplaceAll(CB_SYNC_INVOCATION_MID,
+ "<PARCEL>", GetTransportable().Java().GenParcel());
}
for (const auto& i : decl.GetParameters()) {
const char CB_EVENT_METHODS[] =
R"__java_cb(
- private void processReceivedEvent(CionParcel parcel) {
+ private void processReceivedEvent(<PARCEL> parcel) {
int id = parcel.readInt();
int seqId = parcel.readInt();
boolean once = parcel.readBoolean();
if(payload.getType() == IPayload.PayloadType.PAYLOAD_FILE) {
onFileReceived((FilePayload)payload, status);
} else {
- CionParcel parcelReceived;
+ <PARCEL> parcelReceived;
- parcelReceived = new CionParcel(((DataPayload)payload).getData());
+ parcelReceived = new <PARCEL>(((DataPayload)payload).getData());
int cmd = parcelReceived.readInt();
if (cmd != __CALLBACK)
return;
R"__java_cb( if (!mOnline)
throw new NotConnectedSocketException();
- CionParcel p = new CionParcel();
+ <PARCEL> p = new <PARCEL>();
$$
)__java_cb";
// Send
byte[] dataReceived = sendData(p.toByteArray());
- CionParcel parcelReceived = new CionParcel(dataReceived);
+ <PARCEL> parcelReceived = new <PARCEL>(dataReceived);
int cmd = parcelReceived.readInt();
if (cmd != __RESULT)
stream << ReplaceAll(DEFAULT_PROXY_REPO, {
{ "<INCLUDE>", GetTransportable().Java().GenInclude() },
{ "<PEER_INFO_T>", GetTransportable().Java().GenPeerInfoType() },
+ { "<CLIENT_BASE_CONSTRUCTOR>",
+ GetTransportable().Java().GenClientBaseConstructor() },
{ "<CLIENT_CHANNEL>", GetTransportable().Java().GenClientChannel() },
{ "<CLIENT_SEND_ASYNC>", GetTransportable().Java()
.GenClientSendAsync("mClient", "payload") },
const Structure& st) {
const char variable[] = "$$\n";
- stream << "import org.tizen.cion.CionParcel;" << NLine(1);
+ stream << GetTransportable().Java().GenParcelInclude() << NLine(1);
stream << "import java.util.ArrayList;" << NLine(1);
stream << "import java.util.LinkedList;" << NLine(1);
stream << NLine(1);
GetTransportable().Java().GenPeerInfoGetUUID("i.mClient") },
{ "<PEER_INFO_GET_UUID2>",
GetTransportable().Java().GenPeerInfoGetUUID("info") },
+ { "<PARCEL>", GetTransportable().Java().GenParcel() }
});
for (const auto& i : iface.GetDeclarations()) {
if (i->GetMethodType() != Declaration::MethodType::SYNC)
GetTransportable().Java().GenPeerInfoGetUUID("i.mClient") },
{ "<PEER_INFO_GET_UUID2>",
GetTransportable().Java().GenPeerInfoGetUUID("info") },
+ { "<PARCEL>", GetTransportable().Java().GenParcel() }
});
for (const auto& i : iface.GetDeclarations()) {
if (i->GetMethodType() != Declaration::MethodType::ASYNC)
@Override
public final void onPayloadReceived(<PEER_INFO_T> info, IPayload data, PayloadTransferStatus status) {
try {
- CionParcel p;
+ <PARCEL> p;
ServiceBase b = null;
for (ServiceBase i : mServices) {
}
DataPayload dp = (DataPayload)data;
- p = new CionParcel(dp.getData());
+ p = new <PARCEL>(dp.getData());
int cmd = p.readInt();
switch (cmd) {
)__java_cb";
R"__java_cb(
@Override
public final byte[] onDataReceived(<PEER_INFO_T> info, byte[] data) {
- CionParcel p;
+ <PARCEL> p;
byte[] returnData = new byte[0];
- p = new CionParcel(data);
+ p = new <PARCEL>(data);
try {
ServiceBase b = null;
if (b == null)
return returnData;
- CionParcel result = new CionParcel();
+ <PARCEL> result = new <PARCEL>();
int cmd = p.readInt();
switch (cmd) {
stream << ReplaceAll(DEFAULT_STUB_REPO, {
{ "<INCLUDE>", GetTransportable().Java().GenInclude() },
{ "<PEER_INFO_T>", GetTransportable().Java().GenPeerInfoType() },
+ { "<SERVER_BASE_CONSTRUCTOR>",
+ GetTransportable().Java().GenServerBaseConstructor() },
{ "<SERVER_CHANNEL>", GetTransportable().Java().GenServerChannel() },
{ "<SERVER_SEND_ASYNC>", GetTransportable().Java().GenServerSendAsync("mServer", "payload") },
{ "<SERVER_LISTEN>", GetTransportable().Java().GenServerListen("mServer") },
public:
virtual ~JavaTransportable() = default;
virtual std::string GenInclude() const = 0;
+ virtual std::string GenParcelInclude() const = 0;
+ virtual std::string GenParcel() const = 0;
virtual std::string GenClientChannel() const = 0;
virtual std::string GenServerChannel() const = 0;
virtual std::string GenGroupChannel() const = 0;
std::string peer) const = 0;
virtual std::string GenPeerInfoGetAppID(std::string peer) const = 0;
virtual std::string GenPeerInfoGetUUID(std::string peer) const = 0;
+ virtual std::string GenClientBaseConstructor() const = 0;
+ virtual std::string GenServerBaseConstructor() const = 0;
+ virtual std::string GenGroupBaseConstructor() const = 0;
};
} // namespace tidl
}
case tidl::Options::LANGUAGE_TYPE_JAVA:
{
+ tidl::JavaCionStubRepoGen repo(ps.GetDoc(), trans);
+ repo.Run(options->GetOutput(), true);
+
+ tidl::JavaCionStubGen view_model(ps.GetDoc(), trans);
+ view_model.Run(options->GetOutput(), true);
+
+ tidl::JavaCionUtilityGen utilities(ps.GetDoc(), trans);
+ utilities.Run(options->GetOutput(), true);
+
+ tidl::JavaCionStructureGen structures(ps.GetDoc(), trans);
+ structures.Run(options->GetOutput(), true);
+
+ tidl::JavaCionCommonGen cgen(ps.GetDoc(), trans);
+ cgen.Run(options->GetOutput(), true);
break;
}
}
case tidl::Options::LANGUAGE_TYPE_JAVA:
{
+ tidl::JavaCionProxyRepoGen base_files(ps.GetDoc(), trans);
+ base_files.Run(options->GetOutput(), true);
+
+ tidl::JavaCionProxyGen view_model(ps.GetDoc(), trans);
+ view_model.Run(options->GetOutput(), true);
+
+ tidl::JavaCionUtilityGen utilities(ps.GetDoc(), trans);
+ utilities.Run(options->GetOutput(), true);
+
+ tidl::JavaCionStructureGen structures(ps.GetDoc(), trans);
+ structures.Run(options->GetOutput(), true);
+
+ tidl::JavaCionCommonGen cgen(ps.GetDoc(), trans);
+ cgen.Run(options->GetOutput(), true);
break;
}
}
case tidl::Options::LANGUAGE_TYPE_JAVA:
{
+ tidl::JavaCionGroupRepoGen repo(ps.GetDoc(), trans);
+ repo.Run(options->GetOutput(), true);
+
+ tidl::JavaCionGroupGen view_model(ps.GetDoc(), trans);
+ view_model.Run(options->GetOutput(), true);
+
+ tidl::JavaCionUtilityGen utilities(ps.GetDoc(), trans);
+ utilities.Run(options->GetOutput(), true);
+
+ tidl::JavaCionStructureGen structures(ps.GetDoc(), trans);
+ structures.Run(options->GetOutput(), true);
+
+ tidl::JavaCionCommonGen cgen(ps.GetDoc(), trans);
+ cgen.Run(options->GetOutput(), true);
break;
}