| 
									
										
										
										
											2021-08-23 23:47:29 +00:00
										 |  |  | with Ada.Finalization; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | generic | 
					
						
							|  |  |  | 	type Item_Type is private; | 
					
						
							|  |  |  | --	type Pointer_Type is access Item_Type;
 | 
					
						
							|  |  |  | package H3.MM is | 
					
						
							|  |  |  | 	type Item_Pointer is access all Item_Type; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	type Ref_Counted_Record is record | 
					
						
							| 
									
										
										
										
											2021-10-06 08:05:21 +00:00
										 |  |  | 		--Refs: System.Atomic_Counters.Atomic_Counter;
 | 
					
						
							|  |  |  | 		Refs: System_Size; | 
					
						
							| 
									
										
										
										
											2021-08-23 23:47:29 +00:00
										 |  |  | 		Item: aliased Item_Type; | 
					
						
							|  |  |  | 	end record; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	type Ref_Counted_Pointer is access Ref_Counted_Record; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	type Ref_Counted is new Ada.Finalization.Controlled with record | 
					
						
							|  |  |  | 		Data: Ref_Counted_Pointer; | 
					
						
							|  |  |  | 	end record; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	procedure Create (R: in out Ref_Counted); | 
					
						
							|  |  |  | 	procedure Create (R: in out Ref_Counted; V: in Item_Type); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 16:19:29 +00:00
										 |  |  | 	function Get_Item_Pointer (R: in Ref_Counted) return Item_Pointer; | 
					
						
							| 
									
										
										
										
											2021-10-30 01:57:19 +00:00
										 |  |  | 	pragma Inline (Get_Item_Pointer); | 
					
						
							| 
									
										
										
										
											2021-08-23 23:47:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-27 15:34:30 +00:00
										 |  |  | 	function Is_Shared (R: in Ref_Counted) return Boolean; | 
					
						
							| 
									
										
										
										
											2021-10-30 01:57:19 +00:00
										 |  |  | 	pragma Inline (Is_Shared); | 
					
						
							| 
									
										
										
										
											2021-08-23 23:47:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	overriding procedure Initialize (R: in out Ref_Counted); | 
					
						
							|  |  |  | 	overriding procedure Adjust (R: in out Ref_Counted); | 
					
						
							|  |  |  | 	overriding procedure Finalize (R: in out Ref_Counted); | 
					
						
							| 
									
										
										
										
											2021-10-27 16:16:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 16:07:29 +00:00
										 |  |  | end H3.MM; |