diff --git a/examples/cpp/rtps/AsSocket/TestReaderSocket.h b/examples/cpp/rtps/AsSocket/TestReaderSocket.h index 48641267650..4fe2daefdd2 100644 --- a/examples/cpp/rtps/AsSocket/TestReaderSocket.h +++ b/examples/cpp/rtps/AsSocket/TestReaderSocket.h @@ -22,12 +22,9 @@ #include -namespace eprosima -{ -namespace fastrtps -{ -namespace rtps -{ +namespace eprosima { +namespace fastrtps { +namespace rtps { class RTPSParticipant; class ReaderHistory; class RTPSReader; diff --git a/examples/cpp/rtps/AsSocket/TestWriterSocket.h b/examples/cpp/rtps/AsSocket/TestWriterSocket.h index 4611ca6621f..c8151687d47 100644 --- a/examples/cpp/rtps/AsSocket/TestWriterSocket.h +++ b/examples/cpp/rtps/AsSocket/TestWriterSocket.h @@ -24,12 +24,9 @@ #include #include -namespace eprosima -{ -namespace fastrtps -{ -namespace rtps -{ +namespace eprosima { +namespace fastrtps { +namespace rtps { class RTPSParticipant; class WriterHistory; class RTPSWriter; diff --git a/examples/cpp/rtps/Persistent/TestReaderPersistent.h b/examples/cpp/rtps/Persistent/TestReaderPersistent.h index 00d000710d5..82238981843 100644 --- a/examples/cpp/rtps/Persistent/TestReaderPersistent.h +++ b/examples/cpp/rtps/Persistent/TestReaderPersistent.h @@ -22,12 +22,9 @@ #include -namespace eprosima -{ -namespace fastrtps -{ -namespace rtps -{ +namespace eprosima { +namespace fastrtps { +namespace rtps { class RTPSParticipant; class ReaderHistory; class RTPSReader; diff --git a/examples/cpp/rtps/Persistent/TestWriterPersistent.h b/examples/cpp/rtps/Persistent/TestWriterPersistent.h index 3947eb34f29..0e4e875c51c 100644 --- a/examples/cpp/rtps/Persistent/TestWriterPersistent.h +++ b/examples/cpp/rtps/Persistent/TestWriterPersistent.h @@ -22,12 +22,9 @@ #include -namespace eprosima -{ -namespace fastrtps -{ -namespace rtps -{ +namespace eprosima { +namespace fastrtps { +namespace rtps { class RTPSParticipant; class WriterHistory; class RTPSWriter; diff --git a/examples/cpp/rtps/Registered/TestReaderRegistered.h b/examples/cpp/rtps/Registered/TestReaderRegistered.h index c08b9b476f7..9f96d49e14a 100644 --- a/examples/cpp/rtps/Registered/TestReaderRegistered.h +++ b/examples/cpp/rtps/Registered/TestReaderRegistered.h @@ -23,12 +23,9 @@ #include -namespace eprosima -{ -namespace fastrtps -{ -namespace rtps -{ +namespace eprosima { +namespace fastrtps { +namespace rtps { class RTPSParticipant; class ReaderHistory; class RTPSReader; diff --git a/examples/cpp/rtps/Registered/TestWriterRegistered.h b/examples/cpp/rtps/Registered/TestWriterRegistered.h index b8370e7fc82..2e8837ffd0b 100644 --- a/examples/cpp/rtps/Registered/TestWriterRegistered.h +++ b/examples/cpp/rtps/Registered/TestWriterRegistered.h @@ -22,12 +22,9 @@ #include -namespace eprosima -{ -namespace fastrtps -{ -namespace rtps -{ +namespace eprosima { +namespace fastrtps { +namespace rtps { class RTPSParticipant; class WriterHistory; } // namespace rtps diff --git a/include/fastdds/rtps/security/cryptography/CryptoKeyExchange.h b/include/fastdds/rtps/security/cryptography/CryptoKeyExchange.h index a15c55aabb9..b47d1e4803d 100644 --- a/include/fastdds/rtps/security/cryptography/CryptoKeyExchange.h +++ b/include/fastdds/rtps/security/cryptography/CryptoKeyExchange.h @@ -29,9 +29,12 @@ class SecurityException; class CryptoKeyExchange { - public: +public: + + virtual ~CryptoKeyExchange() + { + } - virtual ~CryptoKeyExchange(){} /** * Creates Crypto Tokens containing the info to decrypt text encoded by the local Participant. * To be sent to the remote participant. @@ -56,10 +59,10 @@ class CryptoKeyExchange * @return TRUE if successful */ virtual bool set_remote_participant_crypto_tokens( - const ParticipantCryptoHandle &local_participant_crypto, - ParticipantCryptoHandle &remote_participant_crypto, - const ParticipantCryptoTokenSeq &remote_participant_tokens, - SecurityException &exception) = 0; + const ParticipantCryptoHandle& local_participant_crypto, + ParticipantCryptoHandle& remote_participant_crypto, + const ParticipantCryptoTokenSeq& remote_participant_tokens, + SecurityException& exception) = 0; /** * Creates CryptoTokens containing the info to decrypt text encoded by the local DataWriter. @@ -70,10 +73,10 @@ class CryptoKeyExchange * @return TRUE if successful */ virtual bool create_local_datawriter_crypto_tokens( - DatawriterCryptoTokenSeq &local_datawriter_crypto_tokens, - DatawriterCryptoHandle &local_datawriter_crypto, - DatareaderCryptoHandle &remote_datareader_crypto, - SecurityException &exception) = 0; + DatawriterCryptoTokenSeq& local_datawriter_crypto_tokens, + DatawriterCryptoHandle& local_datawriter_crypto, + DatareaderCryptoHandle& remote_datareader_crypto, + SecurityException& exception) = 0; /** * Creates CryptoTokens containing the info to decrypt text encoded by the local DataReader. @@ -84,10 +87,10 @@ class CryptoKeyExchange * @return TRUE if successful */ virtual bool create_local_datareader_crypto_tokens( - DatareaderCryptoTokenSeq &local_datareader_crypto_tokens, - DatareaderCryptoHandle &local_datareader_crypto, - DatawriterCryptoHandle &remote_datawriter_crypto, - SecurityException &exception) = 0; + DatareaderCryptoTokenSeq& local_datareader_crypto_tokens, + DatareaderCryptoHandle& local_datareader_crypto, + DatawriterCryptoHandle& remote_datawriter_crypto, + SecurityException& exception) = 0; /** * Configures the Cryptographic Plugin with the material needed to interpret messages coming from the remote DataReader. @@ -98,10 +101,10 @@ class CryptoKeyExchange * @return TRUE if successful */ virtual bool set_remote_datareader_crypto_tokens( - DatawriterCryptoHandle &local_datawriter_crypto, - DatareaderCryptoHandle &remote_datareader_crypto, - const DatareaderCryptoTokenSeq &remote_datareader_tokens, - SecurityException &exception) = 0; + DatawriterCryptoHandle& local_datawriter_crypto, + DatareaderCryptoHandle& remote_datareader_crypto, + const DatareaderCryptoTokenSeq& remote_datareader_tokens, + SecurityException& exception) = 0; /** * Configures the Cryptographic Plugin with the material needed to interpret messages coming from the remote DataWriter. @@ -113,10 +116,10 @@ class CryptoKeyExchange */ virtual bool set_remote_datawriter_crypto_tokens( - DatareaderCryptoHandle &local_datareader_crypto, - DatawriterCryptoHandle &remote_datawriter_crypto, - const DatawriterCryptoTokenSeq &remote_datawriter_tokens, - SecurityException &exception) = 0; + DatareaderCryptoHandle& local_datareader_crypto, + DatawriterCryptoHandle& remote_datawriter_crypto, + const DatawriterCryptoTokenSeq& remote_datawriter_tokens, + SecurityException& exception) = 0; /** * Release resources associated with a CryptoTokenSeq @@ -125,8 +128,8 @@ class CryptoKeyExchange * @return TRUE if successful */ virtual bool return_crypto_tokens( - const CryptoTokenSeq &crypto_tokens, - SecurityException &exception) = 0; + const CryptoTokenSeq& crypto_tokens, + SecurityException& exception) = 0; }; diff --git a/src/cpp/rtps/exceptions/Exception.cpp b/src/cpp/rtps/exceptions/Exception.cpp index 9c80d92fd14..9703069fe25 100644 --- a/src/cpp/rtps/exceptions/Exception.cpp +++ b/src/cpp/rtps/exceptions/Exception.cpp @@ -16,30 +16,45 @@ using namespace eprosima::fastrtps::rtps; -Exception::Exception(const char* const& message) : message_(message), minor_(0) +Exception::Exception( + const char* const& message) + : message_(message) + , minor_(0) { } -Exception::Exception(const Exception &ex) : message_(ex.message_), minor_(ex.minor_) +Exception::Exception( + const Exception& ex) + : message_(ex.message_) + , minor_(ex.minor_) { } -Exception::Exception(Exception&& ex) : message_(std::move(ex.message_)), minor_(ex.minor_) +Exception::Exception( + Exception&& ex) + : message_(std::move(ex.message_)) + , minor_(ex.minor_) { } -Exception::Exception(const char* const& message, const int32_t minor) : message_(message), minor_(minor) +Exception::Exception( + const char* const& message, + const int32_t minor) + : message_(message) + , minor_(minor) { } -Exception& Exception::operator=(const Exception &ex) +Exception& Exception::operator =( + const Exception& ex) { message_ = ex.message_; minor_ = ex.minor_; return *this; } -Exception& Exception::operator=(Exception&& ex) +Exception& Exception::operator =( + Exception&& ex) { message_ = std::move(ex.message_); minor_ = ex.minor_; @@ -55,7 +70,8 @@ const int32_t& Exception::minor() const return minor_; } -void Exception::minor(const int32_t &minor) +void Exception::minor( + const int32_t& minor) { minor_ = minor; } diff --git a/src/cpp/rtps/security/exceptions/SecurityException.cpp b/src/cpp/rtps/security/exceptions/SecurityException.cpp index 218583b69df..b2c5482f5fd 100644 --- a/src/cpp/rtps/security/exceptions/SecurityException.cpp +++ b/src/cpp/rtps/security/exceptions/SecurityException.cpp @@ -16,29 +16,37 @@ using namespace eprosima::fastrtps::rtps::security; -SecurityException::SecurityException(const SecurityException &ex) : Exception(ex) +SecurityException::SecurityException( + const SecurityException& ex) + : Exception(ex) { } -SecurityException::SecurityException(SecurityException&& ex) : Exception(std::move(ex)) +SecurityException::SecurityException( + SecurityException&& ex) + : Exception(std::move(ex)) { } -SecurityException& SecurityException::operator=(const SecurityException &ex) +SecurityException& SecurityException::operator =( + const SecurityException& ex) { - if(this != &ex) + if (this != &ex) { - Exception::operator=(ex); + Exception::operator =( + ex); } return *this; } -SecurityException& SecurityException::operator=(SecurityException&& ex) +SecurityException& SecurityException::operator =( + SecurityException&& ex) { - if(this != &ex) + if (this != &ex) { - Exception::operator=(std::move(ex)); + Exception::operator =( + std::move(ex)); } return *this;