Changeset 74386 in vbox
- Timestamp:
- Sep 20, 2018 3:46:38 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 125207
- Location:
- trunk/src/VBox/Runtime/common/rest
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/rest/RTCRestAnyObject.cpp
r74347 r74386 382 382 383 383 384 RTCRestObjectBase *RTCRestAnyObject::baseClone() const 385 { 386 RTCRestAnyObject *pClone = new (std::nothrow) RTCRestAnyObject(); 387 if (pClone) 388 { 389 int rc = pClone->assignCopy(*this); 390 if (RT_SUCCESS(rc)) 391 return pClone; 392 delete pClone; 393 } 394 return NULL; 395 } 396 397 384 398 int RTCRestAnyObject::setNull(void) 385 399 { -
trunk/src/VBox/Runtime/common/rest/RTCRestArrayBase.cpp
r74263 r74386 90 90 *********************************************************************************************************************************/ 91 91 92 RTCRestObjectBase *RTCRestArrayBase::baseClone() const 93 { 94 RTCRestArrayBase *pClone = createClone(); 95 if (pClone) 96 { 97 int rc = pClone->copyArrayWorker(*this, false /*fThrow*/); 98 if (RT_SUCCESS(rc)) 99 return pClone; 100 delete pClone; 101 } 102 return NULL; 103 } 104 105 92 106 int RTCRestArrayBase::resetToDefault() 93 107 { … … 458 472 { 459 473 int rc; 460 RTCRestObjectBase *pValueCopy = createValueCopy(&a_rValue);474 RTCRestObjectBase *pValueCopy = a_rValue.baseClone(); 461 475 if (pValueCopy) 462 476 { -
trunk/src/VBox/Runtime/common/rest/RTCRestStringMapBase.cpp
r74197 r74386 73 73 * Overridden base object methods * 74 74 *********************************************************************************************************************************/ 75 76 RTCRestObjectBase *RTCRestStringMapBase::baseClone() const 77 { 78 RTCRestStringMapBase *pClone = createClone(); 79 if (pClone) 80 { 81 int rc = pClone->copyMapWorker(*this, false /*fThrow*/); 82 if (RT_SUCCESS(rc)) 83 return pClone; 84 delete pClone; 85 } 86 return NULL; 87 } 88 75 89 76 90 int RTCRestStringMapBase::resetToDefault() … … 394 408 { 395 409 int rc; 396 RTCRestObjectBase *pValueCopy = createValueCopy(&a_rValue);410 RTCRestObjectBase *pValueCopy = a_rValue.baseClone(); 397 411 if (pValueCopy) 398 412 { -
trunk/src/VBox/Runtime/common/rest/rest-binary.cpp
r74228 r74386 176 176 177 177 /* Overridden methods: */ 178 179 RTCRestObjectBase *RTCRestBinary::baseClone() const 180 { 181 RTCRestBinary *pClone = new (std::nothrow) RTCRestBinary(); 182 if (pClone) 183 { 184 int rc = pClone->assignCopy(*this); 185 if (RT_SUCCESS(rc)) 186 return pClone; 187 delete pClone; 188 } 189 return NULL; 190 } 191 192 178 193 int RTCRestBinary::setNull(void) 179 194 { … … 302 317 AssertMsgFailed(("Please use assignReadOnly!\n")); 303 318 return assignReadOnly(a_pvBuf, a_cbBuf); 319 } 320 321 322 RTCRestObjectBase *RTCRestBinaryParameter::baseClone() const 323 { 324 RTCRestBinaryParameter *pClone = new (std::nothrow) RTCRestBinaryParameter(); 325 if (pClone) 326 { 327 int rc = pClone->assignCopy(*this); 328 if (RT_SUCCESS(rc)) 329 return pClone; 330 delete pClone; 331 } 332 return NULL; 304 333 } 305 334 … … 487 516 AssertStmt(a_cbBuf <= m_cbMaxDownload, m_cbMaxDownload = a_cbBuf); 488 517 return RTCRestBinary::assignWriteable(a_pvBuf, a_cbBuf); 518 } 519 520 521 RTCRestObjectBase *RTCRestBinaryResponse::baseClone() const 522 { 523 RTCRestBinaryResponse *pClone = new (std::nothrow) RTCRestBinaryResponse(); 524 if (pClone) 525 { 526 int rc = pClone->assignCopy(*this); 527 if (RT_SUCCESS(rc)) 528 return pClone; 529 delete pClone; 530 } 531 return NULL; 489 532 } 490 533 -
trunk/src/VBox/Runtime/common/rest/rest-primary-object-types.cpp
r74356 r74386 185 185 186 186 187 RTCRestObjectBase *RTCRestBool::baseClone() const 188 { 189 return new (std::nothrow) RTCRestBool(*this); 190 } 191 192 187 193 int RTCRestBool::resetToDefault() 188 194 { … … 356 362 357 363 364 RTCRestObjectBase *RTCRestInt64::baseClone() const 365 { 366 return new (std::nothrow) RTCRestInt64(*this); 367 } 368 369 358 370 int RTCRestInt64::resetToDefault() 359 371 { … … 510 522 m_iValue = a_rThat.m_iValue; 511 523 return VINF_SUCCESS; 524 } 525 526 527 RTCRestObjectBase *RTCRestInt32::baseClone() const 528 { 529 return new (std::nothrow) RTCRestInt32(*this); 512 530 } 513 531 … … 690 708 691 709 710 RTCRestObjectBase *RTCRestInt16::baseClone() const 711 { 712 return new (std::nothrow) RTCRestInt16(*this); 713 } 714 715 692 716 int RTCRestInt16::resetToDefault() 693 717 { … … 856 880 m_rdValue = a_rdValue; 857 881 m_fNullIndicator = false; 882 } 883 884 885 RTCRestObjectBase *RTCRestDouble::baseClone() const 886 { 887 return new (std::nothrow) RTCRestDouble(*this); 858 888 } 859 889 … … 1030 1060 /** Default constructor. */ 1031 1061 RTCRestString::RTCRestString() 1032 : RTC String()1033 , RTC RestObjectBase()1062 : RTCRestObjectBase() 1063 , RTCString() 1034 1064 { 1035 1065 } … … 1038 1068 /** Copy constructor. */ 1039 1069 RTCRestString::RTCRestString(RTCRestString const &a_rThat) 1040 : RTC String(a_rThat)1041 , RTC RestObjectBase(a_rThat)1070 : RTCRestObjectBase(a_rThat) 1071 , RTCString(a_rThat) 1042 1072 { 1043 1073 } … … 1053 1083 /** From value constructor. */ 1054 1084 RTCRestString::RTCRestString(const char *a_pszSrc) 1055 : RTC String(a_pszSrc)1056 , RTC RestObjectBase()1085 : RTCRestObjectBase() 1086 , RTCString(a_pszSrc) 1057 1087 { 1058 1088 } … … 1093 1123 m_fNullIndicator = true; 1094 1124 return VINF_SUCCESS; 1125 } 1126 1127 1128 RTCRestObjectBase *RTCRestString::baseClone() const 1129 { 1130 RTCRestString *pClone = new (std::nothrow) RTCRestString(); 1131 if (pClone) 1132 { 1133 int rc = pClone->assignCopy(*this); 1134 if (RT_SUCCESS(rc)) 1135 return pClone; 1136 delete pClone; 1137 } 1138 return NULL; 1095 1139 } 1096 1140 … … 1366 1410 m_enmFormat = a_rThat.m_enmFormat; 1367 1411 return m_strFormatted.assignNoThrow(a_rThat.m_strFormatted); 1412 } 1413 1414 1415 RTCRestObjectBase *RTCRestDate::baseClone() const 1416 { 1417 RTCRestDate *pClone = new (std::nothrow) RTCRestDate(); 1418 if (pClone) 1419 { 1420 int rc = pClone->assignCopy(*this); 1421 if (RT_SUCCESS(rc)) 1422 return pClone; 1423 delete pClone; 1424 } 1425 return NULL; 1368 1426 } 1369 1427 … … 2010 2068 2011 2069 2070 RTCRestObjectBase *RTCRestStringEnumBase::cloneWorker(RTCRestStringEnumBase *a_pDst) const 2071 { 2072 if (a_pDst) 2073 { 2074 int rc = a_pDst->assignCopy(*this); 2075 if (RT_SUCCESS(rc)) 2076 return a_pDst; 2077 delete a_pDst; 2078 } 2079 return NULL; 2080 } 2081 2082 2012 2083 2013 2084 /********************************************************************************************************************************* … … 2170 2241 } 2171 2242 2243 2244 2245 /********************************************************************************************************************************* 2246 * RTCRestPolyDataObject * 2247 *********************************************************************************************************************************/ 2248 2249 RTCRestPolyDataObject::RTCRestPolyDataObject() 2250 : RTCRestDataObject() 2251 { 2252 } 2253 2254 2255 RTCRestPolyDataObject::RTCRestPolyDataObject(RTCRestPolyDataObject const &a_rThat) 2256 : RTCRestDataObject(a_rThat) 2257 { 2258 } 2259 2260 2261 RTCRestPolyDataObject::~RTCRestPolyDataObject() 2262 { 2263 } 2264 2265 2266 int RTCRestPolyDataObject::resetToDefault() 2267 { 2268 return RTCRestDataObject::resetToDefault(); 2269 } 2270 2271 2272 bool RTCRestPolyDataObject::isChild() const 2273 { 2274 return false; 2275 } 2276 2277 2278 RTCRestPolyDataObject &RTCRestPolyDataObject::operator=(RTCRestPolyDataObject const &a_rThat) 2279 { 2280 RTCRestDataObject::operator=(a_rThat); 2281 return *this; 2282 } 2283
Note:
See TracChangeset
for help on using the changeset viewer.