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

[21266] Example refactor: Security #5006

Merged
merged 12 commits into from
Jul 12, 2024
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
4 changes: 4 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ add_subdirectory(cpp/discovery_server)
add_subdirectory(cpp/hello_world)
add_subdirectory(cpp/rtps)
add_subdirectory(cpp/xtypes)

if (SECURITY)
add_subdirectory(cpp/security)
endif()
6 changes: 3 additions & 3 deletions examples/cpp/configuration/Application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_CONFIGURATION_APPLICATION_HPP_
#define _FASTDDS_CONFIGURATION_APPLICATION_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CONFIGURATION__APPLICATION_HPP
#define FASTDDS_EXAMPLES_CPP_CONFIGURATION__APPLICATION_HPP

#include <atomic>

Expand Down Expand Up @@ -52,4 +52,4 @@ class Application
} // namespace fastdds
} // namespace eprosima

#endif /* _FASTDDS_CONFIGURATION_APPLICATION_HPP_ */
#endif // FASTDDS_EXAMPLES_CPP_CONFIGURATION__APPLICATION_HPP
6 changes: 3 additions & 3 deletions examples/cpp/configuration/CLIParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <fastdds/rtps/attributes/BuiltinTransports.hpp>
#include <fastdds/dds/core/policy/QosPolicies.hpp>

#ifndef _FASTDDS_CONFIGURATION_CLI_PARSER_HPP_
#define _FASTDDS_CONFIGURATION_CLI_PARSER_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CONFIGURATION__CLIPARSER_HPP
#define FASTDDS_EXAMPLES_CPP_CONFIGURATION__CLIPARSER_HPP

namespace eprosima {
namespace fastdds {
Expand Down Expand Up @@ -1137,4 +1137,4 @@ class CLIParser
} // namespace fastdds
} // namespace eprosima

#endif // _FASTDDS_CONFIGURATION_CLI_PARSER_HPP_
#endif // FASTDDS_EXAMPLES_CPP_CONFIGURATION__CLIPARSER_HPP
2 changes: 2 additions & 0 deletions examples/cpp/configuration/PublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include <fastdds/rtps/transport/UDPv4TransportDescriptor.hpp>
#include <fastdds/rtps/transport/UDPv6TransportDescriptor.hpp>

#include "ConfigurationPubSubTypes.hpp"

using namespace eprosima::fastdds::dds;
using namespace eprosima::fastdds::rtps;

Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/configuration/PublisherApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_CONFIGURATION_PUBLISHER_APP_HPP_
#define _FASTDDS_CONFIGURATION_PUBLISHER_APP_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CONFIGURATION__PUBLISHERAPP_HPP
#define FASTDDS_EXAMPLES_CPP_CONFIGURATION__PUBLISHERAPP_HPP


#include <condition_variable>
Expand All @@ -29,7 +29,7 @@

#include "Application.hpp"
#include "CLIParser.hpp"
#include "ConfigurationPubSubTypes.hpp"
#include "Configuration.hpp"
Mario-DL marked this conversation as resolved.
Show resolved Hide resolved

using namespace eprosima::fastdds::dds;

Expand Down Expand Up @@ -118,4 +118,4 @@ class PublisherApp : public Application, public DataWriterListener
} // namespace fastdds
} // namespace eprosima

#endif /* _FASTDDS_CONFIGURATION_PUBLISHER_APP_HPP_ */
#endif // FASTDDS_EXAMPLES_CPP_CONFIGURATION__PUBLISHERAPP_HPP
8 changes: 4 additions & 4 deletions examples/cpp/configuration/SubscriberApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_CONFIGURATION_SUBSCRIBER_APP_HPP_
#define _FASTDDS_CONFIGURATION_SUBSCRIBER_APP_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CONFIGURATION__SUBSCRIBERAPP_HPP
#define FASTDDS_EXAMPLES_CPP_CONFIGURATION__SUBSCRIBERAPP_HPP

#include <atomic>
#include <condition_variable>
Expand All @@ -32,7 +32,7 @@

#include "Application.hpp"
#include "CLIParser.hpp"
#include "ConfigurationPubSubTypes.hpp"
#include "Configuration.hpp"

using namespace eprosima::fastdds::dds;

Expand Down Expand Up @@ -123,4 +123,4 @@ class SubscriberApp : public Application, public DataReaderListener
} // namespace fastdds
} // namespace eprosima

