-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only create readers, writers, and tracks when they are going to be us…
…ed (#57) * Save the discoverer's id when creating a DdsBridge Signed-off-by: tempate <[email protected]> * Only create the necessary readers and writers Signed-off-by: tempate <[email protected]> * Improve readability Signed-off-by: tempate <[email protected]> * Add a new subscriber to the tracks in a bridge Signed-off-by: tempate <[email protected]> * Remove a dropped subscriber from its bridge Signed-off-by: tempate <[email protected]> * Remove unnecessary removed_topic_nts function Signed-off-by: tempate <[email protected]> * Delete the tracks that don't have any writers Signed-off-by: tempate <[email protected]> * Improved readability Signed-off-by: tempate <[email protected]> * Uncrustify Signed-off-by: tempate <[email protected]> * Improved readability Signed-off-by: tempate <[email protected]> * Allow participants to have multiple subscribers Signed-off-by: tempate <[email protected]> * Doxygen, Windows support, and improved readability Signed-off-by: tempate <[email protected]> * Uncrustify Signed-off-by: tempate <[email protected]> * Make the deletion of unused entities configurable Signed-off-by: tempate <[email protected]> * Don't delete unused entities by default Signed-off-by: tempate <[email protected]> * Make dynamic tracks configurable Signed-off-by: tempate <[email protected]> * Three small patches to pass the tests Signed-off-by: tempate <[email protected]> * Move dynamic_tracks's init to avoid warning Signed-off-by: tempate <[email protected]> * Fix bug in forwarding routes Signed-off-by: tempate <[email protected]> * Fix bug by removing debugging comments Signed-off-by: tempate <[email protected]> * Rename dynamic tracks to remove unused entities Signed-off-by: tempate <[email protected]> * Fix segfault when removing elements from tracks Signed-off-by: tempate <[email protected]> * Rebase fix Signed-off-by: tempate <[email protected]> * Apply suggestions Signed-off-by: tempate <[email protected]> * Remove commented code Signed-off-by: tempate <[email protected]> * Apply suggestions Signed-off-by: tempate <[email protected]> * Get endpoints with a filter Signed-off-by: tempate <[email protected]> * Set builtin participants' discoverer Signed-off-by: tempate <[email protected]> * Apply suggestions Signed-off-by: tempate <[email protected]> * Apply NIT suggestions Signed-off-by: tempate <[email protected]> * Uncrustify Signed-off-by: tempate <[email protected]> * Check that the conf. is valid inside the DdsPipe Signed-off-by: tempate <[email protected]> * Fix compilation error Signed-off-by: tempate <[email protected]> * Apply suggestions Signed-off-by: tempate <[email protected]> --------- Signed-off-by: tempate <[email protected]>
- Loading branch information
Showing
24 changed files
with
780 additions
and
152 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
92 changes: 92 additions & 0 deletions
92
ddspipe_core/include/ddspipe_core/configuration/DdsPipeConfiguration.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,92 @@ | ||
// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). | ||
// | ||
// 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 <map> | ||
#include <set> | ||
|
||
#include <cpp_utils/Formatter.hpp> | ||
|
||
#include <ddspipe_core/configuration/IConfiguration.hpp> | ||
#include <ddspipe_core/configuration/RoutesConfiguration.hpp> | ||
#include <ddspipe_core/configuration/TopicRoutesConfiguration.hpp> | ||
#include <ddspipe_core/types/participant/ParticipantId.hpp> | ||
#include <ddspipe_core/types/topic/dds/DistributedTopic.hpp> | ||
|
||
#include <ddspipe_core/library/library_dll.h> | ||
|
||
namespace eprosima { | ||
namespace ddspipe { | ||
namespace core { | ||
|
||
/** | ||
* Configuration structure encapsulating the configuration of a \c DdsPipe instance. | ||
*/ | ||
struct DdsPipeConfiguration : public IConfiguration | ||
{ | ||
///////////////////////// | ||
// CONSTRUCTORS | ||
///////////////////////// | ||
|
||
DDSPIPE_CORE_DllAPI DdsPipeConfiguration() = default; | ||
|
||
///////////////////////// | ||
// METHODS | ||
///////////////////////// | ||
|
||
/** | ||
* @brief Override \c is_valid method. | ||
*/ | ||
DDSPIPE_CORE_DllAPI | ||
virtual bool is_valid( | ||
utils::Formatter& error_msg) const noexcept override; | ||
|
||
/** | ||
* @brief Check if a configuration is valid given a list of participants. | ||
* | ||
* It calls its own \c is_valid method plus the \c is_valid method of the | ||
* encapsulated configurations. | ||
*/ | ||
DDSPIPE_CORE_DllAPI | ||
bool is_valid( | ||
utils::Formatter& error_msg, | ||
const std::map<types::ParticipantId, bool>& participants) const noexcept; | ||
|
||
/** | ||
* @brief Select the \c RoutesConfiguration for a topic. | ||
* | ||
* @return The route configuration for a specific topic. | ||
*/ | ||
DDSPIPE_CORE_DllAPI | ||
RoutesConfiguration get_routes_config( | ||
const utils::Heritable<types::DistributedTopic>& topic) const noexcept; | ||
|
||
///////////////////////// | ||
// VARIABLES | ||
///////////////////////// | ||
|
||
//! Configuration of the generic routes. | ||
RoutesConfiguration routes{}; | ||
|
||
//! Configuration of the routes specific to a topic. | ||
TopicRoutesConfiguration topic_routes{}; | ||
|
||
//! Whether entities should be removed when they have no writers connected to them. | ||
bool remove_unused_entities = false; | ||
}; | ||
|
||
} /* namespace core */ | ||
} /* namespace ddspipe */ | ||
} /* namespace eprosima */ |
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.