AdaCL: Shared smart pointer.
More...Instance_Access |
Instance_Type |
Object |
Adjust | |
Create | |
Exist | |
Finalize | |
Get | |
Initialize | |
Object_Image | |
Reset | |
Swap | |
Unique | |
Use_Count |
Smart pointer with which can share an access. The referenced element is deleted when the last reference is removed. Element_Type the element which are handled by the pointer Pointer Access to the element type Deleter function to delete an element instance
107 | type Instance_Access is access Instance_Type; |
---|
Self referencing type consisting of three components: type of the self reference
102 | type Instance_Type; |
---|
Self referencing type consisting of three components: This component holds the actual data. Details in the body.
44 | type Object is new AdaCL.Base.Object with private; |
---|
A Pointer to an unique element.
Inherits Object
Inherited by Object
130 | overriding procedure Adjust (This : in out Object); |
---|
When asjusting we need hand over the pointer
Object itself.
51 | function Create (Referent : in Pointer := null) return Object; |
---|
Creates a new unique smart pointer from normal pointer.
Pointer to reference counted object
New smart pointer
58 | function Exist (This : in Object) return Boolean with |
---|---|
59 | Pure_Function, Inline; |
Checks if a pointers is set
Object itself.
true when pointer is not null
136 | overriding procedure Finalize (This : in out Object); |
---|
When finalizing we need delete the pointer
Object itself.
66 | function Get (This : in Object) return not null Pointer with |
---|---|
67 | Inline, Pre => (This.Exist), Post => (Get'Result /= null); |
gets pointer to element to perform operations on. Do not save the pointer.
Object itself.
pointer to element
124 | overriding procedure Initialize (This : in out Object); |
---|
Called when creating an object
Object itself.
118 | procedure Object_Image (Output : in out Ada.Strings.Text_Buffers.Root_Buffer_Type'Class; This : Object); |
---|
74 | procedure Reset (This : in out Object; Referent : in Pointer := null); |
---|
Replaces the managed object.
Object itself.
new pointer to manage
81 | procedure Swap (This : in out Object; Other : in out Object); |
---|
swaps the managed objects
Object itself.
Object to swap Referents with
94 | function Unique (This : in Object) return Boolean with |
---|---|
95 | Inline, Post => (This.Use_Count /= 1 xor Unique'Result); |
checks whether the managed object is managed only by the current shared_ptr instance
true when use counter is one.
87 | function Use_Count (This : in Object) return Natural with |
---|---|
88 | Inline, Post => (This.Exist xor Use_Count'Result = 0); |
returns the number of shared_ptr objects referring to the same managed object.
use count