File indexing completed on 2025-01-18 10:05:00
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
0018 #include <Standard.hxx>
0019 #include <Standard_Handle.hxx>
0020 #include <Standard_Transient.hxx>
0021 #include <NCollection_Sequence.hxx>
0022
0023 #include <TDF_Label.hxx>
0024
0025 class StdObjMgt_ReadData;
0026 class StdObjMgt_WriteData;
0027 class TDocStd_Document;
0028 class TDF_Attribute;
0029 class TDF_Data;
0030 class TCollection_HAsciiString;
0031 class TCollection_HExtendedString;
0032
0033
0034
0035
0036 class StdObjMgt_Persistent : public Standard_Transient
0037 {
0038 public:
0039 Standard_EXPORT StdObjMgt_Persistent();
0040
0041
0042 typedef Handle(StdObjMgt_Persistent) (*Instantiator)();
0043
0044
0045 template <class Persistent>
0046 static Handle(StdObjMgt_Persistent) Instantiate()
0047 { return new Persistent; }
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
0067 (const Handle(TDocStd_Document)& theDocument) const;
0068
0069
0070
0071
0072 Standard_EXPORT virtual Handle(TDF_Attribute) CreateAttribute();
0073
0074
0075
0076
0077 Standard_EXPORT virtual Handle(TDF_Attribute) GetAttribute() const;
0078
0079
0080
0081
0082 Standard_EXPORT virtual void ImportAttribute();
0083
0084
0085
0086
0087 Standard_EXPORT virtual Handle(TCollection_HAsciiString) AsciiString() const;
0088
0089
0090
0091
0092 Standard_EXPORT virtual Handle(TCollection_HExtendedString) ExtString() const;
0093
0094
0095
0096
0097 Standard_EXPORT virtual TDF_Label Label (const Handle(TDF_Data)& theDF) const;
0098
0099
0100 Standard_Integer TypeNum() const { return myTypeNum; }
0101
0102
0103 void TypeNum(Standard_Integer theTypeNum) { myTypeNum = theTypeNum; }
0104
0105
0106 Standard_Integer RefNum() const { return myRefNum; }
0107
0108
0109 void RefNum(Standard_Integer theRefNum) { myRefNum = theRefNum; }
0110
0111 private:
0112 Standard_Integer myTypeNum;
0113 Standard_Integer myRefNum;
0114 };
0115
0116 #endif