AdaCL.Pointer.Shared_With_Delete

AdaCL: Shared smart pointer.

More...

Entities

Access types

Instance_Access

Record types

Instance_Type

Tagged types

Object

Dispatching subprograms

Adjust
Create
Exist
Finalize
Get
Initialize
Object_Image
Reset
Swap
Unique
Use_Count

Description

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

Instance_Access [source]

107 type Instance_Access is access Instance_Type;

Self referencing type consisting of three components: type of the self reference

Instance_Type [source]

102 type Instance_Type;

Self referencing type consisting of three components: This component holds the actual data. Details in the body.

Object [source]

44 type Object is new AdaCL.Base.Object with private;

A Pointer to an unique element.

Inherits Object

Inherited by Object

Adjust [source]

130 overriding procedure Adjust (This : in out Object);

When asjusting we need hand over the pointer

This of type AdaCL.Pointer.Shared_With_Delete.Object

Object itself.

Create [source]

51 function Create (Referent : in Pointer := null) return Object;

Creates a new unique smart pointer from normal pointer.

Referent of type AdaCL.Pointer.Shared_With_Delete.Pointer

Pointer to reference counted object

Return value

New smart pointer

Exist [source]

58 function Exist (This : in Object) return Boolean with
59 Pure_Function, Inline;

Checks if a pointers is set

This of type AdaCL.Pointer.Shared_With_Delete.Object

Object itself.

Return value

true when pointer is not null

Finalize [source]

136 overriding procedure Finalize (This : in out Object);

When finalizing we need delete the pointer

This of type AdaCL.Pointer.Shared_With_Delete.Object

Object itself.

Get [source]

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.

This of type AdaCL.Pointer.Shared_With_Delete.Object

Object itself.

Return value

pointer to element

Initialize [source]

124 overriding procedure Initialize (This : in out Object);

Called when creating an object

This of type AdaCL.Pointer.Shared_With_Delete.Object

Object itself.

Object_Image [source]

118 procedure Object_Image (Output : in out Ada.Strings.Text_Buffers.Root_Buffer_Type'Class; This : Object);
Output of type Root_Buffer_Type
This of type AdaCL.Pointer.Shared_With_Delete.Object

Reset [source]

74 procedure Reset (This : in out Object; Referent : in Pointer := null);

Replaces the managed object.

This of type AdaCL.Pointer.Shared_With_Delete.Object

Object itself.

Referent of type AdaCL.Pointer.Shared_With_Delete.Pointer

new pointer to manage

Swap [source]

81 procedure Swap (This : in out Object; Other : in out Object);

swaps the managed objects

This of type AdaCL.Pointer.Shared_With_Delete.Object

Object itself.

Other of type AdaCL.Pointer.Shared_With_Delete.Object

Object to swap Referents with

Unique [source]

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

This of type AdaCL.Pointer.Shared_With_Delete.Object
Return value

true when use counter is one.

Use_Count [source]

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.

This of type AdaCL.Pointer.Shared_With_Delete.Object
Return value

use count