Skip to content

Commit

Permalink
Refs #20733: Apply Miguel's suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: eduponz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz committed Apr 30, 2024
1 parent b76cfdc commit 2519f21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions src/cpp/dynamic-types/AnnotationDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <fastdds/dds/log/Log.hpp>
#include <fastrtps/types/AnnotationDescriptor.h>
#include <fastrtps/types/DynamicType.h>
#include <fastrtps/types/DynamicTypeBuilderFactory.h>
#include <fastdds/dds/log/Log.hpp>
#include <fastrtps/types/TypesBase.h>

namespace eprosima {
namespace fastrtps {
Expand Down Expand Up @@ -96,9 +97,9 @@ bool AnnotationDescriptor::key_annotation() const
if (type_ && (type_->get_name() == ANNOTATION_KEY_ID || type_->get_name() == ANNOTATION_EPKEY_ID))
{
// When an annotation is a key annotation, there is only one entry in value_.
// Its map key is "value" and its value is either "true" of "false".
// Its map key is ANNOTATION_VALUE_ID and its value is either "true" of "false".
// We cannot call get_value() directly because it is not const-qualified
auto it = value_.find("value");
auto it = value_.find(ANNOTATION_VALUE_ID);

if (it != value_.end())
{
Expand All @@ -112,7 +113,7 @@ bool AnnotationDescriptor::key_annotation() const
ReturnCode_t AnnotationDescriptor::get_value(
std::string& value)
{
return get_value(value, "value");
return get_value(value, ANNOTATION_VALUE_ID);
}

ReturnCode_t AnnotationDescriptor::get_value(
Expand Down
11 changes: 6 additions & 5 deletions src/cpp/dynamic-types/MemberDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <fastrtps/types/MemberDescriptor.h>
#include <fastrtps/types/DynamicType.h>
#include <fastrtps/types/TypeDescriptor.h>
#include <fastdds/dds/log/Log.hpp>
#include <fastrtps/types/AnnotationDescriptor.h>
#include <fastrtps/types/DynamicType.h>
#include <fastrtps/types/DynamicTypeBuilderFactory.h>
#include <fastdds/dds/log/Log.hpp>
#include <fastrtps/types/MemberDescriptor.h>
#include <fastrtps/types/TypeDescriptor.h>
#include <fastrtps/types/TypesBase.h>

namespace eprosima {
namespace fastrtps {
Expand Down Expand Up @@ -421,7 +422,7 @@ void MemberDescriptor::copy_annotations_from_type(
{
if (type)
{
// Copy annotation from type
// Copy annotations from type
uint32_t num_annotations = type->get_annotation_count();
for (uint32_t i = 0; i < num_annotations; ++i)
{
Expand Down

0 comments on commit 2519f21

Please sign in to comment.