| 1 |
------------------------------------------------------------------------------ |
| 2 |
-- -- |
| 3 |
-- GNAT RUN-TIME COMPONENTS -- |
| 4 |
-- -- |
| 5 |
-- G N A T . C P P . S T D -- |
| 6 |
-- -- |
| 7 |
-- S p e c -- |
| 8 |
-- -- |
| 9 |
-- Copyright (C) 2022-2025, AdaCore -- |
| 10 |
-- -- |
| 11 |
-- GNAT is free software; you can redistribute it and/or modify it under -- |
| 12 |
-- terms of the GNU General Public License as published by the Free Soft- -- |
| 13 |
-- ware Foundation; either version 3, or (at your option) any later ver- -- |
| 14 |
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- |
| 15 |
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- |
| 16 |
-- or FITNESS FOR A PARTICULAR PURPOSE. -- |
| 17 |
-- -- |
| 18 |
-- As a special exception under Section 7 of GPL version 3, you are granted -- |
| 19 |
-- additional permissions described in the GCC Runtime Library Exception, -- |
| 20 |
-- version 3.1, as published by the Free Software Foundation. -- |
| 21 |
-- -- |
| 22 |
-- You should have received a copy of the GNU General Public License and -- |
| 23 |
-- a copy of the GCC Runtime Library Exception along with this program; -- |
| 24 |
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- |
| 25 |
-- <http://www.gnu.org/licenses/>. -- |
| 26 |
-- -- |
| 27 |
-- GNAT was originally developed by the GNAT team at New York University. -- |
| 28 |
-- Extensive contributions were provided by Ada Core Technologies Inc. -- |
| 29 |
-- -- |
| 30 |
------------------------------------------------------------------------------ |
| 31 |
|
| 32 |
-- This package may provide an Ada interface for some C++ standard |
| 33 |
-- entities in the std namespace. |
| 34 |
|
| 35 |
limited private with GNAT.CPP.Std.Type_Info; |
| 36 |
with System; use System; |
| 37 |
with Interfaces.C; use Interfaces.C; |
| 38 |
with Interfaces.C.Extensions; use Interfaces.C.Extensions; |
| 39 |
|
| 40 |
package GNAT.CPP.Std is |
| 41 |
type Type_Info_Ptr is private; |
| 42 |
-- This type stands for C++ std::type_info *. |
| 43 |
|
| 44 |
No_Type_Info : constant Type_Info_Ptr; |
| 45 |
|
| 46 |
function To_Type_Info_Ptr (S : System.Address) return Type_Info_Ptr; |
| 47 |
-- Return an opaque Type_Info_Ptr referencing the std::type_info |
| 48 |
-- object presumed to be at S. |
| 49 |
|
| 50 |
function Name (this : Type_Info_Ptr) |
| 51 |
-- return Interfaces.C.Strings.chars_ptr; |
| 52 |
return String; |
| 53 |
-- Exposed std::type_info member function. ??? Would it ever be |
| 54 |
-- desirable to get direct access to the internal chars_ptr? |
| 55 |
|
| 56 |
function Before (this, that : Type_Info_Ptr) |
| 57 |
-- return Interfaces.C.Extensions.bool; |
| 58 |
return Boolean; |
| 59 |
-- Exposed std::type_info member function. |
| 60 |
|
| 61 |
function Equals (this, that : Type_Info_Ptr) |
| 62 |
-- return Interfaces.C.Extensions.bool; |
| 63 |
return Boolean; |
| 64 |
-- Exposed std::type_info member function. |
| 65 |
|
| 66 |
function Is_Pointer_P (this : Type_Info_Ptr) |
| 67 |
return Interfaces.C.Extensions.bool; |
| 68 |
-- Exposed std::type_info member function. |
| 69 |
|
| 70 |
function Is_Function_P (this : Type_Info_Ptr) |
| 71 |
return Interfaces.C.Extensions.bool; |
| 72 |
-- Exposed std::type_info member function. |
| 73 |
|
| 74 |
function Do_Catch |
| 75 |
(this : Type_Info_Ptr; |
| 76 |
thrown_type : Type_Info_Ptr; |
| 77 |
thrown_object : in out System.Address; |
| 78 |
outer_count : Interfaces.C.unsigned) |
| 79 |
return Interfaces.C.Extensions.bool; |
| 80 |
-- Exposed std::type_info member function. |
| 81 |
|
| 82 |
function Do_Upcast |
| 83 |
(this : Type_Info_Ptr; |
| 84 |
target : Type_Info_Ptr; |
| 85 |
obj_ptr : in out System.Address) |
| 86 |
return Interfaces.C.Extensions.bool; |
| 87 |
-- Exposed std::type_info member function. |
| 88 |
|
| 89 |
private |
| 90 |
|
| 91 |
type Type_Info_Ptr is access constant Type_Info.type_info'Class; |
| 92 |
pragma No_Strict_Aliasing (Type_Info_Ptr); |
| 93 |
pragma No_Heap_Finalization (Type_Info_Ptr); |
| 94 |
|
| 95 |
No_Type_Info : constant Type_Info_Ptr := null; |
| 96 |
|
| 97 |
end GNAT.CPP.Std; |