--- /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_CION_C_TRANSPORTABLE_H_
+#define IDLC_GEN_CION_C_TRANSPORTABLE_H_
+
+#include <string>
+
+namespace tidl {
+
+class CTransportable {
+ public:
+ virtual ~CTransportable() = default;
+ virtual std::string GenInclude() const = 0;
+ virtual std::string GenClientSendAsync(std::string client,
+ std::string payload, std::string size) const = 0;
+ virtual std::string GenClientSend(std::string client, std::string data,
+ std::string data_size, std::string ret_data,
+ std::string ret_data_size) const = 0;
+ virtual std::string GenServerSendAsync(std::string server, std::string client,
+ std::string payload, std::string size) const = 0;
+ virtual std::string GenServerFileSend(std::string path, std::string server,
+ std::string peer) const = 0;
+ virtual std::string GenClientFileSend(std::string path,
+ std::string client) 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 GenSecurityType() const = 0;
+ virtual std::string GenServerType() const = 0;
+ virtual std::string GenClientTryConnect(std::string client,
+ std::string peer) const = 0;
+ virtual std::string GenClientDisconnect(std::string client) const = 0;
+ virtual std::string GenClientTryDiscovery(std::string client) const = 0;
+ virtual std::string GenClientStopDiscovery(std::string client) const = 0;
+ virtual std::string GenServerRegister() const = 0;
+ virtual std::string GenServerUnregister() 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 GenServerAccept() const = 0;
+ virtual std::string GenServerReject() const = 0;
+ virtual std::string GenServerSetDisplayName() const = 0;
+};
+
+} // namespace tidl
+
+#endif // IDLC_GEN_CION_C_TRANSPORTABLE_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_cion/cion_plugin_base.h"
+
+#include "idlc/gen_cion/plugin_loader.h"
+
+#include <utility>
+
+namespace tidl {
+
+CionPluginBase::CionPluginBase(std::shared_ptr<Document> doc)
+ : Generator(std::move(doc)) {
+ transportable_.reset(new PluginLoader(""));
+}
+
+Transportable& CionPluginBase::GetTransportable() {
+ return *transportable_;
+}
+
+} // 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_CION_CION_PLUGIN_BASE_H_
+#define IDLC_GEN_CION_CION_PLUGIN_BASE_H_
+
+#include <memory>
+
+#include "idlc/gen/generator.h"
+#include "idlc/gen_cion/plugin_loader.h"
+
+namespace tidl {
+
+class CionPluginBase : public Generator {
+ public:
+ explicit CionPluginBase(std::shared_ptr<Document> doc);
+ virtual ~CionPluginBase() = default;
+
+ Transportable& GetTransportable();
+
+ private:
+ std::unique_ptr<Transportable> transportable_;
+};
+
+} // namespace tidl
+
+#endif // IDLC_GEN_CION_CION_PLUGIN_BASE_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.
+ */
+
+#ifndef IDLC_GEN_CION_CPP_TRANSPORTABLE_H_
+#define IDLC_GEN_CION_CPP_TRANSPORTABLE_H_
+
+#include <string>
+
+namespace tidl {
+
+class CppTransportable {
+ public:
+ virtual ~CppTransportable() = default;
+ virtual std::string GenInclude() const = 0;
+ virtual std::string GenClientSendAsync(std::string client,
+ std::string payload, std::string size) const = 0;
+ virtual std::string GenClientSend(std::string client, std::string data,
+ std::string data_size, std::string ret_data,
+ std::string ret_data_size) const = 0;
+ virtual std::string GenServerSendAsync(std::string server, std::string client,
+ std::string payload, std::string size) const = 0;
+ virtual std::string GenServerFileSend(std::string path, std::string server,
+ std::string peer) const = 0;
+ virtual std::string GenClientFileSend(std::string path,
+ std::string client) 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 GenSecurityType() const = 0;
+ virtual std::string GenServerType() const = 0;
+ virtual std::string GenClientTryConnect(std::string client,
+ std::string peer) const = 0;
+ virtual std::string GenClientDisconnect(std::string client) const = 0;
+ virtual std::string GenClientTryDiscovery(std::string client) const = 0;
+ virtual std::string GenClientStopDiscovery(std::string client) const = 0;
+ virtual std::string GenServerRegister() const = 0;
+ virtual std::string GenServerUnregister() 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 GenServerAccept() const = 0;
+ virtual std::string GenServerReject() const = 0;
+ virtual std::string GenServerSetDisplayName() const = 0;
+};
+
+} // namespace tidl
+
+#endif // IDLC_GEN_CION_CPP_TRANSPORTABLE_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.
+ */
+
+#ifndef IDLC_GEN_CION_CS_TRANSPORTABLE_H_
+#define IDLC_GEN_CION_CS_TRANSPORTABLE_H_
+
+#include <string>
+
+namespace tidl {
+
+class CsTransportable {
+ public:
+ virtual ~CsTransportable() = default;
+};
+
+} // namespace tidl
+
+#endif // IDLC_GEN_CION_CS_TRANSPORTABLE_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.
+ */
+
+#ifndef IDLC_GEN_CION_JAVA_TRANSPORTABLE_H_
+#define IDLC_GEN_CION_JAVA_TRANSPORTABLE_H_
+
+#include <string>
+
+namespace tidl {
+
+class JavaTransportable {
+ public:
+ virtual ~JavaTransportable() = default;
+};
+
+} // namespace tidl
+
+#endif // IDLC_GEN_CION_JAVA_TRANSPORTABLE_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_cion/plugin_loader.h"
+
+namespace tidl {
+
+PluginLoader::PluginLoader(const std::string& plugin_path) {
+ if (plugin_path.empty()) {
+ // C_.reset(new DefaultCTransportable());
+ // Cpp_.reset(new DefaultCppTransportable());
+ // Cs_.reset(new DefaultCsTransportable());
+ // Java_.reset(new DefaultJavaTransportable());
+ } else {
+ // TODO
+ }
+}
+
+const CTransportable& PluginLoader::C() {
+ return *C_;
+}
+
+const CppTransportable& PluginLoader::Cpp() {
+ return *Cpp_;
+}
+
+const CsTransportable& PluginLoader::Cs() {
+ return *Cs_;
+}
+
+const JavaTransportable& PluginLoader::Java() {
+ return *Java_;
+}
+
+} // 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_CION_PLUGIN_LOADER_H_
+#define IDLC_GEN_CION_PLUGIN_LOADER_H_
+
+#include <memory>
+#include <string>
+
+#include "idlc/gen_cion/transportable.h"
+
+namespace tidl {
+
+class PluginLoader : public Transportable {
+ public:
+ explicit PluginLoader(const std::string& plugin_path);
+
+ const CTransportable& C() override;
+ const CppTransportable& Cpp() override;
+ const CsTransportable& Cs() override;
+ const JavaTransportable& Java() override;
+
+ private:
+ std::unique_ptr<CTransportable> C_;
+ std::unique_ptr<CppTransportable> Cpp_;
+ std::unique_ptr<CsTransportable> Cs_;
+ std::unique_ptr<JavaTransportable> Java_;
+};
+
+} // namespace tidl
+
+#endif // IDLC_GEN_CION_PLUGIN_LOADER_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.
+ */
+
+#ifndef IDLC_GEN_CION_TRANSPORTABLE_H_
+#define IDLC_GEN_CION_TRANSPORTABLE_H_
+
+#include "idlc/gen_cion/c_transportable.h"
+#include "idlc/gen_cion/cpp_transportable.h"
+#include "idlc/gen_cion/cs_transportable.h"
+#include "idlc/gen_cion/java_transportable.h"
+
+namespace tidl {
+
+class Transportable {
+ public:
+ virtual ~Transportable() = default;
+ virtual const CTransportable& C() = 0;
+ virtual const CppTransportable& Cpp() = 0;
+ virtual const CsTransportable& Cs() = 0;
+ virtual const JavaTransportable& Java() = 0;
+};
+
+} // namespace tidl
+
+#endif // IDLC_GEN_CION_TRANSPORTABLE_H_