From 2e45f9d8a2f6ec8dc4e7c6bef0c8ac94bdcc777f Mon Sep 17 00:00:00 2001 From: Sangwan Kwon Date: Thu, 28 Nov 2019 16:46:41 +0900 Subject: [PATCH] Remove rmi of klay Signed-off-by: Sangwan Kwon --- src/vist/CMakeLists.txt | 1 - src/vist/ipc/CMakeLists.txt | 16 --------- src/vist/ipc/client.hpp | 53 ----------------------------- src/vist/ipc/ipc.cpp | 18 ---------- src/vist/ipc/server.hpp | 50 --------------------------- src/vist/ipc/tests/ipc.cpp | 83 --------------------------------------------- 6 files changed, 221 deletions(-) delete mode 100644 src/vist/ipc/CMakeLists.txt delete mode 100644 src/vist/ipc/client.hpp delete mode 100644 src/vist/ipc/ipc.cpp delete mode 100644 src/vist/ipc/server.hpp delete mode 100644 src/vist/ipc/tests/ipc.cpp diff --git a/src/vist/CMakeLists.txt b/src/vist/CMakeLists.txt index 25ec601..4105a13 100644 --- a/src/vist/CMakeLists.txt +++ b/src/vist/CMakeLists.txt @@ -34,7 +34,6 @@ ADD_DEFINITIONS(-DDB_PATH="${DB_INSTALL_DIR}/.vist.db" # common ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(event) -ADD_SUBDIRECTORY(ipc) ADD_SUBDIRECTORY(klass) ADD_SUBDIRECTORY(logger) ADD_SUBDIRECTORY(rmi) diff --git a/src/vist/ipc/CMakeLists.txt b/src/vist/ipc/CMakeLists.txt deleted file mode 100644 index 616a117..0000000 --- a/src/vist/ipc/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved -# -# 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. -# - -ADD_VIST_COMMON_LIBRARY(vist_ipc ipc.cpp) diff --git a/src/vist/ipc/client.hpp b/src/vist/ipc/client.hpp deleted file mode 100644 index 5e39a57..0000000 --- a/src/vist/ipc/client.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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 - */ - -#pragma once - -#include -#include - -#include - -namespace vist { -namespace ipc { - -class Client final { -public: - Client(const Client&) = delete; - Client& operator=(const Client&) = delete; - - Client(Client&&) = delete; - Client& operator=(Client&&) = delete; - - static std::unique_ptr& Instance(const std::string& sock) - { - static Client client(sock); - return client.instance; - } - -private: - explicit Client(const std::string& sock) : - instance(std::make_unique(sock)) - { - instance->connect(); - } - ~Client() = default; - - std::unique_ptr instance; -}; - -} // namespace ipc -} // namespace vist diff --git a/src/vist/ipc/ipc.cpp b/src/vist/ipc/ipc.cpp deleted file mode 100644 index 2a92627..0000000 --- a/src/vist/ipc/ipc.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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 -#include diff --git a/src/vist/ipc/server.hpp b/src/vist/ipc/server.hpp deleted file mode 100644 index 667d6b1..0000000 --- a/src/vist/ipc/server.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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 - */ - -#pragma once - -#include -#include - -#include - -namespace vist { -namespace ipc { - -class Server final { -public: - Server(const Server&) = delete; - Server& operator=(const Server&) = delete; - - Server(Server&&) = delete; - Server& operator=(Server&&) = delete; - - static std::unique_ptr& Instance(const std::string& sock) - { - static Server server(sock); - return server.instance; - } - -private: - explicit Server(const std::string& sock) : - instance(std::make_unique(sock)) {} - ~Server() = default; - - std::unique_ptr instance; -}; - -} // namespace ipc -} // namespace vist diff --git a/src/vist/ipc/tests/ipc.cpp b/src/vist/ipc/tests/ipc.cpp deleted file mode 100644 index 1e8c0d2..0000000 --- a/src/vist/ipc/tests/ipc.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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 - -#include -#include - -#include -#include - -#include -#include - -using namespace vist; - -namespace { - std::string g_socket = "/tmp/vist-test"; -} // anonymous namespace - -class TestServer { -public: - void init() - { - auto& server = ipc::Server::Instance(g_socket); - server->expose(this, "", (std::string)(TestServer::testMethod)()); - server->start(); - } - - std::string testMethod() - { - return "test"; - } -}; - -class IpcTests : public testing::Test { -public: - void SetUp() override - { - ::unlink(g_socket.c_str()); - - this->pid = fork(); - if (pid < 0) { - return; - } else if (pid == 0) { - TestServer server; - server.init(); - } - - std::this_thread::sleep_for(std::chrono::seconds(1)); - } - - void TearDown() override - { - if (::kill(pid, SIGTERM) == -1) - return; - - std::this_thread::sleep_for(std::chrono::seconds(1)); - } - -private: - pid_t pid = -1; -}; - -TEST_F(IpcTests, method_call) { - auto& client = ipc::Client::Instance(g_socket); - - std::string ret = client->methodCall("TestServer::testMethod"); - EXPECT_EQ(ret, "test"); -} -- 2.7.4