1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
+
|
------------------------------------------------------------------------------
-- Copyright (c) 2013, Natacha Porté --
-- Copyright (c) 2013-2014, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
|
-- Create a new held object and return a reference to it
procedure Replace
(Ref : in out Immutable_Reference;
Constructor : not null access function return Held_Data);
-- Replace the object held in Ref with a newly created object
function Create
(Constructor : not null access function return Data_Access)
return Immutable_Reference;
-- Create a new held object and return a reference to it
function Create (Data : in Data_Access) return Immutable_Reference;
-- Create a new reference from Data.
-- From this point the referred object is owned by this
-- package and must NOT be freed or changed or accessed.
procedure Replace
(Ref : in out Immutable_Reference;
procedure Replace (Ref : in out Immutable_Reference; Data : in Data_Access);
-- Integrate Data into Ref.
Constructor : not null access function return Data_Access);
-- Replace the object held in Ref with a newly created object
-- From this point the referred object is owned by this
-- package and must NOT be freed or changed or accessed.
procedure Reset (Ref : in out Immutable_Reference);
-- Empty Ref
function Is_Empty (Ref : Immutable_Reference) return Boolean;
-- Check whether Ref refers to an actual object
|