MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / copy

Method copy

dds/DCPS/XTypes/DynamicDataImpl.cpp:998–1055  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

996CORBA::WChar* DynamicDataImpl::SingleValue::get_wstring() const { return CORBA::wstring_dup(wstr_); }
997
998void DynamicDataImpl::SingleValue::copy(const SingleValue& other)
999{
1000 switch (kind_) {
1001 case TK_INT8:
1002 active_ = new(int8_) ACE_OutputCDR::from_int8(other.get<ACE_OutputCDR::from_int8>());
1003 break;
1004 case TK_UINT8:
1005 active_ = new(uint8_) ACE_OutputCDR::from_uint8(other.get<ACE_OutputCDR::from_uint8>());
1006 break;
1007 case TK_INT16:
1008 int16_ = other.int16_;
1009 break;
1010 case TK_UINT16:
1011 uint16_ = other.uint16_;
1012 break;
1013 case TK_INT32:
1014 int32_ = other.int32_;
1015 break;
1016 case TK_UINT32:
1017 uint32_ = other.uint32_;
1018 break;
1019 case TK_INT64:
1020 int64_ = other.int64_;
1021 break;
1022 case TK_UINT64:
1023 uint64_ = other.uint64_;
1024 break;
1025 case TK_FLOAT32:
1026 float32_ = other.float32_;
1027 break;
1028 case TK_FLOAT64:
1029 float64_ = other.float64_;
1030 break;
1031 case TK_FLOAT128:
1032 float128_ = other.float128_;
1033 break;
1034 case TK_BOOLEAN:
1035 active_ = new(boolean_) ACE_OutputCDR::from_boolean(other.get<ACE_OutputCDR::from_boolean>());
1036 break;
1037 case TK_BYTE:
1038 active_ = new(byte_) ACE_OutputCDR::from_octet(other.get<ACE_OutputCDR::from_octet>());
1039 break;
1040 case TK_CHAR8:
1041 active_ = new(char8_) ACE_OutputCDR::from_char(other.get<ACE_OutputCDR::from_char>());
1042 break;
1043 case TK_STRING8:
1044 str_ = CORBA::string_dup(other.str_);
1045 break;
1046#ifdef DDS_HAS_WCHAR
1047 case TK_CHAR16:
1048 active_ = new(char16_) ACE_OutputCDR::from_wchar(other.get<ACE_OutputCDR::from_wchar>());
1049 break;
1050 case TK_STRING16:
1051 wstr_ = CORBA::wstring_dup(other.wstr_);
1052 break;
1053#endif
1054 }
1055}

Callers 7

clone_mbMethod · 0.45
writeFunction · 0.45
splitMethod · 0.45
encode_payloadMethod · 0.45
encode_rtps_messageMethod · 0.45
replace_chunksMethod · 0.45
deliver_from_secureMethod · 0.45

Calls 2

string_dupFunction · 0.85
wstring_dupFunction · 0.85

Tested by

no test coverage detected