Ada Class Library Base Class for Reference Counted Instances.
More...Object_Class |
Object_Interface |
Object |
Add_Reference | |
Add_Reference | |
Get_Name | |
Object_Image | |
Remove_Reference | |
Remove_Reference | |
Use_Count | |
Use_Count |
Element and Holder: A reference counted smart pointer for tagged types where the reference is kept inside the tagged type. This is slightly faster, uses less memory and is more reliable. However it can only be uses for limited tagged types and you need to implement the interface.
84 | type Object_Class is access Object'Class; |
---|
47 | type Object_Interface is limited interface and AdaCL.Limited_Base.Object_Interface; |
---|
Interface Class for Reference Counted Instances Use the interface in when using the base class is not possible. Type for which we want to supply a reference counter. Since, in Ada one can not overload the ":=" operator the type need to be limited so the counter is not damaged by assignment. Mind you, in C++ I almost always make the operator = private in in Reference counted classes as well.
Inherits Object_Interface
Inherited by Element_Type
82 | type Object is new AdaCL.Limited_Base.Object and Object_Interface with private; |
---|
Base Class for Reference Counted Instances.
Inherits Object, Object_Interface
Inherited by Object
53 | procedure Add_Reference (This : in out Object_Interface) is abstract; |
---|
Add a reference
Object itself.
90 | overriding procedure Add_Reference (This : in out Object) with |
---|---|
91 | Inline; |
Add a reference
Object itself.
75 | overriding function Get_Name (This : in Object_Interface) return String is abstract; |
---|
Get name of Class.
Object itself.
119 | procedure Object_Image (Output : in out Ada.Strings.Text_Buffers.Root_Buffer_Type'Class; This : Object); |
---|
63 | procedure Remove_Reference (This : in out Object_Interface) is abstract; |
---|
Remove a reference. However since an object and a pointer is passed the instance is not deleted. The caller is responsible to call Use_Count and check if delete is needed. Concurrency: Guarded
Object itself.
99 | overriding procedure Remove_Reference (This : in out Object); |
---|
Remove a reference. However since an object and a pointer is passed the instance is not deleted. The caller is responsible to call Use_Count and check if delete is needed.
Object itself.
69 | function Use_Count (This : in Object_Interface) return Natural is abstract; |
---|
Current reference counter.
Object itself.
105 | overriding function Use_Count (This : in Object) return Natural with |
---|---|
106 | Inline; |
Current reference counter.
Object itself.