b311480e |
1 | -- Created on: 1991-09-05 |
2 | -- Created by: J.P. TIRAUlt |
3 | -- Copyright (c) 1991-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
b311480e |
16 | |
7fd59977 |
17 | -- C. LEYNADIER |
18 | |
19 | package Standard |
20 | |
21 | ---Purpose: |
22 | -- The package Standard provides the minimum services necessary |
23 | -- for other toolkits to handle persistent and transient objects. |
24 | -- It is the Standard run-time encapsulation of the CAS.CADE |
25 | -- database, that is, it defines a single programming interface |
26 | -- for creating and accessing persistent objects manipulated by |
27 | -- handles. |
28 | |
29 | |
30 | is |
31 | enumeration InternalType is |
32 | Void, -- TYPUND 0x00000000 /* Undefined */ |
33 | Char, -- TYPIT1 0x00010001 /* Byte */ |
34 | ExtChar, -- TYPIT2 0x00020001 /* Integer*2 */ |
35 | LongInt, -- TYPIT4 0x00040001 /* Integer*4 */ |
36 | Bool, -- TYPLO4 0x00040002 /* Logical*4 */ |
37 | Float, -- TYPRE4 0x00040004 /* Real*4 */ |
38 | LongDouble, -- TYPRE8 0x00080004 /* Real*8 */ |
39 | String, -- TYPCHR 0x00000010 /* Character */ |
40 | EString, -- TYPCHREXT 0x00000011 /* Character */ |
41 | EntryAddress, -- TYPENT 0x00040020 /* Function address */ |
42 | DataAddress, -- TYPDAD 0x00040080 /* Data address */ |
43 | EngineHandle, -- TYPHDLE 0x00004000 /* Handle */ |
44 | Long64, -- TYPIT8 0x00080001 /* Integer*8 */ |
45 | Array; -- TYPARR 0x00008000 /* Tableau */ |
46 | |
47 | enumeration WayOfLife is IsNothing, IsAddress, IsTransient, IsPersistent, IsNotLoaded; |
48 | enumeration KindOfType is IsUnKnown, IsClass, IsEnumeration, IsPrimitive, IsImported, IsPackage; |
49 | enumeration HandlerStatus is HandlerVoid, HandlerJumped, HandlerProcessed; |
50 | |
51 | imported IStream; |
52 | imported OStream; |
53 | imported SStream; |
54 | imported UUID; |
55 | imported JmpBuf; |
56 | imported ThreadId; |
57 | |
58 | primitive CString; |
59 | primitive ExtString; |
60 | primitive Address; |
61 | primitive Size; |
62 | primitive PByte; |
63 | primitive PCharacter; |
64 | primitive PExtCharacter; |
65 | |
a174a3c5 |
66 | primitive Utf8Char; |
67 | primitive Utf16Char; |
68 | primitive Utf32Char; |
69 | primitive WideChar; |
70 | |
7fd59977 |
71 | deferred class ErrorHandlerCallback; |
72 | class ErrorHandler; |
73 | |
74 | class AncestorIterator; |
75 | |
76 | deferred class Storable ; |
6c3e4c29 |
77 | primitive Boolean inherits Storable; |
78 | primitive Character inherits Storable; |
7fd59977 |
79 | primitive ExtCharacter inherits Storable; |
80 | primitive Integer inherits Storable; |
6c3e4c29 |
81 | primitive Byte inherits Storable; |
7fd59977 |
82 | primitive Real inherits Storable; |
83 | primitive ShortReal inherits Storable; |
6c3e4c29 |
84 | primitive Time inherits Storable; |
85 | primitive OId inherits Storable; |
7fd59977 |
86 | |
87 | deferred class Persistent ; -- inherits Storable |
88 | class GUID; -- inherits Storable |
89 | |
90 | deferred class Transient ; |
91 | class Type; -- inherits Transient |
92 | class Failure; -- inherits Transient |
93 | exception AbortiveTransaction inherits Failure; |
94 | exception DomainError inherits Failure; |
95 | exception ConstructionError inherits DomainError; |
96 | exception NullObject inherits DomainError; |
97 | exception NoSuchObject inherits DomainError; |
98 | exception NoMoreObject inherits DomainError; |
99 | exception ImmutableObject inherits DomainError; |
100 | exception TypeMismatch inherits DomainError; |
101 | exception MultiplyDefined inherits DomainError; |
102 | exception DimensionError inherits DomainError; |
103 | exception DimensionMismatch inherits DimensionError; |
104 | exception RangeError inherits DomainError; |
105 | exception OutOfRange inherits RangeError; |
106 | exception NullValue inherits RangeError; |
107 | exception NegativeValue inherits RangeError; |
108 | exception NumericError inherits Failure; |
109 | exception Underflow inherits NumericError; |
110 | exception Overflow inherits NumericError; |
111 | exception DivideByZero inherits NumericError; |
112 | exception ProgramError inherits Failure; |
113 | exception NotImplemented inherits ProgramError; |
114 | exception OutOfMemory inherits ProgramError; |
115 | exception LicenseError inherits Failure; |
116 | exception LicenseNotFound inherits LicenseError; |
117 | exception TooManyUsers inherits LicenseError; |
118 | |
119 | pointer PErrorHandler to ErrorHandler; |
120 | |
121 | |
122 | -- |
123 | -- Mutex: a class to synchronize access to shared data |
124 | -- from threads within one process |
125 | -- |
126 | imported Mutex; |
127 | |
128 | -- |
129 | -- Memory manager |
130 | -- |
131 | Allocate (aSize: Size from Standard) |
132 | returns Address from Standard; |
133 | ---Purpose: Allocates memory blocks |
134 | -- aSize - bytes to allocate |
135 | |
547702a1 |
136 | Free (aStorage: Address from Standard); |
137 | ---Purpose: Deallocates memory blocks |
138 | -- aStorage - previously allocated memory block to be freed |
7fd59977 |
139 | |
547702a1 |
140 | ---C++: alias "template <typename T> static inline void Free (T*& thePtr) { Free ((void*)thePtr); thePtr = 0; }" |
141 | |
142 | Reallocate(aStorage: Address from Standard; |
7fd59977 |
143 | aNewSize: Size from Standard) |
144 | returns Address from Standard; |
145 | ---Purpose: Reallocates memory blocks |
146 | -- aStorage - previously allocated memory block |
147 | -- aNewSize - new size in bytes |
acc62560 |
148 | |
149 | AllocateAligned (theSize : Size from Standard; |
150 | theAlign : Size from Standard) |
151 | returns Address from Standard; |
152 | ---Purpose: Allocates aligned memory blocks. |
153 | -- Should be used with CPU instructions which require specific alignment. |
154 | -- For example: SSE requires 16 bytes, AVX requires 32 bytes. |
155 | -- @param theSize bytes to allocate |
156 | -- @param theAlign alignment in bytes |
157 | |
158 | FreeAligned (thePtrAligned : Address from Standard); |
159 | ---Purpose: Deallocates memory blocks |
160 | -- @param thePtrAligned the memory block previously allocated with AllocateAligned() |
161 | ---C++: alias "template <typename T> static inline void FreeAligned (T*& thePtrAligned) { FreeAligned ((void* )thePtrAligned); thePtrAligned = 0; }" |
162 | |
7fd59977 |
163 | Purge returns Integer from Standard; |
164 | ---Purpose: Deallocates the storage retained on the free list |
165 | -- and clears the list. |
166 | -- Returns non-zero if some memory has been actually freed. |
167 | |
7fd59977 |
168 | end Standard; |