Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iox-#220 require C++14 for iceoryx #390

Merged
merged 5 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ codebase follows these rules, things are work in progress.
without heap)
2) **No exception are allowed**, all function and methods need to have `noexcept` in their signature
3) **No undefined behavior**, zero-cost abstract is not feasible in high safety environments
4) **Use C++11**, however we try to introduce C++14 as fast as possible
4) **Use C++14**
5) **[Rule of Five](https://en.wikipedia.org/wiki/Rule_of_three_(C%2B%2B_programming))**, if there is a non-default
destructor needed, the rule of five has to be applied
6) **[STL](https://en.wikipedia.org/wiki/Standard_Template_Library)**, we aim to be compatible towards the STL, but
Expand Down
6 changes: 5 additions & 1 deletion iceoryx_binding_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ add_library(${PROJECT_NAME}
)
add_library(${PROJECT_NAMESPACE}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_STANDARD ${ICEORYX_CXX_STANDARD}
POSITION_INDEPENDENT_CODE ON
)

target_include_directories(${PROJECT_NAME}
PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_binding_c/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ endif()

# unittests
add_executable(${PROJECT_PREFIX}_integrationtests ${MODULETESTS_SRC})
set_property(TARGET ${PROJECT_PREFIX}_integrationtests PROPERTY CXX_STANDARD 11)
set_property(TARGET ${PROJECT_PREFIX}_integrationtests PROPERTY CXX_STANDARD ${ICEORYX_CXX_STANDARD})
target_include_directories(${PROJECT_PREFIX}_integrationtests PRIVATE .)
target_compile_options(${PROJECT_PREFIX}_integrationtests PUBLIC -fPIC PRIVATE ${TEST_CXX_FLAGS})
target_link_libraries(${PROJECT_PREFIX}_integrationtests ${TEST_LINK_LIBS})
6 changes: 5 additions & 1 deletion iceoryx_dds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ add_library(iceoryx_dds
)
add_library(${PROJECT_NAMESPACE}::iceoryx_dds ALIAS iceoryx_dds)

target_compile_options(iceoryx_dds PUBLIC -std=c++11)
set_target_properties(iceoryx_utils PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_STANDARD ${ICEORYX_CXX_STANDARD}
POSITION_INDEPENDENT_CODE ON
)

target_include_directories(iceoryx_dds
PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_dds/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif()

# unittests
add_executable(${PROJECT_PREFIX}_moduletests ${MODULETESTS_SRC})
set_property(TARGET ${PROJECT_PREFIX}_moduletests PROPERTY CXX_STANDARD 11)
set_property(TARGET ${PROJECT_PREFIX}_moduletests PROPERTY CXX_STANDARD ${ICEORYX_CXX_STANDARD})
target_include_directories(${PROJECT_PREFIX}_moduletests PRIVATE .)
target_compile_options(${PROJECT_PREFIX}_moduletests PUBLIC -fPIC PRIVATE ${TEST_CXX_FLAGS})
target_link_libraries(${PROJECT_PREFIX}_moduletests ${TEST_LINK_LIBS})
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ class PortManager
void addEntryToServiceRegistry(const capro::IdString& service, const capro::IdString& instance) noexcept;
void removeEntryFromServiceRegistry(const capro::IdString& service, const capro::IdString& instance) noexcept;

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
cxx::optional<ProcessName_t> doesViolateCommunicationPolicy(const capro::ServiceDescription& service) const
noexcept;

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
cxx::optional<ProcessName_t> doesViolateCommunicationPolicy(const capro::ServiceDescription& service
[[gnu::unused]]) const noexcept;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace iox
{
namespace roudi
{
template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>*>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>*>
inline cxx::optional<ProcessName_t>
PortManager::doesViolateCommunicationPolicy(const capro::ServiceDescription& service) const noexcept
{
Expand All @@ -34,7 +34,7 @@ PortManager::doesViolateCommunicationPolicy(const capro::ServiceDescription& ser
return cxx::nullopt;
}

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>*>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>*>
inline cxx::optional<ProcessName_t> PortManager::doesViolateCommunicationPolicy(const capro::ServiceDescription& service
[[gnu::unused]]) const noexcept
{
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_posh/include/iceoryx_posh/roudi/port_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ class PortPool
const ProcessName_t& applicationName,
const mepoo::MemoryInfo& memoryInfo = mepoo::MemoryInfo()) noexcept;

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
iox::popo::SubscriberPortData* constructSubscriber(const capro::ServiceDescription& serviceDescription,
const uint64_t& historyRequest,
const ProcessName_t& applicationName,
const mepoo::MemoryInfo& memoryInfo) noexcept;

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
iox::popo::SubscriberPortData* constructSubscriber(const capro::ServiceDescription& serviceDescription,
const uint64_t& historyRequest,
const ProcessName_t& applicationName,
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_posh/include/iceoryx_posh/roudi/port_pool.inl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace iox
{
namespace roudi
{
template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>*>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>*>
inline iox::popo::SubscriberPortData* PortPool::constructSubscriber(const capro::ServiceDescription& serviceDescription,
const uint64_t& historyRequest,
const ProcessName_t& applicationName,
Expand All @@ -31,7 +31,7 @@ inline iox::popo::SubscriberPortData* PortPool::constructSubscriber(const capro:
memoryInfo);
}

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>*>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>*>
inline iox::popo::SubscriberPortData* PortPool::constructSubscriber(const capro::ServiceDescription& serviceDescription,
const uint64_t& historyRequest,
const ProcessName_t& applicationName,
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_posh/include/iceoryx_posh/roudi/roudi_app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class RouDiApp
static RouDiConfig_t generateConfigFromMePooConfig(const mepoo::MePooConfig* mePooConfig) noexcept;

/// @deprecated Please port to RouDiApp(const CmdLineParser&, const RouDiConfig_T&)
[[gnu::deprecated]] RouDiApp(int argc, char* argv[], const mepoo::MePooConfig* mePooConfig = nullptr) noexcept;
[[deprecated]] RouDiApp(int argc, char* argv[], const mepoo::MePooConfig* mePooConfig = nullptr) noexcept;

/// @deprecated Will be deprecated soon, please port to RouDiApp(const CmdLineParser&, const RouDiConfig_T&)
RouDiApp(int argc, char* argv[], const RouDiConfig_t& config) noexcept;
Expand Down
6 changes: 3 additions & 3 deletions iceoryx_utils/cmake/IceoryxPlatformDetection.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ if(UNIX AND NOT APPLE)
endif(UNIX AND NOT APPLE)

if(LINUX)
set(ICEORYX_CXX_STANDARD 11)
set(ICEORYX_CXX_STANDARD 14)
elBoberido marked this conversation as resolved.
Show resolved Hide resolved
elseif(QNX)
set(ICEORYX_CXX_STANDARD 11)
set(ICEORYX_CXX_STANDARD 14)
elseif(WIN32)
set(ICEORYX_CXX_STANDARD 11)
set(ICEORYX_CXX_STANDARD 14)
elseif(APPLE)
set(ICEORYX_CXX_STANDARD 17)
endif(LINUX)
Expand Down
44 changes: 22 additions & 22 deletions iceoryx_utils/include/iceoryx_utils/cxx/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class expected<ErrorType>
/// std::cout << "error occured : " << result.get_error() << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_error(const cxx::function_ref<void(expected&)>& callable) const noexcept;
[[deprecated]] const expected& on_error(const cxx::function_ref<void(expected&)>& callable) const noexcept;

/// @brief if the expected does contain an error the given callable is called and
/// a reference to the expected is given as an argument to the callable
Expand All @@ -266,7 +266,7 @@ class expected<ErrorType>
/// std::cout << "error occured : " << result.get_error() << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_error(const cxx::function_ref<void(expected&)>& callable) noexcept;
[[deprecated]] expected& on_error(const cxx::function_ref<void(expected&)>& callable) noexcept;

/// @brief if the expected does contain an error the given callable is called and
/// a reference to the ErrorType is given as an argument to the callable
Expand All @@ -277,7 +277,7 @@ class expected<ErrorType>
/// std::cout << "error occured : " << error << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_error(const cxx::function_ref<void(ErrorType&)>& callable) const noexcept;
[[deprecated]] const expected& on_error(const cxx::function_ref<void(ErrorType&)>& callable) const noexcept;
const expected& or_else(const cxx::function_ref<void(ErrorType&)>& callable) const noexcept;

/// @brief if the expected does contain an error the given callable is called and
Expand All @@ -289,7 +289,7 @@ class expected<ErrorType>
/// std::cout << "error occured : " << error << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_error(const cxx::function_ref<void(ErrorType&)>& callable) noexcept;
[[deprecated]] expected& on_error(const cxx::function_ref<void(ErrorType&)>& callable) noexcept;
expected& or_else(const cxx::function_ref<void(ErrorType&)>& callable) noexcept;

/// @brief if the expected does contain an error the given callable is called
Expand All @@ -300,7 +300,7 @@ class expected<ErrorType>
/// std::cout << "error occured " << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_error(const cxx::function_ref<void()>& callable) const noexcept;
[[deprecated]] const expected& on_error(const cxx::function_ref<void()>& callable) const noexcept;

/// @brief if the expected does contain an error the given callable is called
/// @param[in] callable callable which will be called if the expected contains an error
Expand All @@ -310,7 +310,7 @@ class expected<ErrorType>
/// std::cout << "error occured " << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_error(const cxx::function_ref<void()>& callable) noexcept;
[[deprecated]] expected& on_error(const cxx::function_ref<void()>& callable) noexcept;

/// @brief if the expected does contain a success value the given callable is called and
/// a reference to the expected is given as an argument to the callable
Expand All @@ -321,7 +321,7 @@ class expected<ErrorType>
/// std::cout << "we are successful" << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_success(const cxx::function_ref<void(expected&)>& callable) const noexcept;
[[deprecated]] const expected& on_success(const cxx::function_ref<void(expected&)>& callable) const noexcept;

/// @brief if the expected does contain a success value the given callable is called and
/// a reference to the expected is given as an argument to the callable
Expand All @@ -332,7 +332,7 @@ class expected<ErrorType>
/// std::cout << "we are successful" << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_success(const cxx::function_ref<void(expected&)>& callable) noexcept;
[[deprecated]] expected& on_success(const cxx::function_ref<void(expected&)>& callable) noexcept;

/// @brief if the expected does contain a success value the given callable is called and
/// a reference to the expected is given as an argument to the callable
Expand All @@ -343,7 +343,7 @@ class expected<ErrorType>
/// std::cout << "we are successful!" << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_success(const cxx::function_ref<void()>& callable) const noexcept;
[[deprecated]] const expected& on_success(const cxx::function_ref<void()>& callable) const noexcept;
const expected& and_then(const cxx::function_ref<void()>& callable) const noexcept;

/// @brief if the expected does contain a success value the given callable is called and
Expand All @@ -355,7 +355,7 @@ class expected<ErrorType>
/// std::cout << "we are successful!" << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_success(const cxx::function_ref<void()>& callable) noexcept;
[[deprecated]] expected& on_success(const cxx::function_ref<void()>& callable) noexcept;
expected& and_then(const cxx::function_ref<void()>& callable) noexcept;

private:
Expand Down Expand Up @@ -566,7 +566,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "error occured : " << result.get_error() << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_error(const cxx::function_ref<void(expected&)>& callable) const noexcept;
[[deprecated]] const expected& on_error(const cxx::function_ref<void(expected&)>& callable) const noexcept;

/// @brief if the expected does contain an error the given callable is called and
/// a reference to the expected is given as an argument to the callable
Expand All @@ -577,7 +577,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "error occured : " << result.get_error() << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_error(const cxx::function_ref<void(expected&)>& callable) noexcept;
[[deprecated]] expected& on_error(const cxx::function_ref<void(expected&)>& callable) noexcept;

/// @brief if the expected does contain an error the given callable is called and
/// a reference to the ErrorType is given as an argument to the callable
Expand All @@ -588,7 +588,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "error occured : " << error << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_error(const cxx::function_ref<void(ErrorType&)>& callable) const noexcept;
[[deprecated]] const expected& on_error(const cxx::function_ref<void(ErrorType&)>& callable) const noexcept;
const expected& or_else(const cxx::function_ref<void(ErrorType&)>& callable) const noexcept;

/// @brief if the expected does contain an error the given callable is called and
Expand All @@ -600,7 +600,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "error occured : " << error << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_error(const cxx::function_ref<void(ErrorType&)>& callable) noexcept;
[[deprecated]] expected& on_error(const cxx::function_ref<void(ErrorType&)>& callable) noexcept;
expected& or_else(const cxx::function_ref<void(ErrorType&)>& callable) noexcept;

/// @brief if the expected does contain an error the given callable is called
Expand All @@ -611,7 +611,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "error occured " << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_error(const cxx::function_ref<void()>& callable) const noexcept;
[[deprecated]] const expected& on_error(const cxx::function_ref<void()>& callable) const noexcept;

/// @brief if the expected does contain an error the given callable is called
/// @param[in] callable callable which will be called if the expected contains an error
Expand All @@ -621,7 +621,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "error occured " << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_error(const cxx::function_ref<void()>& callable) noexcept;
[[deprecated]] expected& on_error(const cxx::function_ref<void()>& callable) noexcept;

/// @brief if the expected does contain a success value the given callable is called and
/// a reference to the expected is given as an argument to the callable
Expand All @@ -632,7 +632,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "we have a result : " << result.get_value() << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_success(const cxx::function_ref<void(expected&)>& callable) const noexcept;
[[deprecated]] const expected& on_success(const cxx::function_ref<void(expected&)>& callable) const noexcept;

/// @brief if the expected does contain a success value the given callable is called and
/// a reference to the expected is given as an argument to the callable
Expand All @@ -643,7 +643,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "we have a result : " << result.get_value() << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_success(const cxx::function_ref<void(expected&)>& callable) noexcept;
[[deprecated]] expected& on_success(const cxx::function_ref<void(expected&)>& callable) noexcept;

/// @brief if the expected does contain a success value the given callable is called and
/// a reference to the result is given as an argument to the callable
Expand All @@ -654,7 +654,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "we have a result : " << result << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_success(const cxx::function_ref<void(ValueType&)>& callable) const noexcept;
[[deprecated]] const expected& on_success(const cxx::function_ref<void(ValueType&)>& callable) const noexcept;
const expected& and_then(const cxx::function_ref<void(ValueType&)>& callable) const noexcept;

/// @brief if the expected does contain a success value the given callable is called and
Expand All @@ -666,7 +666,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "we have a result : " << result << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_success(const cxx::function_ref<void(ValueType&)>& callable) noexcept;
[[deprecated]] expected& on_success(const cxx::function_ref<void(ValueType&)>& callable) noexcept;
expected& and_then(const cxx::function_ref<void(ValueType&)>& callable) noexcept;

///
Expand Down Expand Up @@ -706,7 +706,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "we are successful!" << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] const expected& on_success(const cxx::function_ref<void()>& callable) const noexcept;
[[deprecated]] const expected& on_success(const cxx::function_ref<void()>& callable) const noexcept;

/// @brief if the expected does contain a success value the given callable is called and
/// a reference to the expected is given as an argument to the callable
Expand All @@ -717,7 +717,7 @@ class expected<ValueType, ErrorType>
/// std::cout << "we are successful!" << std::endl;
/// })
/// @endcode
[[gnu::deprecated]] expected& on_success(const cxx::function_ref<void()>& callable) noexcept;
[[deprecated]] expected& on_success(const cxx::function_ref<void()>& callable) noexcept;

///
/// @brief if the expected contains a success value and its type is an empty optional, calls the provided callable
Expand Down
Loading