#endif /* _FASTDDS_CONFIGURATION_SUBSCRIBER_APP_HPP_ */
#endif // FASTDDS_EXAMPLES_CPP_CONFIGURATION__SUBSCRIBERAPP_HPP
6 changes: 3 additions & 3 deletions examples/cpp/content_filter/Application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_CONTENT_FILTER_APPLICATION_HPP_
#define _FASTDDS_CONTENT_FILTER_APPLICATION_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__APPLICATION_HPP
#define FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__APPLICATION_HPP

#include <atomic>

Expand Down Expand Up @@ -53,4 +53,4 @@ class Application
} // namespace fastdds
} // namespace eprosima

#endif /* _FASTDDS_CONTEN_FILTER_APPLICATION_HPP_ */
#endif // FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__APPLICATION_HPP
6 changes: 3 additions & 3 deletions examples/cpp/content_filter/CLIParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#include <fastdds/dds/log/Log.hpp>

#ifndef _FASTDDS_CONTENT_FILTER_CLI_PARSER_HPP_
#define _FASTDDS_CONTENT_FILTER_CLI_PARSER_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__CLIPARSER_HPP
#define FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__CLIPARSER_HPP

namespace eprosima {
namespace fastdds {
Expand Down Expand Up @@ -465,4 +465,4 @@ class CLIParser
} // namespace fastdds
} // namespace eprosima

#endif // _FASTDDS_CONTENT_FILTER_CLI_PARSER_HPP_
#endif // FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__CLIPARSER_HPP
6 changes: 3 additions & 3 deletions examples/cpp/content_filter/CustomContentFilter.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef _FASTDDS_CONTENT_FILTER_CUSTOM_FILTER_HPP_
#define _FASTDDS_CONTENT_FILTER_CUSTOM_FILTER_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__CUSTOMCONTENTFILTER_HPP
#define FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__CUSTOMCONTENTFILTER_HPP

#include <fastcdr/Cdr.h>

Expand Down Expand Up @@ -78,4 +78,4 @@ class CustomContentFilter : public eprosima::fastdds::dds::IContentFilter

};

#endif // _FASTDDS_CONTENT_FILTER_CUSTOM_FILTER_HPP_
#endif // FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__CUSTOMCONTENTFILTER_HPP
6 changes: 3 additions & 3 deletions examples/cpp/content_filter/CustomContentFilterFactory.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef _FASTDDS_CONTENT_FILTER_CUSTOM_FILTER_FACTORY_HPP_
#define _FASTDDS_CONTENT_FILTER_CUSTOM_FILTER_FACTORY_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__CUSTOMCONTENTFILTERFACTORY_HPP
#define FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__CUSTOMCONTENTFILTERFACTORY_HPP

#include <fastdds/dds/topic/IContentFilter.hpp>
#include <fastdds/dds/topic/IContentFilterFactory.hpp>
Expand Down Expand Up @@ -88,4 +88,4 @@ class CustomContentFilterFactory : public eprosima::fastdds::dds::IContentFilter
}

};
#endif // _FASTDDS_CONTENT_FILTER_CUSTOM_FILTER_FACTORY_HPP_
#endif // FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__CUSTOMCONTENTFILTERFACTORY_HPP
1 change: 1 addition & 0 deletions examples/cpp/content_filter/PublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <fastdds/rtps/common/Locator.hpp>
#include <fastdds/rtps/transport/UDPv4TransportDescriptor.hpp>

#include "HelloWorldPubSubTypes.hpp"
#include "HelloWorldTypeObjectSupport.hpp"

namespace eprosima {
Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/content_filter/PublisherApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_CONTENT_FILTER_PUBLISHER_APP_HPP_
#define _FASTDDS_CONTENT_FILTER_PUBLISHER_APP_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__PUBLISHERAPP_HPP
#define FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__PUBLISHERAPP_HPP

#include <condition_variable>

Expand All @@ -28,7 +28,7 @@

#include "Application.hpp"
#include "CLIParser.hpp"
#include "HelloWorldPubSubTypes.hpp"
#include "HelloWorld.hpp"
Mario-DL marked this conversation as resolved.
Show resolved Hide resolved

Mario-DL marked this conversation as resolved.
Show resolved Hide resolved
using namespace eprosima::fastdds::dds;

Expand Down Expand Up @@ -95,4 +95,4 @@ class PublisherApp : public Application, public DataWriterListener
} // namespace fastdds
} // namespace eprosima

