From e2c1dd07c7a0a5c725b5925e22f4a72003a167c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicol=C3=B2=20Navarin?= Date: Tue, 22 Sep 2009 15:23:44 +0200 Subject: [PATCH] Added simulator-trackdata --- src/simulator-trackdata.adb | 23 +++++++++++++++++++++++ src/simulator-trackdata.ads | 12 ++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/simulator-trackdata.adb create mode 100644 src/simulator-trackdata.ads diff --git a/src/simulator-trackdata.adb b/src/simulator-trackdata.adb new file mode 100644 index 0000000..20df112 --- /dev/null +++ b/src/simulator-trackdata.adb @@ -0,0 +1,23 @@ +with Ada.Numerics; +with Ada.Numerics.Generic_Elementary_Functions; + +with Ada.Containers; use Ada.Containers; +package body Simulator.TrackData is + function "=" (Left, Right : CarIDVector_T.Vector) return Boolean is + length : Count_Type := Left.Length; + equals : Boolean := True; + begin + if (Right.Length /= length) then + return False; + end if; + for i in Count_Type(Exit_Count_T'First) .. length loop + if Left.Element(Exit_Count_T(i)) /= Right.Element(Exit_Count_T(i)) then + return False; + end if; + end loop; + return True; + end "="; + + + +end Simulator.TrackData; diff --git a/src/simulator-trackdata.ads b/src/simulator-trackdata.ads new file mode 100644 index 0000000..954518e --- /dev/null +++ b/src/simulator-trackdata.ads @@ -0,0 +1,12 @@ +with Ada.Containers.Vectors; +package Simulator.TrackData is + type Exit_Count_T is new Positive Range 1 .. 1_1_000; + Package CarIdVector_T is new Ada.Containers.Vectors(Element_Type => CarId_T, Index_Type => Exit_Count_T); + function "=" (Left, Right : CarIDVector_T.Vector) return Boolean ; + + type Sector_Count_T is new Positive range 1 .. 1_000; + type ExitOrder_T is array (Positive range <>) of access CarIdVector_T.Vector; + + ExitOrder: access ExitOrder_T ; + +end Simulator.TrackData; -- 2.11.4.GIT