forked from eclipse-iceoryx/iceoryx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iox-eclipse-iceoryx#1533 Move 'RouDiEnvironment' to new location
- Loading branch information
1 parent
e5ee364
commit fdb9430
Showing
31 changed files
with
210 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) 2020 by Robert Bosch GmbH. 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. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# | ||
########## dummyConfig.cmake to be able to use find_package with the source tree ########## | ||
# | ||
|
||
if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND_PRINTED) | ||
message(STATUS "The package '${CMAKE_FIND_PACKAGE_NAME}' is used in source code version.") | ||
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND_PRINTED true CACHE INTERNAL "") | ||
endif() | ||
|
||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
# Copyright (c) 2020 - 2022 by Apex.AI Inc. 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. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# NOTE | ||
# This package must NOT depend in any way on gtest or any other testing framework since | ||
# it will be used from other languages like Rust for integration testing. | ||
|
||
if(ROUDI_ENVIRONMENT OR BUILD_TEST) | ||
# | ||
######### posh roudi env ########## | ||
# | ||
find_package(iceoryx_hoofs_testing REQUIRED) | ||
iox_add_library( | ||
STATIC | ||
TARGET iceoryx_posh_roudi_env | ||
NAMESPACE iceoryx_posh | ||
PROJECT_PREFIX ${PREFIX} | ||
BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include | ||
INSTALL_INTERFACE include/${PREFIX} | ||
EXPORT_INCLUDE_DIRS include/ | ||
PRIVATE_LIBS iceoryx_posh::iceoryx_posh | ||
iceoryx_hoofs::iceoryx_hoofs | ||
iceoryx_hoofs_testing::iceoryx_hoofs_testing | ||
iceoryx_posh::iceoryx_posh_roudi | ||
FILES | ||
source/minimal_roudi_config.cpp | ||
source/roudi_environment.cpp | ||
source/runtime_test_interface.cpp | ||
) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
iceoryx_posh/roudi_env/include/iceoryx_posh/roudi_env/roudi_environment.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. 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. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef IOX_POSH_ROUDI_ENV_ROUDI_ENVIRONMENT_HPP | ||
#define IOX_POSH_ROUDI_ENV_ROUDI_ENVIRONMENT_HPP | ||
|
||
#include "iceoryx_posh/iceoryx_posh_config.hpp" | ||
#include "iceoryx_posh/iceoryx_posh_types.hpp" | ||
#include "iceoryx_posh/internal/roudi/roudi.hpp" | ||
#include "iceoryx_posh/roudi/iceoryx_roudi_components.hpp" | ||
#include "iceoryx_posh/roudi/memory/iceoryx_roudi_memory_manager.hpp" | ||
#include "iceoryx_posh/roudi_env/runtime_test_interface.hpp" | ||
#include "iox/duration.hpp" | ||
|
||
#include <atomic> | ||
#include <map> | ||
#include <mutex> | ||
|
||
namespace iox | ||
{ | ||
namespace roudi | ||
{ | ||
class RouDi; | ||
|
||
class RouDiEnvironment | ||
{ | ||
public: | ||
RouDiEnvironment(const RouDiConfig_t& roudiConfig = RouDiConfig_t().setDefaults(), | ||
roudi::MonitoringMode monitoringMode = roudi::MonitoringMode::OFF, | ||
const uint16_t uniqueRouDiId = 0u); | ||
virtual ~RouDiEnvironment(); | ||
|
||
RouDiEnvironment(RouDiEnvironment&& rhs) = default; | ||
RouDiEnvironment& operator=(RouDiEnvironment&& rhs) = default; | ||
|
||
RouDiEnvironment(const RouDiEnvironment&) = delete; | ||
RouDiEnvironment& operator=(const RouDiEnvironment&) = delete; | ||
|
||
void SetInterOpWaitingTime(const std::chrono::milliseconds& v); | ||
void InterOpWait(); | ||
|
||
void CleanupAppResources(const RuntimeName_t& name); | ||
|
||
protected: | ||
/// @note this is due to ambiguity of the cTor with the default parameter | ||
enum class BaseCTor | ||
{ | ||
BASE, | ||
}; | ||
/// @brief for implementations on top of RouDiEnvironment | ||
RouDiEnvironment(BaseCTor, const uint16_t uniqueRouDiId = 0u); | ||
|
||
void CleanupRuntimes(); | ||
|
||
private: | ||
RuntimeTestInterface m_runtimes; | ||
#if defined(__APPLE__) | ||
iox::units::Duration m_interOpWaitingTimeout{iox::units::Duration::fromMilliseconds(1000)}; | ||
#else | ||
iox::units::Duration m_interOpWaitingTimeout{iox::units::Duration::fromMilliseconds(200)}; | ||
#endif | ||
std::unique_ptr<IceOryxRouDiComponents> m_roudiComponents; | ||
std::unique_ptr<RouDi> m_roudiApp; | ||
}; | ||
|
||
} // namespace roudi | ||
} // namespace iox | ||
|
||
#endif // IOX_POSH_ROUDI_ENV_ROUDI_ENVIRONMENT_HPP |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.