From: Sangyoon Jang Date: Wed, 13 Apr 2022 08:01:37 +0000 (+0900) Subject: Adjust plugin structure for type c# X-Git-Tag: submit/tizen/20220729.020211~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F50%2F273750%2F3;p=platform%2Fcore%2Fappfw%2Ftidl.git Adjust plugin structure for type c# Change-Id: Id5db0f951b8dde25112400c5ac57aa7718a3d622 Signed-off-by: Sangyoon Jang --- diff --git a/idlc/gen_cion/cs_cion_gen_base.cc b/idlc/gen_cion/cs_cion_gen_base.cc index 73cb338..8a7d9a3 100644 --- a/idlc/gen_cion/cs_cion_gen_base.cc +++ b/idlc/gen_cion/cs_cion_gen_base.cc @@ -27,7 +27,7 @@ namespace { namespace tidl { CsCionGeneratorBase::CsCionGeneratorBase(std::shared_ptr doc) - : Generator(doc) { + : CionPluginBase(std::move(doc)) { type_map_ = { {"char", "byte"}, {"int", "int"}, {"short", "short"}, {"long", "long"}, {"string", "string"}, {"bool", "bool"}, @@ -235,7 +235,9 @@ void CsCionGeneratorBase::GenShareFile(std::ofstream& stream, const Interface& i if (hasFile == false) return; - stream << CB_SHARE_FILE_DEF << NLine(1); + ReplaceAll(CB_SHARE_FILE_DEF) + .Change("", GetTransportable().Cs().GenFileSend("path")) + .Out(stream); } void CsCionGeneratorBase::AddSerializerList(const BaseType& type) { diff --git a/idlc/gen_cion/cs_cion_gen_base.h b/idlc/gen_cion/cs_cion_gen_base.h index 57e04d4..ee847fe 100644 --- a/idlc/gen_cion/cs_cion_gen_base.h +++ b/idlc/gen_cion/cs_cion_gen_base.h @@ -23,11 +23,11 @@ #include "idlc/ast/type.h" #include "idlc/ast/structure.h" -#include "idlc/gen/generator.h" +#include "idlc/gen_cion/cion_plugin_base.h" namespace tidl { -class CsCionGeneratorBase : public Generator { +class CsCionGeneratorBase : public CionPluginBase { public: explicit CsCionGeneratorBase(std::shared_ptr doc); virtual ~CsCionGeneratorBase() = default; diff --git a/idlc/gen_cion/cs_cion_gen_base_cb.h b/idlc/gen_cion/cs_cion_gen_base_cb.h index 5fd1441..994f884 100644 --- a/idlc/gen_cion/cs_cion_gen_base_cb.h +++ b/idlc/gen_cion/cs_cion_gen_base_cb.h @@ -145,11 +145,7 @@ R"__cs_cb( private void TryShareFile(string path) { - if (path == null) - throw new ArgumentException("Invalid path"); - - FilePayload fp = new FilePayload(path); - base.SendPayloadAsync(fp); + } )__cs_cb"; diff --git a/idlc/gen_cion/cs_cion_group_gen.cc b/idlc/gen_cion/cs_cion_group_gen.cc index 99e72f1..3aa49a9 100644 --- a/idlc/gen_cion/cs_cion_group_gen.cc +++ b/idlc/gen_cion/cs_cion_group_gen.cc @@ -27,12 +27,7 @@ CsCionGroupGen::CsCionGroupGen(std::shared_ptr doc) void CsCionGroupGen::OnInitGen(std::ofstream& stream) { GenVersion(stream); - stream << "using System;" << NLine(1) - << "using System.Collections.Generic;" << NLine(1) - << "using System.Threading;" << NLine(1) - << "using Tizen.Applications;" << NLine(1) - << "using Tizen.Applications.RPCPort;" << NLine(1) - << "using Tizen.Applications.Cion;" << NLine(1); + stream << GetTransportable().Cs().GenInclude(); GenNamespace(stream); } @@ -68,11 +63,15 @@ void CsCionGroupGen::GenInterface(std::ofstream& stream, const Interface& iface) stream << Tab(2) << "public class " << iface.GetID() << " : GroupBase" << NLine(1); GenBrace(stream, TAB_SIZE * 2, [&]() { - stream << ReplaceAll(CB_DATA_MEMBERS, "", FULLVER); + ReplaceAll(CB_DATA_MEMBERS) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Out(stream); GenEvents(stream, iface); stream << NLine(1); GenMethodId(stream, iface, true); - stream << CB_EVENT_METHODS; + ReplaceAll(CB_EVENT_METHODS) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Out(stream); GenSerializer(stream); GenListSerializer(stream); GenCtor(stream, iface); @@ -206,7 +205,10 @@ void CsCionGroupGen::GenInvocation(std::ofstream& stream, void CsCionGroupGen::GenCionPayloadReceivedEvent(std::ofstream& stream, const Interface& iface) { - stream << CB_ON_PAYLOAD_RECEIVED_FRONT; + ReplaceAll(CB_ON_PAYLOAD_RECEIVED_FRONT) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Change("", GetTransportable().Cs().GenPayloadType()) + .Out(stream); for (const auto& i : iface.GetDeclarations()) { if (i->GetMethodType() == Declaration::MethodType::DELEGATE || diff --git a/idlc/gen_cion/cs_cion_group_gen_cb.h b/idlc/gen_cion/cs_cion_group_gen_cb.h index ef8c40e..dd01b14 100644 --- a/idlc/gen_cion/cs_cion_group_gen_cb.h +++ b/idlc/gen_cion/cs_cion_group_gen_cb.h @@ -21,8 +21,8 @@ * Version of TIDL Compiler. */ const char CB_DATA_MEMBERS[] = -R"__cs_cb( public delegate void JoinedHandler(object sender, PeerInfo peerInfo); - public delegate void LeftHandler(object sender, PeerInfo peerInfo); +R"__cs_cb( public delegate void JoinedHandler(object sender, peerInfo); + public delegate void LeftHandler(object sender, peerInfo); /// /// This event will be invoked when the peer group app is joined to the topic. @@ -64,12 +64,12 @@ R"__cs_cb( const char CB_EVENT_METHODS[] = R"__cs_cb( - protected override void OnJoined(PeerInfo peerInfo) + protected override void OnJoined( peerInfo) { Joined?.Invoke(this, peerInfo); } - protected override void OnLeft(PeerInfo peerInfo) + protected override void OnLeft( peerInfo) { Left?.Invoke(this, peerInfo); } @@ -77,7 +77,7 @@ R"__cs_cb( const char CB_ON_PAYLOAD_RECEIVED_FRONT[] = R"__cs_cb( - protected override void OnPayloadReceived(Payload payload, PeerInfo peerInfo) + protected override void OnPayloadReceived( payload, peerInfo) { Parcel parcelReceived; diff --git a/idlc/gen_cion/cs_cion_proxy_gen.cc b/idlc/gen_cion/cs_cion_proxy_gen.cc index 7266b08..d3c69c4 100644 --- a/idlc/gen_cion/cs_cion_proxy_gen.cc +++ b/idlc/gen_cion/cs_cion_proxy_gen.cc @@ -27,12 +27,7 @@ CsCionProxyGen::CsCionProxyGen(std::shared_ptr doc) void CsCionProxyGen::OnInitGen(std::ofstream& stream) { GenVersion(stream); - stream << "using System;" << NLine(1) - << "using System.Collections.Generic;" << NLine(1) - << "using System.Threading;" << NLine(1) - << "using Tizen.Applications;" << NLine(1) - << "using Tizen.Applications.RPCPort;" << NLine(1) - << "using Tizen.Applications.Cion;" << NLine(1); + stream << GetTransportable().Cs().GenInclude(); GenNamespace(stream); } @@ -67,7 +62,11 @@ void CsCionProxyGen::GenInterface(std::ofstream& stream, const Interface& iface) stream << Tab(2) << "public class " << iface.GetID() << " : ClientBase" << NLine(1); GenBrace(stream, TAB_SIZE * 2, [&]() { - stream << ReplaceAll(CB_DATA_MEMBERS, "", FULLVER); + ReplaceAll(CB_DATA_MEMBERS) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Change("", + GetTransportable().Cs().GenPayloadTransferStatusType()) + .Out(stream); GenCallbacks(stream, iface, true); GenDelegateId(stream, iface); GenMethodId(stream, iface); @@ -119,7 +118,9 @@ void CsCionProxyGen::GenCtor(std::ofstream& stream, const Interface& iface) { void CsCionProxyGen::GenConnectMethod(std::ofstream& stream, const Interface& iface) { - stream << CB_CONNECT_METHOD; + ReplaceAll(CB_CONNECT_METHOD) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Out(stream); stream << NLine(1); } diff --git a/idlc/gen_cion/cs_cion_proxy_gen_cb.h b/idlc/gen_cion/cs_cion_proxy_gen_cb.h index f321b2c..85169a8 100644 --- a/idlc/gen_cion/cs_cion_proxy_gen_cb.h +++ b/idlc/gen_cion/cs_cion_proxy_gen_cb.h @@ -21,9 +21,9 @@ * Version of TIDL Compiler. */ const char CB_DATA_MEMBERS[] = -R"__cs_cb( public delegate void DiscoveredEvent(object sender, PeerInfo peerInfo); +R"__cs_cb( public delegate void DiscoveredEvent(object sender, peerInfo); public delegate void DisconnectedEvent(object sender); - public delegate void FileReceivedEvent(object sender, FilePayload payload, PayloadTransferStatus status); + public delegate void FileReceivedEvent(object sender, FilePayload payload, status); public delegate void ConnectionResultEvent(object sender, ConnectionResult result); public event DiscoveredEvent Discovered; @@ -40,30 +40,30 @@ R"__cs_cb( public delegate void DiscoveredEvent(object sender, PeerIn const char CB_EVENT_METHODS[] = R"__cs_cb( - protected override void OnConnectionResult(PeerInfo peerInfo, ConnectionResult result) + protected override void OnConnectionResult( peerInfo, ConnectionResult result) { - if (result.Status == ConnectionStatus.OK) - { + if (result.Status == ConnectionStatus.OK) + { _online = true; - } + } ConnectionResult?.Invoke(this, result); } - protected override void OnDisconnected(PeerInfo peerInfo) + protected override void OnDisconnected( peerInfo) { _online = false; Disconnected?.Invoke(this); } - protected override void OnDiscovered(PeerInfo peerInfo) + protected override void OnDiscovered( peerInfo) { Discovered?.Invoke(this, peerInfo); } - protected override void OnPayloadReceived(Payload payload, PayloadTransferStatus status) + protected override void OnPayloadReceived( payload, status) { - if(payload.PayloadType == PayloadType.FilePayload) + if(payload.PayloadType == ) { FileReceived?.Invoke(this, (FilePayload)payload, status); } @@ -136,7 +136,7 @@ R"__cs_cb( /// Thrown when the permission is denied. /// /// If you want to use this method, you must add privileges. - public new void Connect(PeerInfo peer) + public new void Connect( peer) { base.Connect(peer); } @@ -191,7 +191,7 @@ $$ const char CB_ASYNC_INVOCATION_MID[] = R"__cs_cb( // Send - DataPayload dp = new DataPayload(p.ToBytes()); + DataPayload dp = new DataPayload(p.ToBytes()); base.SendPayloadAsync(dp); )__cs_cb"; diff --git a/idlc/gen_cion/cs_cion_stub_gen.cc b/idlc/gen_cion/cs_cion_stub_gen.cc index 4aaadc1..b47f572 100644 --- a/idlc/gen_cion/cs_cion_stub_gen.cc +++ b/idlc/gen_cion/cs_cion_stub_gen.cc @@ -27,11 +27,7 @@ CsCionStubGen::CsCionStubGen(std::shared_ptr doc) void CsCionStubGen::OnInitGen(std::ofstream& stream) { GenVersion(stream); - stream << "using System;" << NLine(1) - << "using System.Collections.Generic;" << NLine(1) - << "using Tizen.Applications;" << NLine(1) - << "using Tizen.Applications.RPCPort;" << NLine(1) - << "using Tizen.Applications.Cion;" << NLine(1); + stream << GetTransportable().Cs().GenInclude(); GenNamespace(stream); } @@ -66,7 +62,6 @@ void CsCionStubGen::GenInterface(std::ofstream& stream, const Interface& iface) stream << Tab(2) << "public sealed class " << iface.GetID() << " : ServerBase" << NLine(1); GenBrace(stream, TAB_SIZE * 2, [&]() { - stream << ReplaceAll(CB_DATA_MEMBERS, "", FULLVER); GenServiceBase(stream, iface); GenCallbacks(stream, iface, false); GenDelegateId(stream, iface); @@ -85,7 +80,11 @@ void CsCionStubGen::GenInterface(std::ofstream& stream, const Interface& iface) } void CsCionStubGen::GenServiceBase(std::ofstream& stream, const Interface& iface) { - stream << CB_SERVICE_BASE_FRONT; + ReplaceAll(CB_SERVICE_BASE_FRONT) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Change("", + GetTransportable().Cs().GenPayloadTransferStatusType()) + .Out(stream); GenDeclarations(stream, iface.GetDeclarations()); stream << NLine(1); stream << AddIndent(TAB_SIZE * 3, "}\n"); @@ -106,7 +105,9 @@ void CsCionStubGen::GenDeclarations(std::ofstream& stream, void CsCionStubGen::GenReceivedSyncEvent(std::ofstream& stream, const Interface& iface) { - stream << CB_ON_RECEIVED_SYNC_EVENT_FRONT; + ReplaceAll(CB_ON_RECEIVED_SYNC_EVENT_FRONT) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Out(stream); for (const auto& i : iface.GetDeclarations()) { if (i->GetMethodType() != Declaration::MethodType::SYNC) continue; @@ -121,7 +122,14 @@ void CsCionStubGen::GenReceivedSyncEvent(std::ofstream& stream, void CsCionStubGen::GenReceivedAsyncEvent(std::ofstream& stream, const Interface& iface) { - stream << CB_ON_RECEIVED_ASYNC_EVENT_FRONT; + ReplaceAll(CB_ON_RECEIVED_ASYNC_EVENT_FRONT) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Change("", + GetTransportable().Cs().GenPayloadTransferStatusType()) + .Change("", GetTransportable().Cs().GenPayloadType()) + .Change("", + GetTransportable().Cs().GenPayloadTypeFile()) + .Out(stream); for (const auto& i : iface.GetDeclarations()) { if (i->GetMethodType() != Declaration::MethodType::ASYNC) continue; @@ -256,15 +264,21 @@ void CsCionStubGen::GenAsyncInvocation(std::ofstream& stream, const Declaration& } void CsCionStubGen::GenConnectionRequestedEvent(std::ofstream& stream) { - stream << CB_ON_CONNECTIONREQUESTED_EVENT; + ReplaceAll(CB_ON_CONNECTIONREQUESTED_EVENT) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Out(stream); } void CsCionStubGen::GenConnectedEvent(std::ofstream& stream) { - stream << CB_ON_CONNECTED_EVENT; + ReplaceAll(CB_ON_CONNECTED_EVENT) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Out(stream); } void CsCionStubGen::GenDisconnectedEvent(std::ofstream& stream) { - stream << CB_ON_DISCONNECTED_EVENT; + ReplaceAll(CB_ON_DISCONNECTED_EVENT) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Out(stream); } void CsCionStubGen::GenCtor(std::ofstream& stream, const Interface& iface) { diff --git a/idlc/gen_cion/cs_cion_stub_gen_cb.h b/idlc/gen_cion/cs_cion_stub_gen_cb.h index 82c4b61..056c385 100644 --- a/idlc/gen_cion/cs_cion_stub_gen_cb.h +++ b/idlc/gen_cion/cs_cion_stub_gen_cb.h @@ -45,12 +45,12 @@ R"__cs_cb( /// /// The PeerInfo of client /// - public PeerInfo Client + public Client { get; internal set; } - internal PeerInfo ConnectionRequestClient; + internal ConnectionRequestClient; internal ServerBase ServerBase; @@ -97,7 +97,7 @@ R"__cs_cb( /// /// This method will be called when received file payload. /// - public abstract void OnFilePayloadReceived(FilePayload file, PayloadTransferStatus status); + public abstract void OnFilePayloadReceived(FilePayload file, status); /// /// This method will be called when the client is disconnected @@ -112,7 +112,7 @@ R"__cs_cb( const char CB_ON_RECEIVED_ASYNC_EVENT_FRONT[] = R"__cs_cb( - protected override void OnPayloadReceived(Payload data, PeerInfo peerInfo, PayloadTransferStatus status) + protected override void OnPayloadReceived( data, peerInfo, status) { try { @@ -136,7 +136,7 @@ R"__cs_cb( return; } - if (data.PayloadType == PayloadType.FilePayload) + if (data.PayloadType == ) { b.OnFilePayloadReceived((FilePayload)data, status); return; @@ -175,7 +175,7 @@ R"__cs_cb( const char CB_ON_RECEIVED_SYNC_EVENT_FRONT[] = R"__cs_cb( - protected override byte[] OnDataReceived(byte[] data, PeerInfo peerInfo) + protected override byte[] OnDataReceived(byte[] data, peerInfo) { Parcel p; byte[] returnData = new byte[0]; @@ -241,7 +241,7 @@ R"__cs_cb( const char CB_ON_CONNECTIONREQUESTED_EVENT[] = R"__cs_cb( - protected override void OnConnectionRequest(PeerInfo peerInfo) + protected override void OnConnectionRequest( peerInfo) { ServiceBase s = Activator.CreateInstance(_serviceType) as ServiceBase; s.ServiceName = base.ServiceName; @@ -255,7 +255,7 @@ R"__cs_cb( const char CB_ON_CONNECTED_EVENT[] = R"__cs_cb( - protected override void OnConnectionResult(PeerInfo peerInfo, ConnectionResult result) + protected override void OnConnectionResult( peerInfo, ConnectionResult result) { foreach (var i in _services) { @@ -279,7 +279,7 @@ R"__cs_cb( const char CB_ON_DISCONNECTED_EVENT[] = R"__cs_cb( - protected override void OnDisconnected(PeerInfo peerInfo) + protected override void OnDisconnected( peerInfo) { foreach (var i in _services) { @@ -325,28 +325,28 @@ R"__cs_cb( } - /// - /// Stops the listen operation. - /// - /// Thrown when the server is not listening. - public new void Stop() - { - base.Stop(); - _services.Clear(); - } - - /// - /// Sets ondemand launch enabled flag. - /// - /// Whether ondemand launch is enabled or not. - /// - /// Thrown when an application does not have the privilege to access this method. - /// - /// http://tizen.org/privilege/d2d.remotelaunch - public new void SetOndemandLaunchEnabled(bool enable) - { - base.SetOndemandLaunchEnabled(enable); - } + /// + /// Stops the listen operation. + /// + /// Thrown when the server is not listening. + public new void Stop() + { + base.Stop(); + _services.Clear(); + } + + /// + /// Sets ondemand launch enabled flag. + /// + /// Whether ondemand launch is enabled or not. + /// + /// Thrown when an application does not have the privilege to access this method. + /// + /// http://tizen.org/privilege/d2d.remotelaunch + public new void SetOndemandLaunchEnabled(bool enable) + { + base.SetOndemandLaunchEnabled(enable); + } /// /// Gets service objects which are connected diff --git a/idlc/gen_cion/cs_transportable.h b/idlc/gen_cion/cs_transportable.h index 0851805..317506d 100644 --- a/idlc/gen_cion/cs_transportable.h +++ b/idlc/gen_cion/cs_transportable.h @@ -24,6 +24,20 @@ namespace tidl { class CsTransportable { public: virtual ~CsTransportable() = default; + virtual std::string GenInclude() const = 0; + virtual std::string GenFileSend(std::string path) const = 0; + virtual std::string GenGroupType() const = 0; + virtual std::string GenPayloadTransferStatusType() const = 0; + virtual std::string GenPeerInfoType() const = 0; + virtual std::string GenPayloadType() const = 0; + virtual std::string GenClientType() const = 0; + virtual std::string GenServerType() const = 0; + virtual std::string GenClientExtraHeader() const = 0; + virtual std::string GenClientExtraBody() const = 0; + virtual std::string GenServerExtraHeader() const = 0; + virtual std::string GenServerExtraBody() const = 0; + virtual std::string GenPayloadTypeData() const = 0; + virtual std::string GenPayloadTypeFile() const = 0; }; } // namespace tidl diff --git a/idlc/gen_cion/default_cs_transportable.cc b/idlc/gen_cion/default_cs_transportable.cc new file mode 100644 index 0000000..010be78 --- /dev/null +++ b/idlc/gen_cion/default_cs_transportable.cc @@ -0,0 +1,102 @@ +/* + * 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_cion/default_cs_transportable.h" + +#include + +#include "idlc/gen/replace_all.h" + +namespace { + +constexpr const char __USING[] = +R"__cs_cb( +using System; +using System.Collections.Generic; +using Tizen.Applications; +using Tizen.Applications.Cion; +)__cs_cb"; + +constexpr const char __FILE_SEND[] = +R"__cs_cb(if (path == null) + throw new ArgumentException("Invalid path"); + + fp = new FilePayload(); + base.SendPayloadAsync(fp); +)__cs_cb"; + +} // namespace + +namespace tidl { + +std::string DefaultCsTransportable::GenInclude() const { + return __USING; +} + +std::string DefaultCsTransportable::GenFileSend(std::string path) const { + return std::string(ReplaceAll(__FILE_SEND, { + { "", path } })); +} + +std::string DefaultCsTransportable::GenGroupType() const { + return "GroupBase"; +} + +std::string DefaultCsTransportable::GenPayloadTransferStatusType() const { + return "PayloadTransferStatus"; +} + +std::string DefaultCsTransportable::GenPeerInfoType() const { + return "PeerInfo"; +} + +std::string DefaultCsTransportable::GenPayloadType() const { + return "Payload"; +} + +std::string DefaultCsTransportable::GenClientType() const { + return "ClientBase"; +} + +std::string DefaultCsTransportable::GenServerType() const { + return "ServerBase"; +} + +std::string DefaultCsTransportable::GenClientExtraHeader() const { + return ""; +} + +std::string DefaultCsTransportable::GenClientExtraBody() const { + return ""; +} + +std::string DefaultCsTransportable::GenServerExtraHeader() const { + return ""; +} + +std::string DefaultCsTransportable::GenServerExtraBody() const { + return ""; +} + +std::string DefaultCsTransportable::GenPayloadTypeData() const { + return "PayloadType.DataPayload"; +} + +std::string DefaultCsTransportable::GenPayloadTypeFile() const { + return "PayloadType.FilePayload"; +} + +} // namespace tidl diff --git a/idlc/gen_cion/default_cs_transportable.h b/idlc/gen_cion/default_cs_transportable.h new file mode 100644 index 0000000..2f02641 --- /dev/null +++ b/idlc/gen_cion/default_cs_transportable.h @@ -0,0 +1,47 @@ +/* + * 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_CION_DEFAULT_CS_TRANSPORTABLE_H_ +#define IDLC_GEN_CION_DEFAULT_CS_TRANSPORTABLE_H_ + +#include + +#include "idlc/gen_cion/cs_transportable.h" + +namespace tidl { + +class DefaultCsTransportable : public CsTransportable { + public: + virtual ~DefaultCsTransportable() = default; + std::string GenInclude() const override; + std::string GenFileSend(std::string path) const override; + std::string GenGroupType() const override; + std::string GenPayloadTransferStatusType() const override; + std::string GenPeerInfoType() const override; + std::string GenPayloadType() const override; + std::string GenClientType() const override; + std::string GenServerType() const override; + std::string GenClientExtraHeader() const override; + std::string GenClientExtraBody() const override; + std::string GenServerExtraHeader() const override; + std::string GenServerExtraBody() const override; + std::string GenPayloadTypeData() const override; + std::string GenPayloadTypeFile() const override; +}; + +} // namespace tidl + +#endif // IDLC_GEN_CION_DEFAULT_CS_TRANSPORTABLE_H_ diff --git a/idlc/gen_cion/plugin_loader.cc b/idlc/gen_cion/plugin_loader.cc index 7b7a6d2..8b177ce 100644 --- a/idlc/gen_cion/plugin_loader.cc +++ b/idlc/gen_cion/plugin_loader.cc @@ -19,6 +19,7 @@ #include "idlc/gen_cion/default_c_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" namespace tidl { @@ -26,7 +27,7 @@ PluginLoader::PluginLoader(const std::string& plugin_path) { if (plugin_path.empty()) { C_.reset(new DefaultCTransportable()); Cpp_.reset(new DefaultCppTransportable()); - // Cs_.reset(new DefaultCsTransportable()); + Cs_.reset(new DefaultCsTransportable()); Java_.reset(new DefaultJavaTransportable()); } else { // TODO