blob: 3efb71f1ad84cbfdb266633f165511055538e2f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
-- File: PMMgt_PManaged.cdl
-- Created: Tue Oct 13 17:34:48 1992
-- Author: Ramin BARRETO
-- <rba@sdsun4>
---Copyright: Matra Datavision 1992
deferred class PManaged from PMMgt
inherits Persistent from Standard
---Purpose:
-- The class <PManaged> is a persistent abstract class that
-- provides a strategy for managing the necessary storage
-- for an instance of <PManaged>. The storage is taken from
-- Persistent cache.
--
-- The storage of an instance is returned to persistent cache
-- when the instance is deleted explicitly.
--
-- The persistent classes like the persistent nodes benefit from
-- the "PManaged" allocator if they inherit from <PManaged>.
--
-- Warning:
-- The only way to delete explicitly an instance of <PManaged> is
-- to apply the method "Delete()" to a "Handle(PManaged)".
-- Exemple:
-- Handle(PManaged) aHand ;
-- ...
-- aHand.Delete();
--
uses
Integer from Standard
raises
OutOfMemory from Standard
is
--New(myclass; aSize: Integer) returns PManaged
---Purpose:
-- Returns an instance. The storage of the given "size" is
-- allocated by <StorageManager>.
--
--raises
-- OutOfMemory;
-- -- If the allocation fails.
-- -C++: alias "void* operator new (size_t);"
---Level: Advanced
--Delete(myclass; aInstance: PManaged; aSize: Integer);
---Purpose:
-- Returns the storage of the given size to the <StorageManager>.
-- The application using "Delete" must guarantee that the
-- instance is not shared.
--
-- -C++: alias "void operator delete (void*, size_t);"
---Level: Advanced
--Destructor(me);
---Purpose:
-- The virtual Destructor for the class "PManaged". This
-- declaration is necessary for the C++ compiler to
-- generate a call to "operator delete" with the real size
-- of the object.
--
-- -C+..+: alias "virtual ~PMMgt_PManaged();"
---Level: Advanced
Initialize ;
end PManaged from PMMgt;
|