0031075: Application Framework - reading STEP file into TDocStd_Document leads to...
[occt.git] / src / TDocStd / TDocStd_XLinkRoot.hxx
CommitLineData
42cf5bc1 1// Created by: DAUTRY Philippe
2// Copyright (c) 1997-1999 Matra Datavision
3// Copyright (c) 1999-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _TDocStd_XLinkRoot_HeaderFile
17#define _TDocStd_XLinkRoot_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_Type.hxx>
21
22#include <TDocStd_XLinkPtr.hxx>
23#include <TDF_Attribute.hxx>
24#include <Standard_OStream.hxx>
25class TDocStd_XLinkIterator;
26class Standard_GUID;
27class TDF_Data;
28class TDF_Attribute;
29class TDF_RelocationTable;
30
31
32class TDocStd_XLinkRoot;
33DEFINE_STANDARD_HANDLE(TDocStd_XLinkRoot, TDF_Attribute)
34
35//! This attribute is the root of all external
36//! references contained in a Data from TDF. Only one
37//! instance of this class is added to the TDF_Data
38//! root label. Starting from this attribute all the
39//! Reference are linked together, to be found
40//! easely.
41class TDocStd_XLinkRoot : public TDF_Attribute
42{
43
44public:
45
46
47 //! Returns the ID: 2a96b61d-ec8b-11d0-bee7-080009dc3333
48 Standard_EXPORT static const Standard_GUID& GetID();
49
50 //! Sets an empty XLinkRoot to Root or gets the
51 //! existing one. Only one attribute per TDF_Data.
52 Standard_EXPORT static Handle(TDocStd_XLinkRoot) Set (const Handle(TDF_Data)& aDF);
53
54 //! Inserts <anXLinkPtr> at the beginning of the XLink chain.
55 Standard_EXPORT static void Insert (const TDocStd_XLinkPtr& anXLinkPtr);
56
57 //! Removes <anXLinkPtr> from the XLink chain, if it exists.
58 Standard_EXPORT static void Remove (const TDocStd_XLinkPtr& anXLinkPtr);
59
60 //! Returns the ID of the attribute.
61 Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
62
63 //! Returns a null handle.
64 Standard_EXPORT Handle(TDF_Attribute) BackupCopy() const Standard_OVERRIDE;
65
66 //! Does nothing.
67 Standard_EXPORT void Restore (const Handle(TDF_Attribute)& anAttribute) Standard_OVERRIDE;
68
69 //! Returns a null handle.
70 Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
71
72 //! Does nothing.
73 Standard_EXPORT void Paste (const Handle(TDF_Attribute)& intoAttribute, const Handle(TDF_RelocationTable)& aRelocationTable) const Standard_OVERRIDE;
74
75 //! Dumps the attribute on <aStream>.
76 Standard_EXPORT Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
77
78
79friend class TDocStd_XLinkIterator;
80
81
92efcf78 82 DEFINE_STANDARD_RTTIEXT(TDocStd_XLinkRoot,TDF_Attribute)
42cf5bc1 83
84protected:
85
86
87
88
89private:
90
91
92 //! Initializes fields.
93 Standard_EXPORT TDocStd_XLinkRoot();
94
95 //! Sets the field <myFirst> with <anXLinkPtr>.
96 void First (const TDocStd_XLinkPtr& anXLinkPtr);
97
98 //! Returns the contents of the field <myFirst>.
99 TDocStd_XLinkPtr First() const;
100
101 TDocStd_XLinkPtr myFirst;
102
103
104};
105
106
107#include <TDocStd_XLinkRoot.lxx>
108
109
110
111
112
113#endif // _TDocStd_XLinkRoot_HeaderFile