1 -- Created on: 1991-09-06
2 -- Created by: jean pierre TIRAULT
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Type from Standard
20 -- The class <Type> provides services to find out information
21 -- about a type defined in CDL.
23 -- Note that multiple inheritance is not supported by the moment;
24 -- the array of ancestors accepted by constructors is assumed to
25 -- represent hierarchy of ancestors up to the root.
26 -- However, only first element is actually used by SubType method,
27 -- higher level ancestors are requested recursively.
30 -- The information given by <Type> is about the type from which
31 -- it is created and not about the <Type> itself.
35 Transient from Standard
38 Boolean from Standard,
39 Integer from Standard,
40 CString from Standard,
41 KindOfType from Standard,
42 AncestorIterator from Standard
45 TypeMismatch from Standard,
46 NoSuchObject from Standard,
47 OutOfRange from Standard
51 ---------------------------------------------------------------------
52 ---Category: The general information about a type.
53 ---------------------------------------------------------------------
55 Name(me) returns CString;
57 -- Returns the type name of <me>.
60 Size(me) returns Integer;
62 -- Returns the size of <me> in bytes.
65 ---------------------------------------------------------------------
66 ---Category: The Constructor of Type
67 ---------------------------------------------------------------------
68 Create(aName : CString;
71 -- The constructor for a imported type.
75 Create(aName : CString;
77 aNumberOfParent : Integer;
80 -- The constructor for a primitive.
84 Create(aName : CString;
86 aNumberOfElement: Integer;
87 aNumberOfParent : Integer;
88 anAncestors : Address;
91 -- The constructor for an enumeration.
95 Create(aName : CString;
97 aNumberOfParent : Integer;
98 anAncestors : Address;
101 -- The constructor for a class.
105 ---------------------------------------------------------------------
106 ---Category: Comparison between types
107 ---------------------------------------------------------------------
108 SubType(me; aOther: Type) returns Boolean;
110 -- Returns "True", if <me> is the same as <aOther>,
111 -- or inherits from <aOther>.
112 -- Note that multiple inheritance is not supported.
115 SubType(me; theName: CString) returns Boolean;
117 -- Returns "True", if <me> or one of its ancestors has the name
119 -- Note that multiple inheritance is not supported.
122 ---------------------------------------------------------------------
123 ---Category: Information about nature of the type.
124 ---------------------------------------------------------------------
126 IsImported(me) returns Boolean;
128 -- Returns "True", if the type is imported.
131 IsPrimitive(me) returns Boolean;
133 -- Returns "True", if the type is a primitive.
136 IsEnumeration(me) returns Boolean;
138 -- Returns "True", if the type is an "Enumeration".
141 IsClass(me) returns Boolean;
143 -- Returns "True", if the type is a "Class".
146 ---------------------------------------------------------------------
147 ---Category: The information about the ancestors of a type.
148 ---------------------------------------------------------------------
150 NumberOfParent(me) returns Integer;
152 -- Returns the number of direct parents of the class.
156 NumberOfAncestor(me) returns Integer;
158 -- Returns the number of ancestors of the class.
162 Ancestors(me) returns Address is private;
164 -- Returns the address of the ancestors array. It can be used only by
168 Print (me; s: in out OStream);
170 -- Prints on the stream <s> the name of Type.
172 -- The operator "OStream& operator<< (Standard_OStream&,
173 -- Handle(Standard_Type)&)"
174 -- is implemented. (This operator uses the method Print)
177 ---C++: alias "Standard_EXPORT void operator<<(Standard_OStream& s) const { Print(s); } "
179 InLineDummy(me) is static private;
191 myNumberOfParent : Integer;
192 myNumberOfAncestor : Integer;
193 myAncestors : Address;
197 class AncestorIterator from Standard
199 end Type from Standard;