#endif // _FASTDDS_CONTENT_FILTER_PUBLISHER_APP_HPP_
#endif // FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__PUBLISHERAPP_HPP
1 change: 1 addition & 0 deletions examples/cpp/content_filter/SubscriberApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <fastdds/rtps/common/Locator.hpp>
#include <fastdds/rtps/transport/UDPv4TransportDescriptor.hpp>

#include "HelloWorldPubSubTypes.hpp"
#include "HelloWorldTypeObjectSupport.hpp"

namespace eprosima {
Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/content_filter/SubscriberApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_CONTENT_FILTER_SUBSCRIBER_APP_HPP_
#define _FASTDDS_CONTENT_FILTER_SUBSCRIBER_APP_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__SUBSCRIBERAPP_HPP
#define FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__SUBSCRIBERAPP_HPP

#include <atomic>
#include <condition_variable>
Expand All @@ -35,8 +35,8 @@

#include "Application.hpp"
#include "CLIParser.hpp"
#include "HelloWorldPubSubTypes.hpp"
#include "CustomContentFilterFactory.hpp"
#include "HelloWorld.hpp"
Mario-DL marked this conversation as resolved.
Show resolved Hide resolved

Mario-DL marked this conversation as resolved.
Show resolved Hide resolved
using namespace eprosima::fastdds::dds;
namespace eprosima {
Expand Down Expand Up @@ -107,4 +107,4 @@ class SubscriberApp : public Application, public DataReaderListener
} // namespace fastdds
} // namespace eprosima

#endif // _FASTDDS_CONTENT_FILTER_SUBSCRIBER_APP_HPP_
#endif // FASTDDS_EXAMPLES_CPP_CONTENT_FILTER__SUBSCRIBERAPP_HPP
6 changes: 3 additions & 3 deletions examples/cpp/custom_payload_pool/Application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_CUSTOM_PAYLOAD_POOL_APPLICATION_HPP_
#define _FASTDDS_CUSTOM_PAYLOAD_POOL_APPLICATION_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__APPLICATION_HPP
#define FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__APPLICATION_HPP

#include <atomic>

Expand Down Expand Up @@ -53,4 +53,4 @@ class Application
} // namespace fastdds
} // namespace eprosima

#endif /* _FASTDDS_CUSTOM_PAYLOAD_POOL_APPLICATION_HPP_ */
#endif // FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__APPLICATION_HPP
6 changes: 3 additions & 3 deletions examples/cpp/custom_payload_pool/CLIParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#include <fastdds/dds/log/Log.hpp>

#ifndef _FASTDDS_CUSTOM_PAYLOAD_POOL_CLI_PARSER_HPP_
#define _FASTDDS_CUSTOM_PAYLOAD_POOL_CLI_PARSER_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__CLIPARSER_HPP
#define FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__CLIPARSER_HPP

namespace eprosima {
namespace fastdds {
Expand Down Expand Up @@ -329,4 +329,4 @@ class CLIParser
} // namespace fastdds
} // namespace eprosima

#endif // _FASTDDS_CUSTOM_PAYLOAD_POOL_CLI_PARSER_HPP_
#endif // FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__CLIPARSER_HPP
6 changes: 3 additions & 3 deletions examples/cpp/custom_payload_pool/CustomPayloadPool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* @file CustomPayloadPool.hpp
*/

#ifndef _FASTDDS_CUSTOM_PAYLOAD_POOL_HPP_
#define _FASTDDS_CUSTOM_PAYLOAD_POOL_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__CUSTOMPAYLOADPOOL_HPP
#define FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__CUSTOMPAYLOADPOOL_HPP

#include <assert.h>
#include <stdio.h>
Expand Down Expand Up @@ -97,4 +97,4 @@ class CustomPayloadPool : public eprosima::fastdds::rtps::IPayloadPool

};

#endif // _FASTDDS_CUSTOM_PAYLOAD_POOL_HPP_
#endif // FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__CUSTOMPAYLOADPOOL_HPP
2 changes: 2 additions & 0 deletions examples/cpp/custom_payload_pool/PublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
#include <fastdds/dds/publisher/qos/PublisherQos.hpp>

#include "HelloWorldPubSubTypes.hpp"

using namespace eprosima::fastdds::dds;
using namespace eprosima::fastdds::rtps;

Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/custom_payload_pool/PublisherApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_CUSTOM_PAYLOAD_POOL_PUBLISHER_HPP_
#define _FASTDDS_CUSTOM_PAYLOAD_POOL_PUBLISHER_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__PUBLISHERAPP_HPP
#define FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__PUBLISHERAPP_HPP

