b311480e |
1 | // Copyright (c) 1998-1999 Matra Datavision |
973c2be1 |
2 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
3 | // |
973c2be1 |
4 | // This file is part of Open CASCADE Technology software library. |
b311480e |
5 | // |
d5f74e42 |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
11 | // |
973c2be1 |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
7fd59977 |
14 | |
7fd59977 |
15 | #include <Standard_Persistent.hxx> |
16 | |
17 | #include <Standard_Failure.hxx> |
18 | #include <Standard_NullObject.hxx> |
19 | #include <Standard_RangeError.hxx> |
20 | #include <Standard_ImmutableObject.hxx> |
21 | #include <Standard_TypeMismatch.hxx> |
22 | #include <Standard_NotImplemented.hxx> |
23 | #include <Standard_Type.hxx> |
24 | |
7fd59977 |
25 | // The Initialization of the Standard_Persistent variables |
857ffd5e |
26 | const Handle(Standard_Type)& Standard_Persistent_Type_() |
7fd59977 |
27 | { |
857ffd5e |
28 | static const Handle(Standard_Type) _Ancestors[]={NULL}; |
29 | static Handle(Standard_Type) _aType |
7fd59977 |
30 | = new Standard_Type("Standard_Persistent", |
31 | sizeof(Standard_Persistent), |
32 | 0, |
33 | (Standard_Address) _Ancestors, |
34 | NULL); |
35 | |
36 | return _aType; |
37 | } |
38 | |
39 | // |
40 | // The Standard_Persistent Methods |
41 | // |
42 | |
43 | // The Method This |
44 | // |
857ffd5e |
45 | Handle(Standard_Persistent) Standard_Persistent::This() const |
7fd59977 |
46 | { |
857ffd5e |
47 | Handle(Standard_Persistent) aHand(this); |
7fd59977 |
48 | |
49 | return aHand; |
50 | } |
51 | |
7fd59977 |
52 | // Empty Destructor |
53 | // |
54 | Standard_Persistent::~Standard_Persistent() |
55 | { |
56 | } |
57 | |
7fd59977 |
58 | // Operator= with a Standard_Persistent |
59 | // |
60 | Standard_Persistent& Standard_Persistent::operator=(const Standard_Persistent& ) |
61 | { |
62 | return *this; |
63 | } |
64 | |
65 | // |
66 | // |
67 | Standard_Boolean Standard_Persistent::IsInstance(const Handle(Standard_Type) |
68 | &AType) const |
69 | { |
70 | return (Standard_Boolean) (AType == DynamicType()); |
71 | } |
72 | |
73 | // |
74 | // |
75 | const Handle(Standard_Type)& Standard_Persistent::DynamicType () const |
76 | { |
77 | return STANDARD_TYPE(Standard_Persistent); |
78 | } |
79 | |
80 | // |
81 | // |
82 | Standard_Boolean Standard_Persistent::IsKind (const Handle(Standard_Type)& aType) const |
83 | { |
84 | return DynamicType()->SubType ( aType ); |
85 | // return (aType == STANDARD_TYPE(Standard_Persistent)); |
86 | } |
87 | |
7fd59977 |
88 | void Standard_Persistent::Delete() const |
89 | { |
90 | delete((Standard_Persistent *)this); |
91 | } |
92 | |
93 | const Handle(Standard_Persistent) Handle(Standard_Persistent)::DownCast(const Handle(Standard_Persistent)& AnObject) |
94 | { |
95 | Handle(Standard_Persistent) _anOtherObject; |
96 | |
97 | if (!AnObject.IsNull()) |
98 | if (AnObject->IsKind(STANDARD_TYPE(Standard_Persistent))) |
99 | { |
100 | _anOtherObject = Handle(Standard_Persistent)((Handle(Standard_Persistent)&)AnObject); |
101 | } |
102 | |
103 | return _anOtherObject ; |
104 | } |
105 | |
106 | Handle(Standard_Persistent)::~Handle(Standard_Persistent)() |
107 | { |
108 | EndScope(); |
109 | } |
110 | |
857ffd5e |
111 | void Handle(Standard_Persistent)::RaiseNullObject(const Standard_CString S) const |
7fd59977 |
112 | { |
113 | Standard_NullObject::Raise(S); |
114 | } |
115 | |
116 | void Handle(Standard_Persistent)::Dump(Standard_OStream& out) const |
117 | { |
118 | out << ControlAccess(); |
119 | } |
120 | |
121 | |