File indexing completed on 2026-09-19 09:29:56
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _XmlMDF_DerivedDriver_HeaderFile
0015 #define _XmlMDF_DerivedDriver_HeaderFile
0016
0017 #include <XmlMDF_ADriver.hxx>
0018 #include <TDF_DerivedAttribute.hxx>
0019
0020
0021
0022 class XmlMDF_DerivedDriver : public XmlMDF_ADriver
0023 {
0024 DEFINE_STANDARD_RTTIEXT(XmlMDF_DerivedDriver, XmlMDF_ADriver)
0025 public:
0026
0027
0028
0029
0030 XmlMDF_DerivedDriver(const occ::handle<TDF_Attribute>& theDerivative,
0031 const occ::handle<XmlMDF_ADriver>& theBaseDriver)
0032 : XmlMDF_ADriver(theBaseDriver->MessageDriver(), theBaseDriver->Namespace().ToCString()),
0033 myDerivative(theDerivative),
0034 myBaseDirver(theBaseDriver)
0035 {
0036 }
0037
0038
0039 occ::handle<TDF_Attribute> NewEmpty() const override { return myDerivative->NewEmpty(); }
0040
0041
0042 const TCollection_AsciiString& TypeName() const
0043 {
0044 const TCollection_AsciiString& aRegistered =
0045 TDF_DerivedAttribute::TypeName(myDerivative->DynamicType()->Name());
0046 if (aRegistered.IsEmpty())
0047 {
0048 return XmlMDF_ADriver::TypeName();
0049 }
0050 return aRegistered;
0051 }
0052
0053
0054 bool Paste(const XmlObjMgt_Persistent& theSource,
0055 const occ::handle<TDF_Attribute>& theTarget,
0056 XmlObjMgt_RRelocationTable& theRelocTable) const override
0057 {
0058 bool aResult = myBaseDirver->Paste(theSource, theTarget, theRelocTable);
0059
0060 theTarget->AfterRetrieval();
0061
0062 return aResult;
0063 }
0064
0065
0066 void Paste(const occ::handle<TDF_Attribute>& theSource,
0067 XmlObjMgt_Persistent& theTarget,
0068 XmlObjMgt_SRelocationTable& theRelocTable) const override
0069 {
0070 myBaseDirver->Paste(theSource, theTarget, theRelocTable);
0071 }
0072
0073 protected:
0074 occ::handle<TDF_Attribute> myDerivative;
0075 occ::handle<XmlMDF_ADriver> myBaseDirver;
0076 };
0077
0078 #endif