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

[21280] Example refactor: RTPS #5086

Merged
merged 23 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
15d314a
Refs #21280: Move rtps/Registered example in /rtps_entities
elianalf Jul 4, 2024
cecdaf7
Refs #21280: Add application and main
elianalf Jul 4, 2024
4d3894f
Refs #21280: Add cliparser
elianalf Jul 4, 2024
ec7bcfd
Refs #21280: Change name, guard and extension
elianalf Jul 4, 2024
beb1016
Refs #21280: Remove old files
elianalf Jul 4, 2024
d196fa8
Refs #21280: Reader application refactor
elianalf Jul 4, 2024
a688f23
Refs #21280: Writer application refactor
elianalf Jul 5, 2024
e6eb53d
Refs #21280: Make Reader compatible with HelloWorld Publisher and des…
elianalf Jul 9, 2024
01297df
Refs #21280: Make reader compatible with helloworld
elianalf Jul 11, 2024
0b1cc2e
Refs #21280: Make writer compatible with helloworld
elianalf Jul 11, 2024
fc02c10
Refs #21280: Add isFull check
elianalf Jul 15, 2024
94457c3
Refs #21280: Add tests
elianalf Jul 16, 2024
ddd2298
Refs #21280: Change on writer matched api after rebase
elianalf Jul 18, 2024
0c201ec
Refs #21280: Add readme file
elianalf Jul 18, 2024
ad960ec
Refs #21280: Add the idl file in the rtps folder
elianalf Jul 18, 2024
1622b62
Refs #21280: Update version.md
elianalf Jul 18, 2024
49c7388
Refs #21280: Apply suggestion
elianalf Jul 22, 2024
abfb777
Refs #21280: Uncrustify
elianalf Jul 22, 2024
e2035b2
Refs #21280: Move increase sent sample inside add_change
elianalf Jul 22, 2024
65c4fa9
Refs #21280: Add missing override
elianalf Jul 22, 2024
1e12cf4
Refs #21280: Change folder name and delete rtps old folder
elianalf Jul 22, 2024
c200291
Refs #21280: Add override
elianalf Jul 23, 2024
c9c2234
Refs #21280: Remove unused private variable
elianalf Jul 23, 2024
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
56 changes: 56 additions & 0 deletions examples/cpp/rtps/Application.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright 2024 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.

/**
* @file Application.cpp
*
*/

#include "Application.hpp"

#include "CLIParser.hpp"
#include "ReaderApp.hpp"
#include "WriterApp.hpp"

namespace eprosima {
namespace fastdds {
namespace examples {
namespace rtps {

//! Factory method to create a publisher or subscriber
std::shared_ptr<Application> Application::make_app(
const CLIParser::rtps_config& config,
const std::string& topic_name)
{
std::shared_ptr<Application> entity;
switch (config.entity)
{
case CLIParser::EntityKind::WRITER:
entity = std::make_shared<WriterApp>(config, topic_name);
break;
case CLIParser::EntityKind::READER:
entity = std::make_shared<ReaderApp>(config, topic_name);
break;
case CLIParser::EntityKind::UNDEFINED:
default:
throw std::runtime_error("Entity initialization failed");
break;
}
return entity;
}

} // namespace rtps
} // namespace examples
} // namespace fastdds
} // namespace eprosima
54 changes: 54 additions & 0 deletions examples/cpp/rtps/Application.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2024 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.

/**
* @file Application.hpp
*
*/

#ifndef FASTDDS_EXAMPLES_CPP_RTPS__APPLICATION_HPP
#define FASTDDS_EXAMPLES_CPP_RTPS__APPLICATION_HPP

#include "CLIParser.hpp"

namespace eprosima {
namespace fastdds {
namespace examples {
namespace rtps {

class Application
{
public:

//! Virtual destructor
virtual ~Application() = default;

//! Run application
virtual void run() = 0;

//! Trigger the end of execution
virtual void stop() = 0;

//! Factory method to create applications based on configuration
static std::shared_ptr<Application> make_app(
const CLIParser::rtps_config& config,
const std::string& topic_name);
};

} // namespace rtps
} // namespace examples
} // namespace fastdds
} // namespace eprosima

#endif // FASTDDS_EXAMPLES_CPP_RTPS__APPLICATION_HPP
52 changes: 0 additions & 52 deletions examples/cpp/rtps/AsSocket/CMakeLists.txt

This file was deleted.

4 changes: 0 additions & 4 deletions examples/cpp/rtps/AsSocket/README.txt

This file was deleted.

98 changes: 0 additions & 98 deletions examples/cpp/rtps/AsSocket/TestReaderSocket.cpp

This file was deleted.

78 changes: 0 additions & 78 deletions examples/cpp/rtps/AsSocket/TestReaderSocket.h

This file was deleted.

Loading
Loading