LCOV - code coverage report
Current view: top level - DCPS/XTypes - DynamicTypeMemberImpl.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 20 35 57.1 %
Date: 2023-04-30 01:32:43 Functions: 7 14 50.0 %

          Line data    Source code
       1             : #include <DCPS/DdsDcps_pch.h>
       2             : 
       3             : #ifndef OPENDDS_SAFETY_PROFILE
       4             : 
       5             : #include "DynamicTypeMemberImpl.h"
       6             : 
       7             : #include "DynamicTypeImpl.h"
       8             : 
       9             : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
      10             : namespace OpenDDS {
      11             : namespace XTypes {
      12             : 
      13        2339 : DynamicTypeMemberImpl::DynamicTypeMemberImpl()
      14        2339 : {}
      15             : 
      16        4678 : DynamicTypeMemberImpl::~DynamicTypeMemberImpl()
      17        4678 : {}
      18             : 
      19        2339 : DDS::ReturnCode_t DynamicTypeMemberImpl::set_descriptor(DDS::MemberDescriptor* descriptor)
      20             : {
      21             :   // ValueTypes don't have a duplicate so manually add_ref.
      22        2339 :   CORBA::add_ref(descriptor);
      23        2339 :   descriptor_ = descriptor;
      24        2339 :   return DDS::RETCODE_OK;
      25             : }
      26             : 
      27       64975 : DDS::ReturnCode_t DynamicTypeMemberImpl::get_descriptor(DDS::MemberDescriptor*& descriptor)
      28             : {
      29       64975 :   DDS::MemberDescriptor_var descriptor_v(descriptor);
      30       64975 :   descriptor = descriptor_;
      31       64975 :   CORBA::add_ref(descriptor);
      32       64975 :   return DDS::RETCODE_OK;
      33       64975 : }
      34             : 
      35           0 : CORBA::ULong DynamicTypeMemberImpl::get_annotation_count()
      36             : {
      37             :   // FUTURE
      38           0 :   return 0;
      39             : }
      40             : 
      41           0 : DDS::ReturnCode_t DynamicTypeMemberImpl::get_annotation(DDS::AnnotationDescriptor*&, CORBA::ULong)
      42             : {
      43             :   // FUTURE
      44           0 :   return DDS::RETCODE_UNSUPPORTED;
      45             : }
      46             : 
      47           0 : CORBA::ULong DynamicTypeMemberImpl::get_verbatim_text_count()
      48             : {
      49             :   // FUTURE
      50           0 :   return 0;
      51             : }
      52             : 
      53           0 : DDS::ReturnCode_t DynamicTypeMemberImpl::get_verbatim_text(DDS::VerbatimTextDescriptor*&, CORBA::ULong)
      54             : {
      55             :   // FUTURE
      56           0 :   return DDS::RETCODE_UNSUPPORTED;
      57             : }
      58             : 
      59           0 : bool DynamicTypeMemberImpl::equals(DDS::DynamicTypeMember_ptr other)
      60             : {
      61             :   //7.5.2.6.3 Operation: equals
      62             :   //Two members shall be considered equal if and only if they belong to the same type and all of
      63             :   //their respective properties, as identified in Table 52 above, are equal.
      64             : 
      65             :   //In addition to what the spec says to compare, we will be comparing the MemberDescriptors of both
      66             :   //DynamicTypeMembers. The spec seems to assume this is the case, despite not listing the MemberDescriptor
      67             :   //as a property in table 52. If this were not the case, any two members within a type would be considered
      68             :   //equal, regardless of whether they are actually the same member.
      69             : 
      70           0 :   DDS::MemberDescriptor_var other_md;
      71           0 :   if (other->get_descriptor(other_md) != DDS::RETCODE_OK) {
      72           0 :     return false;
      73             :   }
      74             : 
      75           0 :   DynamicTypePtrPairSeen dt_ptr_pair;
      76           0 :   return test_equality(descriptor_, other_md, dt_ptr_pair);
      77           0 : }
      78             : 
      79         592 : MemberId DynamicTypeMemberImpl::get_id()
      80             : {
      81         592 :   return descriptor_->id();
      82             : }
      83             : 
      84           3 : char* DynamicTypeMemberImpl::get_name()
      85             : {
      86           3 :   CORBA::String_var s = descriptor_->name();
      87           6 :   return s._retn();
      88           3 : }
      89             : 
      90             : } // namespace XTypes
      91             : } // namespace OpenDDS
      92             : 
      93             : OPENDDS_END_VERSIONED_NAMESPACE_DECL
      94             : 
      95             : #endif // OPENDDS_SAFETY_PROFILE

Generated by: LCOV version 1.16