1 | --------------------------------------------------------------- {{{1 ---------- |
---|---|
2 | --: Copyright © 2003 … 2023 Martin Krischik «krischik@users.sourceforge.net» |
3 | ---------------------------------------------------------------------------- |
4 | --: This library is free software; you can redistribute it and/or modify it |
5 | --: under the terms of the GNU Library General Public License as published by |
6 | --: the Free Software Foundation; either version 2 of the License, or (at your |
7 | --: option) any later version. |
8 | --: |
9 | --: This library is distributed in the hope that it will be useful, but |
10 | --: WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
11 | --: or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public |
12 | --: License for more details. |
13 | --: |
14 | --: You should have received a copy of the GNU Library General Public License |
15 | --: along with this library; if not, write to the Free Software Foundation, |
16 | --: Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | --------------------------------------------------------------- }}}1 ---------- |
18 | |
19 | pragma License (Modified_Gpl); |
20 | pragma Ada_2022; |
21 | |
22 | with Ada.Finalization; |
23 | with Ada.Tags; |
24 | |
25 | --- |
26 | -- @summary |
27 | -- Base Class for Limited Object. |
28 | -- |
29 | -- @description |
30 | -- |
31 | package AdaCL.Limited_Base is |
32 | |
33 | type Object_Interface is limited interface; |
34 | type Object_Class is access all Object_Interface'Class; |
35 | |
36 | ---------- Interface ------------------------------------------------------ |
37 | |
38 | --- |
39 | -- Get name of the Class. |
40 | -- Shortcut for Ada.Tags.Expanded_Name (This'Class'Tag); |
41 | -- |
42 | function Get_Name (This : in Object_Interface) return String is abstract; |
43 | |
44 | ---------- Class ---------------------------------------------------------- |
45 | |
46 | --- |
47 | -- Base Class for Limited Object. In AdaCL great care is taken to make all classes non limited so this base class |
48 | -- is not actualy used yet. |
49 | -- |
50 | type Object is abstract new Ada.Finalization.Limited_Controlled and Object_Interface with private; |
51 | |
52 | --- |
53 | -- Get name of the Class. |
54 | -- Shortcut for Ada.Tags.Expanded_Name (This'Class'Tag); |
55 | -- |
56 | overriding function Get_Name (This : in Object) return String is |
57 | (Ada.Tags.Expanded_Name (Object'Class (This)'Tag)) with |
58 | Inline; |
59 | |
60 | private |
61 | |
62 | type Object is abstract new Ada.Finalization.Limited_Controlled and Object_Interface with null record; |
63 | |
64 | end AdaCL.Limited_Base; |
65 | |
66 | ---------------------------------------------------------------- {{{ ---------- |
67 | --: vim: set textwidth=0 nowrap tabstop=8 shiftwidth=3 softtabstop=3 expandtab : |
68 | --: vim: set filetype=ada fileencoding=utf-8 fileformat=unix foldmethod=expr : |
69 | --: vim: set spell spelllang=en_gb |