From 8cf4a02035eb8c01ef7f4487bf92ed3c64f02a40 Mon Sep 17 00:00:00 2001 From: Michael Frank <55284511+frank-at-adacore@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:01:46 -0500 Subject: [PATCH 1/4] Rename "Access Types - Advanced" to "Access Types In Depth" More consistent - In Depth module REPLACES normal module (As opposed to "Advanced" which implies SUPPLEMENTS normal module) --- ...nced.rst => 140_access_types-in_depth.rst} | 4 ++-- courses/fundamentals_of_ada/advanced.txt | 2 +- ....rst => 140_access_types-in_depth.lab.rst} | 24 +++++++++---------- ...nced.txt => 140_access_types-in_depth.txt} | 0 .../database.adb | 0 .../database.ads | 0 .../database_list.adb | 0 .../database_list.ads | 0 .../default.gpr | 0 .../main.adb | 0 .../simple_io.adb | 0 .../simple_io.ads | 0 12 files changed, 15 insertions(+), 15 deletions(-) rename courses/fundamentals_of_ada/{140_access_types-advanced.rst => 140_access_types-in_depth.rst} (94%) rename courses/fundamentals_of_ada/labs/{140_access_types-advanced.lab.rst => 140_access_types-in_depth.lab.rst} (58%) rename courses/fundamentals_of_ada/labs/answers/{140_access_types-advanced.txt => 140_access_types-in_depth.txt} (100%) rename courses/fundamentals_of_ada/labs/prompts/{140_access_types-advanced => 140_access_types-in_depth}/database.adb (100%) rename courses/fundamentals_of_ada/labs/prompts/{140_access_types-advanced => 140_access_types-in_depth}/database.ads (100%) rename courses/fundamentals_of_ada/labs/prompts/{140_access_types-advanced => 140_access_types-in_depth}/database_list.adb (100%) rename courses/fundamentals_of_ada/labs/prompts/{140_access_types-advanced => 140_access_types-in_depth}/database_list.ads (100%) rename courses/fundamentals_of_ada/labs/prompts/{140_access_types-advanced => 140_access_types-in_depth}/default.gpr (100%) rename courses/fundamentals_of_ada/labs/prompts/{140_access_types-advanced => 140_access_types-in_depth}/main.adb (100%) rename courses/fundamentals_of_ada/labs/prompts/{140_access_types-advanced => 140_access_types-in_depth}/simple_io.adb (100%) rename courses/fundamentals_of_ada/labs/prompts/{140_access_types-advanced => 140_access_types-in_depth}/simple_io.ads (100%) diff --git a/courses/fundamentals_of_ada/140_access_types-advanced.rst b/courses/fundamentals_of_ada/140_access_types-in_depth.rst similarity index 94% rename from courses/fundamentals_of_ada/140_access_types-advanced.rst rename to courses/fundamentals_of_ada/140_access_types-in_depth.rst index c6f85a3a1..838456623 100644 --- a/courses/fundamentals_of_ada/140_access_types-advanced.rst +++ b/courses/fundamentals_of_ada/140_access_types-in_depth.rst @@ -1,5 +1,5 @@ *********************** -Advanced Access Types +Access Types In-Depth *********************** .. container:: PRELUDE BEGIN @@ -43,5 +43,5 @@ Advanced Access Types .. include:: 140_access_types/08-memory_management.rst .. include:: 140_access_types/09-memory_debugging.rst .. include:: 140_access_types/10-memory_control.rst -.. include:: labs/140_access_types-advanced.lab.rst +.. include:: labs/140_access_types-in_depth.lab.rst .. include:: 140_access_types/99-summary_with_pools.rst diff --git a/courses/fundamentals_of_ada/advanced.txt b/courses/fundamentals_of_ada/advanced.txt index 78068a847..0e1907528 100644 --- a/courses/fundamentals_of_ada/advanced.txt +++ b/courses/fundamentals_of_ada/advanced.txt @@ -5,7 +5,7 @@ 080_expressions-with_quantified.rst 120_limited_types.rst 290_advanced_data_hiding.rst -140_access_types-advanced.rst +140_access_types-in_depth.rst 160_genericity.rst 170_tagged_derivation.rst 175_multiple_inheritance.rst diff --git a/courses/fundamentals_of_ada/labs/140_access_types-advanced.lab.rst b/courses/fundamentals_of_ada/labs/140_access_types-in_depth.lab.rst similarity index 58% rename from courses/fundamentals_of_ada/labs/140_access_types-advanced.lab.rst rename to courses/fundamentals_of_ada/labs/140_access_types-in_depth.lab.rst index f14ca085a..6e2ed1d0a 100644 --- a/courses/fundamentals_of_ada/labs/140_access_types-advanced.lab.rst +++ b/courses/fundamentals_of_ada/labs/140_access_types-in_depth.lab.rst @@ -3,7 +3,7 @@ Lab ======== --------------------------- -Advanced Access Types Lab +Access Types In Depth Lab --------------------------- * Build an application that adds / removes items from a linked list @@ -41,64 +41,64 @@ Extra Credit Lab Solution - Database ------------------------- -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Database :end-before:--Database :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Database :end-before:--Database :code:Ada :number-lines:1 ------------------------------------- Lab Solution - Database_List (Spec) ------------------------------------- -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Database_List_Spec :end-before:--Database_List_Spec :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Database_List_Spec :end-before:--Database_List_Spec :code:Ada :number-lines:1 ----------------------------------------------- Lab Solution - Database_List (Helper Objects) ----------------------------------------------- -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Database_List_Helpers :end-before:--Database_List_Helpers :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Database_List_Helpers :end-before:--Database_List_Helpers :code:Ada :number-lines:1 ----------------------------------------------- Lab Solution - Database_List (Insert/Delete) ----------------------------------------------- -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Database_List_Substance :end-before:--Database_List_Substance :code:Ada :number-lines:35 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Database_List_Substance :end-before:--Database_List_Substance :code:Ada :number-lines:35 --------------------- Lab Solution - Main --------------------- -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Main :end-before:--Main :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Main :end-before:--Main :code:Ada :number-lines:1 --------------------------------- Lab Solution - Simple_IO (Spec) --------------------------------- -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Simple_IO_Spec :end-before:--Simple_IO_Spec :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Simple_IO_Spec :end-before:--Simple_IO_Spec :code:Ada :number-lines:1 --------------------------------- Lab Solution - Simple_IO (Body) --------------------------------- -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Simple_IO_Body :end-before:--Simple_IO_Body :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Simple_IO_Body :end-before:--Simple_IO_Body :code:Ada :number-lines:1 ------------------------------------------ Lab Solution - Memory_Mgmt (Debug Pools) ------------------------------------------ -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Memory_Mgmt_Debug :end-before:--Memory_Mgmt_Debug :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Memory_Mgmt_Debug :end-before:--Memory_Mgmt_Debug :code:Ada :number-lines:1 ------------------------------------------------- Lab Solution - Memory_Mgmt (Storage Pools Spec) ------------------------------------------------- -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Memory_Mgmt_Spec :end-before:--Memory_Mgmt_Spec :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Memory_Mgmt_Spec :end-before:--Memory_Mgmt_Spec :code:Ada :number-lines:1 ------------------------------------------------ Lab Solution - Memory_Mgmt (Storage Pools 1/2) ------------------------------------------------ -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Memory_Mgmt_Helpers :end-before:--Memory_Mgmt_Helpers :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Memory_Mgmt_Helpers :end-before:--Memory_Mgmt_Helpers :code:Ada :number-lines:1 ------------------------------------------------ Lab Solution - Memory_Mgmt (Storage Pools 2/2) ------------------------------------------------ -.. container:: source_include labs/answers/140_access_types-advanced.txt :start-after:--Memory_Mgmt_Substance :end-before:--Memory_Mgmt_Substance :code:Ada :number-lines:49 +.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Memory_Mgmt_Substance :end-before:--Memory_Mgmt_Substance :code:Ada :number-lines:49 diff --git a/courses/fundamentals_of_ada/labs/answers/140_access_types-advanced.txt b/courses/fundamentals_of_ada/labs/answers/140_access_types-in_depth.txt similarity index 100% rename from courses/fundamentals_of_ada/labs/answers/140_access_types-advanced.txt rename to courses/fundamentals_of_ada/labs/answers/140_access_types-in_depth.txt diff --git a/courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/database.adb b/courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/database.adb similarity index 100% rename from courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/database.adb rename to courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/database.adb diff --git a/courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/database.ads b/courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/database.ads similarity index 100% rename from courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/database.ads rename to courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/database.ads diff --git a/courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/database_list.adb b/courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/database_list.adb similarity index 100% rename from courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/database_list.adb rename to courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/database_list.adb diff --git a/courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/database_list.ads b/courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/database_list.ads similarity index 100% rename from courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/database_list.ads rename to courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/database_list.ads diff --git a/courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/default.gpr b/courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/default.gpr similarity index 100% rename from courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/default.gpr rename to courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/default.gpr diff --git a/courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/main.adb b/courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/main.adb similarity index 100% rename from courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/main.adb rename to courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/main.adb diff --git a/courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/simple_io.adb b/courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/simple_io.adb similarity index 100% rename from courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/simple_io.adb rename to courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/simple_io.adb diff --git a/courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/simple_io.ads b/courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/simple_io.ads similarity index 100% rename from courses/fundamentals_of_ada/labs/prompts/140_access_types-advanced/simple_io.ads rename to courses/fundamentals_of_ada/labs/prompts/140_access_types-in_depth/simple_io.ads From ae5837da0a431e1bcc1dea3784e18174b706a3a4 Mon Sep 17 00:00:00 2001 From: Michael Frank <55284511+frank-at-adacore@users.noreply.github.com> Date: Tue, 7 Jan 2025 11:44:57 -0500 Subject: [PATCH 2/4] Add slide comparing general access to pool-specific Update tile to "In Depth" instead of "In-Depth" --- .../140_access_types-in_depth.rst | 2 +- .../140_access_types/01-introduction.rst | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/courses/fundamentals_of_ada/140_access_types-in_depth.rst b/courses/fundamentals_of_ada/140_access_types-in_depth.rst index 838456623..1c1284f89 100644 --- a/courses/fundamentals_of_ada/140_access_types-in_depth.rst +++ b/courses/fundamentals_of_ada/140_access_types-in_depth.rst @@ -1,5 +1,5 @@ *********************** -Access Types In-Depth +Access Types In Depth *********************** .. container:: PRELUDE BEGIN diff --git a/courses/fundamentals_of_ada/140_access_types/01-introduction.rst b/courses/fundamentals_of_ada/140_access_types/01-introduction.rst index 0d2757f84..6d59ded61 100644 --- a/courses/fundamentals_of_ada/140_access_types/01-introduction.rst +++ b/courses/fundamentals_of_ada/140_access_types/01-introduction.rst @@ -45,6 +45,48 @@ Access Types Design int * G_C = &Some_Int; . +----------------------------------------- +Access Types - General vs Pool-Specific +----------------------------------------- + +.. container:: latex_environment small + + .. list-table:: + :header-rows: 1 + + * - General Access Type + - Pool-Specific Access Type + + * - Point to any object of + - Tightly coupled to + + * - designated type + - dynamically allocated objects + + * - + + * - Useful for creating aliases + - Used with Ada's controlled + + * - to existing objects + - memory management (pools) + + * - + + * - Point to existing object via + - Can only point to object + + * - :ada:`'Access` **or** created by :ada:`new` + - created by :ada:`new` + + * - + + * - No automatic + - Memory management tied + + * - memory management + - to specific storage pool + ------------------------------- Access Types Can Be Dangerous ------------------------------- From d76daa02d965bae37334bfbe53b98d79847b7231 Mon Sep 17 00:00:00 2001 From: Michael Frank <55284511+frank-at-adacore@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:20:08 -0500 Subject: [PATCH 3/4] Rework slide to use columns instead of table --- .../140_access_types/01-introduction.rst | 44 ++++++------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/courses/fundamentals_of_ada/140_access_types/01-introduction.rst b/courses/fundamentals_of_ada/140_access_types/01-introduction.rst index 6d59ded61..be33e95d0 100644 --- a/courses/fundamentals_of_ada/140_access_types/01-introduction.rst +++ b/courses/fundamentals_of_ada/140_access_types/01-introduction.rst @@ -49,43 +49,25 @@ Access Types Design Access Types - General vs Pool-Specific ----------------------------------------- -.. container:: latex_environment small - - .. list-table:: - :header-rows: 1 - - * - General Access Type - - Pool-Specific Access Type - - * - Point to any object of - - Tightly coupled to - - * - designated type - - dynamically allocated objects - - * - - - * - Useful for creating aliases - - Used with Ada's controlled - - * - to existing objects - - memory management (pools) +.. container:: columns - * - + .. container:: column - * - Point to existing object via - - Can only point to object + **General Access Types** - * - :ada:`'Access` **or** created by :ada:`new` - - created by :ada:`new` + * Point to any object of designated type + * Useful for creating aliases to existing objects + * Point to existing object via :ada:`'Access` **or** created by :ada:`new` + * No automatic memory management - * - + .. container:: column - * - No automatic - - Memory management tied + **Pool-Specific Access Types** - * - memory management - - to specific storage pool + * Tightly coupled to dynamically allocated objects + * Used with Ada's controlled memory management (pools) + * Can only point to object created by :ada:`new` + * Memory management tied to specific storage pool ------------------------------- Access Types Can Be Dangerous From 5e1cebfe715ca2c5a93dd3f9a5ccaec34db6cfac Mon Sep 17 00:00:00 2001 From: Michael Frank <55284511+frank-at-adacore@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:26:54 -0500 Subject: [PATCH 4/4] Fix typo in lab answer filename --- .../labs/140_access_types-in_depth.lab.rst | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/courses/fundamentals_of_ada/labs/140_access_types-in_depth.lab.rst b/courses/fundamentals_of_ada/labs/140_access_types-in_depth.lab.rst index 6e2ed1d0a..56bfc3f7a 100644 --- a/courses/fundamentals_of_ada/labs/140_access_types-in_depth.lab.rst +++ b/courses/fundamentals_of_ada/labs/140_access_types-in_depth.lab.rst @@ -41,64 +41,64 @@ Extra Credit Lab Solution - Database ------------------------- -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Database :end-before:--Database :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Database :end-before:--Database :code:Ada :number-lines:1 ------------------------------------- Lab Solution - Database_List (Spec) ------------------------------------- -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Database_List_Spec :end-before:--Database_List_Spec :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Database_List_Spec :end-before:--Database_List_Spec :code:Ada :number-lines:1 ----------------------------------------------- Lab Solution - Database_List (Helper Objects) ----------------------------------------------- -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Database_List_Helpers :end-before:--Database_List_Helpers :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Database_List_Helpers :end-before:--Database_List_Helpers :code:Ada :number-lines:1 ----------------------------------------------- Lab Solution - Database_List (Insert/Delete) ----------------------------------------------- -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Database_List_Substance :end-before:--Database_List_Substance :code:Ada :number-lines:35 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Database_List_Substance :end-before:--Database_List_Substance :code:Ada :number-lines:35 --------------------- Lab Solution - Main --------------------- -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Main :end-before:--Main :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Main :end-before:--Main :code:Ada :number-lines:1 --------------------------------- Lab Solution - Simple_IO (Spec) --------------------------------- -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Simple_IO_Spec :end-before:--Simple_IO_Spec :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Simple_IO_Spec :end-before:--Simple_IO_Spec :code:Ada :number-lines:1 --------------------------------- Lab Solution - Simple_IO (Body) --------------------------------- -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Simple_IO_Body :end-before:--Simple_IO_Body :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Simple_IO_Body :end-before:--Simple_IO_Body :code:Ada :number-lines:1 ------------------------------------------ Lab Solution - Memory_Mgmt (Debug Pools) ------------------------------------------ -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Memory_Mgmt_Debug :end-before:--Memory_Mgmt_Debug :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Memory_Mgmt_Debug :end-before:--Memory_Mgmt_Debug :code:Ada :number-lines:1 ------------------------------------------------- Lab Solution - Memory_Mgmt (Storage Pools Spec) ------------------------------------------------- -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Memory_Mgmt_Spec :end-before:--Memory_Mgmt_Spec :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Memory_Mgmt_Spec :end-before:--Memory_Mgmt_Spec :code:Ada :number-lines:1 ------------------------------------------------ Lab Solution - Memory_Mgmt (Storage Pools 1/2) ------------------------------------------------ -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Memory_Mgmt_Helpers :end-before:--Memory_Mgmt_Helpers :code:Ada :number-lines:1 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Memory_Mgmt_Helpers :end-before:--Memory_Mgmt_Helpers :code:Ada :number-lines:1 ------------------------------------------------ Lab Solution - Memory_Mgmt (Storage Pools 2/2) ------------------------------------------------ -.. container:: source_include labs/answers/140_access_types-in_depthtxt :start-after:--Memory_Mgmt_Substance :end-before:--Memory_Mgmt_Substance :code:Ada :number-lines:49 +.. container:: source_include labs/answers/140_access_types-in_depth.txt :start-after:--Memory_Mgmt_Substance :end-before:--Memory_Mgmt_Substance :code:Ada :number-lines:49