AdaCL: Unique smart pointer.
More...Instance_Access |
Instance_Type |
Object |
Adjust | |
Create | |
Exist | |
Finalize | |
Get | |
Initialize | |
Object_Image | |
Release | |
Reset | |
Swap |
Smart pointer with handover mechanism. Only one Unique pointer points to the referenced access. The referenced element is deleted when the unique pointer is deleted. At handover the original is set null. Element_Type the element which are handled by the pointer Pointer Access to the element type Deleter function to delete an element instance
102 | type Instance_Access is access Instance_Type; |
---|
Self referencing type consisting of three components: type of the self reference
97 | type Instance_Type; |
---|
Self referencing type consisting of three components: This component holds the actual data. Details in the body.
45 | type Object is new AdaCL.Base.Object with private; |
---|
A Pointer to an unique element.
Inherits Object
Inherited by Object
125 | overriding procedure Adjust (This : in out Object); |
---|
When adjusting we need hand over the pointer
Object itself.
52 | 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
59 | function Exist (This : in Object) return Boolean with |
---|---|
60 | Pure_Function, Inline; |
Checks if a pointers is set
Object itself.
true when pointer is not null
131 | overriding procedure Finalize (This : in out Object); |
---|
When finalizing we need delete the pointer
Object itself.
67 | function Get (This : in Object) return not null Pointer with |
---|---|
68 | 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
119 | overriding procedure Initialize (This : in out Object); |
---|
Called when creating an object
Object itself.
113 | procedure Object_Image (Output : in out Ada.Strings.Text_Buffers.Root_Buffer_Type'Class; This : Object); |
---|
75 | procedure Release (This : in out Object; Referent : out not null Pointer) with |
---|---|
76 | Pre => (This.Exist), Post => (Referent /= null); |
gets pointer to element and releases ownership. You cans save this pointer.
Object itself.
pointer to element
83 | procedure Reset (This : in out Object; Referent : in Pointer := null); |
---|
Replaces the managed object.
Object itself.
new pointer to manage
90 | procedure Swap (This : in out Object; Other : in out Object); |
---|
swaps the managed objects
Object itself.
Object to swap Referents with