File indexing completed on 2025-01-18 10:05:35
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 XmlMDF_DerivedDriver (const Handle(TDF_Attribute)& theDerivative,
0030 const Handle(XmlMDF_ADriver)& theBaseDriver)
0031 : XmlMDF_ADriver (theBaseDriver->MessageDriver(), theBaseDriver->Namespace().ToCString()),
0032 myDerivative (theDerivative),
0033 myBaseDirver(theBaseDriver) {}
0034
0035
0036 virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE { return myDerivative->NewEmpty(); }
0037
0038
0039 const TCollection_AsciiString& TypeName() const
0040 {
0041 const TCollection_AsciiString& aRegistered = TDF_DerivedAttribute::TypeName (myDerivative->DynamicType()->Name());
0042 if (aRegistered.IsEmpty())
0043 {
0044 return XmlMDF_ADriver::TypeName();
0045 }
0046 return aRegistered;
0047 }
0048
0049
0050 virtual Standard_Boolean Paste (const XmlObjMgt_Persistent& theSource,
0051 const Handle(TDF_Attribute)& theTarget,
0052 XmlObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE
0053 {
0054 Standard_Boolean aResult = myBaseDirver->Paste (theSource, theTarget, theRelocTable);
0055 theTarget->AfterRetrieval();
0056 return aResult;
0057 }
0058
0059
0060 virtual void Paste (const Handle(TDF_Attribute)& theSource,
0061 XmlObjMgt_Persistent& theTarget,
0062 XmlObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE
0063 {
0064 myBaseDirver->Paste (theSource, theTarget, theRelocTable);
0065 }
0066
0067 protected:
0068 Handle(TDF_Attribute) myDerivative;
0069 Handle(XmlMDF_ADriver) myBaseDirver;
0070 };
0071
0072 #endif