Natools

Diff
Login

Differences From Artifact [ced30f8c32]:

To Artifact [9b02b7f3d7]:


70
71
72
73
74
75
76




















77
78
79
80
81
82
83
70
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







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







      Constructor : not null access function return Held_Data) is
   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
   begin
      return (Ada.Finalization.Controlled with
         Data => Constructor.all,
         Count => new Counter'(1));
   end Create;


   procedure Replace
     (Ref : in out Immutable_Reference;
      Constructor : not null access function return Data_Access) is
   begin
      Finalize (Ref);
      Ref.Data := Constructor.all;
      Ref.Count := new Counter'(1);
   end Replace;


   procedure Reset (Ref : in out Immutable_Reference) is
   begin
      Finalize (Ref);
   end Reset;