diff --git a/fastddsspy_participants/include/fastddsspy_participants/participant/SpyParticipant.hpp b/fastddsspy_participants/include/fastddsspy_participants/participant/SpyParticipant.hpp index 5abec619..097fc488 100644 --- a/fastddsspy_participants/include/fastddsspy_participants/participant/SpyParticipant.hpp +++ b/fastddsspy_participants/include/fastddsspy_participants/participant/SpyParticipant.hpp @@ -17,10 +17,10 @@ #include #include +#include #include #include -#include #include namespace eprosima { @@ -56,9 +56,9 @@ class SpyParticipant : public ddspipe::participants::SchemaParticipant const ddspipe::core::IRoutingData& data); //! Participants Internal Reader - std::shared_ptr participants_writer_; + std::shared_ptr participants_writer_; - std::shared_ptr endpoints_writer_; + std::shared_ptr endpoints_writer_; std::shared_ptr model_; }; diff --git a/fastddsspy_participants/include/fastddsspy_participants/writer/InternalWriter.hpp b/fastddsspy_participants/include/fastddsspy_participants/writer/InternalWriter.hpp deleted file mode 100644 index e4de2715..00000000 --- a/fastddsspy_participants/include/fastddsspy_participants/writer/InternalWriter.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// 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 - -#include - -namespace eprosima { -namespace spy { -namespace participants { - -/** - * Writer implementation that allow to register a callback to be executed with each data received. - */ -class InternalWriter : public ddspipe::participants::BaseWriter -{ -public: - - InternalWriter( - const ddspipe::core::types::ParticipantId& participant_id, - const std::function& callback); - -protected: - - virtual utils::ReturnCode write_nts_( - ddspipe::core::IRoutingData& data) noexcept override; - - const std::function callback_; -}; - -} /* namespace participants */ -} /* namespace spy */ -} /* namespace eprosima */ diff --git a/fastddsspy_participants/src/cpp/participant/SpyParticipant.cpp b/fastddsspy_participants/src/cpp/participant/SpyParticipant.cpp index ad7ac427..705380f0 100644 --- a/fastddsspy_participants/src/cpp/participant/SpyParticipant.cpp +++ b/fastddsspy_participants/src/cpp/participant/SpyParticipant.cpp @@ -36,7 +36,7 @@ SpyParticipant::SpyParticipant( return this->new_participant_info_(data); }; - participants_writer_ = std::make_shared( + participants_writer_ = std::make_shared( participant_configuration->id, participant_callback); @@ -45,7 +45,7 @@ SpyParticipant::SpyParticipant( return this->new_endpoint_info_(data); }; - endpoints_writer_ = std::make_shared( + endpoints_writer_ = std::make_shared( participant_configuration->id, endpoint_callback); } diff --git a/fastddsspy_participants/src/cpp/writer/InternalWriter.cpp b/fastddsspy_participants/src/cpp/writer/InternalWriter.cpp deleted file mode 100644 index ed6d47f9..00000000 --- a/fastddsspy_participants/src/cpp/writer/InternalWriter.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// 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. - -#include - -namespace eprosima { -namespace spy { -namespace participants { - -InternalWriter::InternalWriter( - const ddspipe::core::types::ParticipantId& participant_id, - const std::function& callback) - : ddspipe::participants::BaseWriter(participant_id) - , callback_(callback) -{ - // Do nothing -} - -utils::ReturnCode InternalWriter::write_nts_( - ddspipe::core::IRoutingData& data) noexcept -{ - return callback_(data); -} - -} /* namespace participants */ -} /* namespace spy */ -} /* namespace eprosima */