LCOV - code coverage report
Current view: top level - DCPS/XTypes - MemberDescriptorImpl.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 32 55 58.2 %
Date: 2023-04-30 01:32:43 Functions: 5 14 35.7 %

          Line data    Source code
       1             : #include <DCPS/DdsDcps_pch.h>
       2             : 
       3             : #ifndef OPENDDS_SAFETY_PROFILE
       4             : 
       5             : #include "MemberDescriptorImpl.h"
       6             : 
       7             : #include "DynamicTypeImpl.h"
       8             : 
       9             : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
      10             : namespace OpenDDS {
      11             : namespace XTypes {
      12             : 
      13        2339 : MemberDescriptorImpl::MemberDescriptorImpl()
      14             : {
      15        2339 :   id(MEMBER_ID_INVALID);
      16        2339 :   index(0);
      17        2339 :   try_construct_kind(DDS::DISCARD);
      18        2339 :   is_key(false);
      19        2339 :   is_optional(false);
      20        2339 :   is_must_understand(false);
      21        2339 :   is_shared(false);
      22        2339 :   is_default_label(false);
      23        2339 : }
      24             : 
      25        4688 : MemberDescriptorImpl::~MemberDescriptorImpl()
      26        4688 : {}
      27             : 
      28           0 : bool MemberDescriptorImpl::equals(DDS::MemberDescriptor* other)
      29             : {
      30           0 :   DynamicTypePtrPairSeen dt_ptr_pair;
      31           0 :   return test_equality(this, other, dt_ptr_pair);
      32           0 : }
      33             : 
      34           0 : CORBA::ValueBase* MemberDescriptorImpl::_copy_value()
      35             : {
      36           0 :   ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: MemberDescriptorImpl::_copy_value is not implemented\n"));
      37           0 :   return 0;
      38             : }
      39             : 
      40           0 : CORBA::TypeCode_ptr MemberDescriptorImpl::_tao_type() const
      41             : {
      42           0 :   ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: MemberDescriptorImpl::_tao_type is not implemented\n"));
      43           0 :   return 0;
      44             : }
      45             : 
      46           0 : DDS::ReturnCode_t MemberDescriptorImpl::copy_from(DDS::MemberDescriptor*)
      47             : {
      48             :   // FUTURE
      49           0 :   return DDS::RETCODE_UNSUPPORTED;
      50             : }
      51             : 
      52           0 : ::CORBA::Boolean MemberDescriptorImpl::is_consistent()
      53             : {
      54             :   // FUTURE
      55           0 :   ACE_ERROR((LM_ERROR, "(%P|%t) ERRROR: MemberDescriptorImpl::is_consistent is not implemented\n"));
      56           0 :   return false;
      57             : }
      58             : 
      59           0 : ::CORBA::Boolean MemberDescriptorImpl::_tao_marshal__DDS_MemberDescriptor(TAO_OutputCDR &, TAO_ChunkInfo &) const
      60             : {
      61           0 :   ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: MemberDescriptorImpl::_tao_marshal__DDS_MemberDescriptor is not implemented\n"));
      62           0 :   return false;
      63             : }
      64             : 
      65           0 : ::CORBA::Boolean MemberDescriptorImpl::_tao_unmarshal__DDS_MemberDescriptor(TAO_InputCDR &, TAO_ChunkInfo &)
      66             : {
      67           0 :   ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: MemberDescriptorImpl::_tao_unmarshal__DDS_MemberDescriptor is not implemented\n"));
      68           0 :   return false;
      69             : }
      70             : 
      71          50 : inline bool operator==(const DDS::UnionCaseLabelSeq& lhs, const DDS::UnionCaseLabelSeq& rhs)
      72             : {
      73          50 :   if (lhs.length() == rhs.length()) {
      74          54 :     for (ACE_CDR::ULong i = 0; i < lhs.length(); ++i) {
      75           4 :       if (lhs[i] != rhs[i]) {
      76           0 :         return false;
      77             :       }
      78             :     }
      79          50 :     return true;
      80             :   }
      81           0 :   return false;
      82             : }
      83             : 
      84          50 : bool test_equality(DDS::MemberDescriptor* lhs, DDS::MemberDescriptor* rhs, DynamicTypePtrPairSeen& dt_ptr_pair)
      85             : {
      86          50 :   const DDS::DynamicType_ptr lhs_type = lhs->type();
      87          50 :   const DDS::DynamicType_ptr rhs_type = rhs->type();
      88             :   return
      89          50 :     std::strcmp(lhs->name(), rhs->name()) == 0 &&
      90          50 :     lhs->id() == rhs->id() &&
      91          50 :     test_equality(lhs_type, rhs_type, dt_ptr_pair) &&
      92          50 :     lhs->default_value() == rhs->default_value() &&
      93          50 :     lhs->index() == rhs->index() &&
      94          50 :     lhs->label() == rhs->label() &&
      95          50 :     lhs->try_construct_kind() == rhs->try_construct_kind() &&
      96          50 :     lhs->is_key() == rhs->is_key() &&
      97          50 :     lhs->is_optional() == rhs->is_optional() &&
      98          50 :     lhs->is_must_understand() == rhs->is_must_understand() &&
      99         150 :     lhs->is_shared() == rhs->is_shared() &&
     100         100 :     lhs->is_default_label() == rhs->is_default_label();
     101             : }
     102             : 
     103             : } // namespace XTypes
     104             : } // namespace OpenDDS
     105             : 
     106             : OPENDDS_END_VERSIONED_NAMESPACE_DECL
     107             : 
     108             : #endif // OPENDDS_SAFETY_PROFILE

Generated by: LCOV version 1.16