From ce114367f7c2219f39c205898c7ac276829088bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/On-Device=20Lab=2E/Staff=20Engi?= =?utf8?q?neer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 18 Dec 2018 08:58:43 +0900 Subject: [PATCH] Remove deprecated nncc_foundation (#2694) There is no code that uses nncc_foundation. Signed-off-by: Jonghyun Park --- libs/foundation/CMakeLists.txt | 13 ------ libs/foundation/include/nncc/foundation/Memory.h | 36 ----------------- .../include/nncc/foundation/math/Float.h | 34 ---------------- libs/foundation/src/Memory.test.cpp | 46 ---------------------- 4 files changed, 129 deletions(-) delete mode 100644 libs/foundation/CMakeLists.txt delete mode 100644 libs/foundation/include/nncc/foundation/Memory.h delete mode 100644 libs/foundation/include/nncc/foundation/math/Float.h delete mode 100644 libs/foundation/src/Memory.test.cpp diff --git a/libs/foundation/CMakeLists.txt b/libs/foundation/CMakeLists.txt deleted file mode 100644 index c06e381..0000000 --- a/libs/foundation/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -file(GLOB_RECURSE HEADERS "include/*.h") -file(GLOB_RECURSE SOURCES "src/*.cpp") -file(GLOB_RECURSE TESTS "src/*.test.cpp") -list(REMOVE_ITEM SOURCES ${TESTS}) - -# NOTE STATIC is deliberately used here to permit the use of 'nncc_foundation' without installation -add_nncc_library(nncc_foundation STATIC ${HEADERS} ${SOURCES}) -set_target_properties(nncc_foundation PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_target_properties(nncc_foundation PROPERTIES LINKER_LANGUAGE CXX) -target_include_directories(nncc_foundation PUBLIC include) - -add_nncc_test(nncc_foundation_test ${TESTS}) -nncc_target_link_libraries(nncc_foundation_test nncc_foundation) diff --git a/libs/foundation/include/nncc/foundation/Memory.h b/libs/foundation/include/nncc/foundation/Memory.h deleted file mode 100644 index 9141633..0000000 --- a/libs/foundation/include/nncc/foundation/Memory.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2018 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. - */ - -#ifndef __NNCC_FOUNDATION_MEMORY_H__ -#define __NNCC_FOUNDATION_MEMORY_H__ - -#include - -namespace nncc -{ -namespace foundation -{ - -template std::unique_ptr make_unique(Args &&... args) -{ - // NOTE std::make_unique is missing in C++11 standard - return std::unique_ptr(new T(std::forward(args)...)); -} - -} // namespace foundation -} // namespace nncc - -#endif // __NNCC_FOUNDATION_MEMORY_H__ diff --git a/libs/foundation/include/nncc/foundation/math/Float.h b/libs/foundation/include/nncc/foundation/math/Float.h deleted file mode 100644 index 81161e0..0000000 --- a/libs/foundation/include/nncc/foundation/math/Float.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2018 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. - */ - -#ifndef __NNCC_FOUNDATION_MATH_FLOAT_H__ -#define __NNCC_FOUNDATION_MATH_FLOAT_H__ - -namespace nncc -{ -namespace foundation -{ -namespace math -{ - -bool relative_epsilon_equal(float lhs, float rhs, unsigned tolerance = 1); -bool absolute_epsilon_equal(float lhs, float rhs, float tolerance = 0.001); - -} // namespace math -} // namespace foundation -} // namespace nncc - -#endif // __NNCC_FOUNDATION_MATH_FLOAT_H__ diff --git a/libs/foundation/src/Memory.test.cpp b/libs/foundation/src/Memory.test.cpp deleted file mode 100644 index 31f77ca..0000000 --- a/libs/foundation/src/Memory.test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2018 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 - -class Tracker -{ -public: - Tracker(bool &allocated, bool &freed) : _freed{freed} { allocated = true; } - -public: - ~Tracker() { _freed = true; } - -private: - bool &_freed; -}; - -TEST(FOUNDATION_MEMORY, unique_ptr) -{ - bool allocated = false; - bool freed = false; - - { - auto o = nncc::foundation::make_unique(allocated, freed); - - ASSERT_TRUE(allocated); - ASSERT_FALSE(freed); - } - - ASSERT_TRUE(freed); -} -- 2.7.4