Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: |
Timelines: |
family
| ancestors
| descendants
| both
| trunk
|
Files: |
files
| file ages
| folders
|
SHA1: |
c104c5befa28f534a34eae20996c774bd23c2827 |
User & Date: |
nat
2014-07-11 20:37:15 |
Context
2014-07-12
| | |
16:08 |
|
check-in: 2d7c2f8e09 user: nat tags: trunk
|
2014-07-11
| | |
20:37 |
|
check-in: c104c5befa user: nat tags: trunk
|
2014-07-10
| | |
18:27 |
|
check-in: 55bbe4642d user: nat tags: trunk
|
| | |
Changes
Changes to src/natools-references.adb.
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 --
|
︙ | | |
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
-
-
-
+
+
+
+
-
-
-
+
+
+
+
-
+
+
+
-
-
+
+
+
|
begin
Finalize (Ref);
Ref.Data := new Held_Data'(Constructor.all);
Ref.Count := new Counter'(1);
end Replace;
function Create
(Constructor : not null access function return Data_Access)
return Immutable_Reference is
function Create (Data : in Data_Access) return Immutable_Reference is
begin
if Data = null then
return Null_Immutable_Reference;
else
return (Ada.Finalization.Controlled with
Data => Constructor.all,
Count => new Counter'(1));
return (Ada.Finalization.Controlled with
Data => Data,
Count => new Counter'(1));
end if;
end Create;
procedure Replace
(Ref : in out Immutable_Reference;
Constructor : not null access function return Data_Access) is
Data : in Data_Access) is
begin
Finalize (Ref);
if Data /= null then
Ref.Data := Constructor.all;
Ref.Count := new Counter'(1);
Ref.Data := Data;
Ref.Count := new Counter'(1);
end if;
end Replace;
procedure Reset (Ref : in out Immutable_Reference) is
begin
Finalize (Ref);
end Reset;
|
︙ | | |
Changes to src/natools-references.ads.
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
|
︙ | | |