From: Lukasz Wojciechowski Date: Tue, 20 Jan 2015 14:15:36 +0000 (+0100) Subject: Move non-template functions to timeout.cpp file X-Git-Tag: security-manager_5.5_testing~130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F49%2F34049%2F8;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git Move non-template functions to timeout.cpp file Leaving them in timeout.h causes double definition of functions. Change-Id: Ic425855ffd958b2adbb16672d486fcdcedaa8897 --- diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index fc42023..abd3aa6 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -24,6 +24,7 @@ SET(COMMON_TARGET_TEST_SOURCES ${PROJECT_SOURCE_DIR}/src/common/passwd_access.cpp ${PROJECT_SOURCE_DIR}/src/common/uds.cpp ${PROJECT_SOURCE_DIR}/src/common/synchronization_pipe.cpp + ${PROJECT_SOURCE_DIR}/src/common/timeout.cpp ) #system and local includes diff --git a/src/common/timeout.cpp b/src/common/timeout.cpp new file mode 100644 index 0000000..c9e1347 --- /dev/null +++ b/src/common/timeout.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015 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. + */ +/** + * @file timeout.cpp + * @author Lukasz Wojciechowski + * @brief Definition of future_status serialization operator + */ + +#include + +namespace Timeout { + +std::ostream& operator<<(std::ostream& os, const std::future_status &status) +{ + switch (status) { + case std::future_status::ready: + os << ""; + break; + case std::future_status::timeout: + os << ""; + break; + case std::future_status::deferred: + os << ""; + break; + } + os << " [" << static_cast(status) << "]"; + return os; +} + +} // namespace Timeout diff --git a/src/common/timeout.h b/src/common/timeout.h index 98662e1..01ef862 100644 --- a/src/common/timeout.h +++ b/src/common/timeout.h @@ -28,7 +28,7 @@ #include #include -#include +#include namespace Timeout { @@ -43,22 +43,7 @@ enum ExpectMode { IGNORE, }; -std::ostream& operator<<(std::ostream& os, const std::future_status &status) -{ - switch (status) { - case std::future_status::ready: - os << ""; - break; - case std::future_status::timeout: - os << ""; - break; - case std::future_status::deferred: - os << ""; - break; - } - os << " [" << static_cast(status) << "]"; - return os; -} +std::ostream& operator<<(std::ostream& os, const std::future_status &status); template typename std::result_of::type