|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3072 (0xc00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package Item_Count, seg_0046c7
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
--| @SUMMARY Provides the ability to count the number of occurances
--| of an item.
--| @INDICES (COUNTING)
with Map_Generic;
generic
Size : Positive;
type Item is private;
with function Hash (An_Item : Item) return Integer;
package Item_Count is
type Data_Base is private;
procedure Initialize (Db : in out Data_Base);
--| @DESCRIPTION Adds the item if it is new and sets it count to 1
--| Increments the count if it is not new.
--|
procedure Add (An_Item : Item; To : in out Data_Base);
type Item_Iterator is private;
function Done (Iter : Item_Iterator) return Boolean;
function Value (Iter : Item_Iterator) return Item;
procedure Next (Iter : in out Item_Iterator);
--| @DESCRIPTION Returns the number of times the item was added to
--| the database
--| @RAISES (Item_Not_Found)
function Total (For_Item : Item; From : Data_Base) return Positive;
--| @DESCRIPTION Raised if the item has never been added to the database
Item_Not_Found : exception;
private
type Data is range 1 .. Integer'Last;
package Data_Map is new Map_Generic (Size, Item, Data, Hash);
type Data_Base is new Data_Map.Map;
type Item_Iterator is new Data_Map.Iterator;
end Item_Count;
nblk1=2
nid=0
hdr6=4
[0x00] rec0=20 rec1=00 rec2=01 rec3=030
[0x01] rec0=0c rec1=00 rec2=02 rec3=000
tail 0x215004a8c815c6706c2fc 0x42a00088462061e03