#include <condition_variable>
#include <mutex>
Expand All @@ -30,7 +30,7 @@
#include "Application.hpp"
#include "CLIParser.hpp"
#include "CustomPayloadPool.hpp"
#include "HelloWorldPubSubTypes.hpp"
#include "HelloWorld.hpp"
Mario-DL marked this conversation as resolved.
Show resolved Hide resolved

using namespace eprosima::fastdds::dds;

Expand Down Expand Up @@ -103,4 +103,4 @@ class PublisherApp : public Application, public DataWriterListener
} // namespace fastdds
} // namespace eprosima

#endif /* _FASTDDS_CUSTOM_PAYLOAD_POOL_PUBLISHER_H_ */
#endif // FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__PUBLISHERAPP_HPP
2 changes: 2 additions & 0 deletions examples/cpp/custom_payload_pool/SubscriberApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>

#include "HelloWorldPubSubTypes.hpp"

using namespace eprosima::fastdds::dds;
namespace eprosima {
namespace fastdds {
Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/custom_payload_pool/SubscriberApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_CUSTOM_PAYLOAD_POOL_SUBSCRIBER_HPP_
#define _FASTDDS_CUSTOM_PAYLOAD_POOL_SUBSCRIBER_HPP_
#ifndef FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__SUBSCRIBERAPP_HPP
#define FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__SUBSCRIBERAPP_HPP

#include <condition_variable>
#include <mutex>
Expand All @@ -31,7 +31,7 @@
#include "Application.hpp"
#include "CLIParser.hpp"
#include "CustomPayloadPool.hpp"
#include "HelloWorldPubSubTypes.hpp"
#include "HelloWorld.hpp"
Mario-DL marked this conversation as resolved.
Show resolved Hide resolved

using namespace eprosima::fastdds::dds;
namespace eprosima {
Expand Down Expand Up @@ -101,4 +101,4 @@ class SubscriberApp : public Application, public DataReaderListener
} // namespace fastdds
} // namespace eprosima

#endif /* _FASTDDS_CUSTOM_PAYLOAD_POOL_SUBSCRIBER_HPP_ */
#endif // FASTDDS_EXAMPLES_CPP_CUSTOM_PAYLOAD_POOL__SUBSCRIBERAPP_HPP
4 changes: 0 additions & 4 deletions examples/cpp/dds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ add_subdirectory(RequestReplyExample)
add_subdirectory(StaticHelloWorldExample)
add_subdirectory(WriterLoansExample)
add_subdirectory(ZeroCopyExample)

if(SECURITY)
add_subdirectory(SecureHelloWorldExample)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
*
*/

#ifndef HELLOWORLDPUBLISHER_H_
#define HELLOWORLDPUBLISHER_H_
#ifndef FASTDDS_EXAMPLES_CPP_DDS_DYNAMIC_HELLO_WORLD_EXAMPLE__HELLOWORLDPUBLISHER_H
#define FASTDDS_EXAMPLES_CPP_DDS_DYNAMIC_HELLO_WORLD_EXAMPLE__HELLOWORLDPUBLISHER_H

#include <fastdds/dds/xtypes/dynamic_types/DynamicData.hpp>

#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/domain/DomainParticipant.hpp>

Expand Down Expand Up @@ -90,4 +89,4 @@ class HelloWorldPublisher



#endif /* HELLOWORLDPUBLISHER_H_ */
#endif // FASTDDS_EXAMPLES_CPP_DDS_DYNAMIC_HELLO_WORLD_EXAMPLE__HELLOWORLDPUBLISHER_H
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef HELLOWORLDSUBSCRIBER_H_
#define HELLOWORLDSUBSCRIBER_H_
#ifndef FASTDDS_EXAMPLES_CPP_DDS_DYNAMIC_HELLO_WORLD_EXAMPLE__HELLOWORLDSUBSCRIBER_H
#define FASTDDS_EXAMPLES_CPP_DDS_DYNAMIC_HELLO_WORLD_EXAMPLE__HELLOWORLDSUBSCRIBER_H

#include <atomic>
#include <condition_variable>
Expand Down Expand Up @@ -112,4 +112,4 @@ class HelloWorldSubscriber

};

#endif /* HELLOWORLDSUBSCRIBER_H_ */
#endif // FASTDDS_EXAMPLES_CPP_DDS_DYNAMIC_HELLO_WORLD_EXAMPLE__HELLOWORLDSUBSCRIBER_H
Loading
Loading