File indexing completed on 2026-06-12 08:32:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _StdObjMgt_Persistent_HeaderFile
0015 #define _StdObjMgt_Persistent_HeaderFile
0016
0017 #include <Standard.hxx>
0018 #include <Standard_Handle.hxx>
0019 #include <Standard_Transient.hxx>
0020 #include <NCollection_Sequence.hxx>
0021
0022 #include <TDF_Label.hxx>
0023
0024 class StdObjMgt_ReadData;
0025 class StdObjMgt_WriteData;
0026 class TDocStd_Document;
0027 class TDF_Attribute;
0028 class TDF_Data;
0029 class TCollection_HAsciiString;
0030 class TCollection_HExtendedString;
0031
0032
0033
0034 class StdObjMgt_Persistent : public Standard_Transient
0035 {
0036 public:
0037 Standard_EXPORT StdObjMgt_Persistent();
0038
0039
0040 typedef Handle(StdObjMgt_Persistent) (*Instantiator)();
0041
0042
0043 template <class Persistent>
0044 static Handle(StdObjMgt_Persistent) Instantiate()
0045 {
0046 return new Persistent;
0047 }
0048
0049
0050 virtual void Read(StdObjMgt_ReadData& theReadData) = 0;
0051
0052
0053 virtual void Write(StdObjMgt_WriteData& theWriteData) const = 0;
0054
0055 typedef NCollection_Sequence<Handle(StdObjMgt_Persistent)> SequenceOfPersistent;
0056
0057
0058 virtual void PChildren(SequenceOfPersistent&) const = 0;
0059
0060
0061 virtual Standard_CString PName() const = 0;
0062
0063
0064
0065
0066 Standard_EXPORT virtual void ImportDocument(const Handle(TDocStd_Document)& theDocument) const;
0067
0068
0069
0070
0071 Standard_EXPORT virtual Handle(TDF_Attribute) CreateAttribute();
0072
0073
0074
0075
0076 Standard_EXPORT virtual Handle(TDF_Attribute) GetAttribute() const;
0077
0078
0079
0080
0081 Standard_EXPORT virtual void ImportAttribute();
0082
0083
0084
0085
0086 Standard_EXPORT virtual Handle(TCollection_HAsciiString) AsciiString() const;
0087
0088
0089
0090
0091 Standard_EXPORT virtual Handle(TCollection_HExtendedString) ExtString() const;
0092
0093
0094
0095
0096 Standard_EXPORT virtual TDF_Label Label(const Handle(TDF_Data)& theDF) const;
0097
0098
0099 Standard_Integer TypeNum() const { return myTypeNum; }
0100
0101
0102 void TypeNum(Standard_Integer theTypeNum) { myTypeNum = theTypeNum; }
0103
0104
0105 Standard_Integer RefNum() const { return myRefNum; }
0106
0107
0108 void RefNum(Standard_Integer theRefNum) { myRefNum = theRefNum; }
0109
0110 private:
0111 Standard_Integer myTypeNum;
0112 Standard_Integer myRefNum;
0113 };
0114
0115 #endif