Changeset 74387 in vbox for trunk/include/iprt/cpp/restbase.h
- Timestamp:
- Sep 20, 2018 3:51:35 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 125208
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/restbase.h
r74347 r74387 265 265 266 266 /** 267 * Create a copy of this object. 268 * 269 * @returns Pointer to copy. 270 */ 271 virtual RTCRestObjectBase *baseClone() const = 0; 272 273 /** 267 274 * Tests if the object is @a null. 268 275 * @returns true if null, false if not. … … 421 428 /** Assign value and clear null indicator. */ 422 429 void assignValue(bool a_fValue); 430 /** Make a clone of this object. */ 431 inline RTCRestBool *clone() const { return (RTCRestBool *)baseClone(); } 423 432 424 433 /* Overridden methods: */ 434 virtual RTCRestObjectBase *baseClone() const RT_OVERRIDE; 425 435 virtual int resetToDefault() RT_OVERRIDE; 426 436 virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE; … … 461 471 /** Assign value and clear null indicator. */ 462 472 void assignValue(int64_t a_iValue); 473 /** Make a clone of this object. */ 474 inline RTCRestInt64 *clone() const { return (RTCRestInt64 *)baseClone(); } 463 475 464 476 /* Overridden methods: */ 477 virtual RTCRestObjectBase *baseClone() const RT_OVERRIDE; 465 478 virtual int resetToDefault() RT_OVERRIDE; 466 479 virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE; … … 501 514 /** Assign value and clear null indicator. */ 502 515 void assignValue(int32_t a_iValue); 516 /** Make a clone of this object. */ 517 inline RTCRestInt32 *clone() const { return (RTCRestInt32 *)baseClone(); } 503 518 504 519 /* Overridden methods: */ 520 virtual RTCRestObjectBase *baseClone() const RT_OVERRIDE; 505 521 virtual int resetToDefault() RT_OVERRIDE; 506 522 virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE; … … 541 557 /** Assign value and clear null indicator. */ 542 558 void assignValue(int16_t a_iValue); 559 /** Make a clone of this object. */ 560 inline RTCRestInt16 *clone() const { return (RTCRestInt16 *)baseClone(); } 543 561 544 562 /* Overridden methods: */ 563 virtual RTCRestObjectBase *baseClone() const RT_OVERRIDE; 545 564 virtual int resetToDefault() RT_OVERRIDE; 546 565 virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE; … … 581 600 /** Assign value and clear null indicator. */ 582 601 void assignValue(double a_rdValue); 602 /** Make a clone of this object. */ 603 inline RTCRestDouble *clone() const { return (RTCRestDouble *)baseClone(); } 583 604 584 605 /* Overridden methods: */ 606 virtual RTCRestObjectBase *baseClone() const RT_OVERRIDE; 585 607 virtual int resetToDefault() RT_OVERRIDE; 586 608 virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE; … … 604 626 * Class wrapping 'RTCString'. 605 627 */ 606 class RT_DECL_CLASS RTCRestString : public RTC String, public RTCRestObjectBase628 class RT_DECL_CLASS RTCRestString : public RTCRestObjectBase, public RTCString 607 629 { 608 630 public: … … 624 646 /** Safe copy assignment method. */ 625 647 int assignCopy(const char *a_pszThat); 648 /** Make a clone of this object. */ 649 inline RTCRestString *clone() const { return (RTCRestString *)baseClone(); } 626 650 627 651 /* Overridden methods: */ 652 virtual RTCRestObjectBase *baseClone() const RT_OVERRIDE; 628 653 virtual int setNull(void) RT_OVERRIDE; /* (ambigious, so overrider it to make sure.) */ 629 654 virtual int resetToDefault() RT_OVERRIDE; … … 688 713 /** Safe copy assignment method. */ 689 714 int assignCopy(RTCRestDate const &a_rThat); 715 /** Make a clone of this object. */ 716 inline RTCRestDate *clone() const { return (RTCRestDate *)baseClone(); } 690 717 691 718 /* Overridden methods: */ 719 virtual RTCRestObjectBase *baseClone() const RT_OVERRIDE; 692 720 virtual int resetToDefault() RT_OVERRIDE; 693 721 virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE; … … 908 936 bool setWorker(int a_iEnumValue); 909 937 938 /** Helper for implementing RTCRestObjectBase::clone(). */ 939 RTCRestObjectBase *cloneWorker(RTCRestStringEnumBase *a_pDst) const; 940 910 941 /** 911 942 * Gets the mapping table. … … 949 980 inline size_t getSize() const { return m_cbData; } 950 981 982 /** Make a clone of this object. */ 983 inline RTCRestBinary *clone() const { return (RTCRestBinary *)baseClone(); } 984 951 985 /* Overridden methods: */ 986 virtual RTCRestObjectBase *baseClone() const RT_OVERRIDE; 952 987 virtual int setNull(void) RT_OVERRIDE; 953 988 virtual int resetToDefault(void) RT_OVERRIDE; … … 983 1018 984 1019 /** 985 * Abstract base class for REST data model objects.1020 * Abstract base class for REST data model classes. 986 1021 */ 987 1022 class RT_DECL_CLASS RTCRestDataObject : public RTCRestObjectBase … … 998 1033 virtual kTypeClass typeClass(void) const RT_OVERRIDE; 999 1034 1000 /** Safe copy assignment method. */1001 virtual int assignCopy(RTCRestDataObject const &a_rThat);1002 1003 1035 /** 1004 1036 * Serialize the members as JSON. … … 1028 1060 /** Copy assignment operator. */ 1029 1061 RTCRestDataObject &operator=(RTCRestDataObject const &a_rThat); 1062 1063 /** Safe copy assignment method. */ 1064 virtual int assignCopy(RTCRestDataObject const &a_rThat); 1065 }; 1066 1067 1068 /** 1069 * Abstract base class for polymorphic REST data model classes. 1070 */ 1071 class RT_DECL_CLASS RTCRestPolyDataObject : public RTCRestDataObject 1072 { 1073 public: 1074 RTCRestPolyDataObject(); 1075 RTCRestPolyDataObject(RTCRestPolyDataObject const &a_rThat); 1076 virtual ~RTCRestPolyDataObject(); 1077 1078 /* Overridden methods:*/ 1079 virtual int resetToDefault() RT_OVERRIDE; 1080 1081 /** Checks if the instance is of a child class (@c true) or of the parent (@c false). */ 1082 virtual bool isChild() const; 1083 1084 protected: 1085 1086 /** Copy assignment operator. */ 1087 RTCRestPolyDataObject &operator=(RTCRestPolyDataObject const &a_rThat); 1030 1088 }; 1031 1089
Note:
See TracChangeset
for help on using the changeset viewer.