Release notes
New unmanaged forms are provided for all the monolithic Containers. This means you don't need to supply a storage pool at all (and means you can use GNAT 3.12 if you have to!).
In BC.Support.Memory_Streams, Write_Contents did the actual writing one storage element at a time. Read_Contents requires a supplier Stream that has datagram properties (unlike, it turns out, GNAT.Sockets streams, even if based on a datagram protocol).
None.
None.
The library is now released under the GNAT-modified GPL. My test and demonstration code is released under the GPL. Contributed code's licences remain unchanged.
For Bags, Maps and Sets in each form, and in all Bounded forms, the basic container is now unconstrained with a constrained subtype: for Unbounded Bags, for instance, the declarations are
generic with function Hash (V : Item) return Natural is <>; Buckets : Positive; Storage : in out System.Storage_Pools.Root_Storage_Pool'Class; package BC.Containers.Bags.Unbounded is ... type Unconstrained_Bag (Number_Of_Buckets : Positive) is new Abstract_Bag with private; subtype Bag is Unconstrained_Bag (Number_Of_Buckets => Buckets);
whereas for bounded bags the declarations are
generic with function Hash (V : Item) return Natural is <>; Buckets : Positive; Maximum_Size : Positive; package BC.Containers.Bags.Bounded is ... type Unconstrained_Bag (Number_Of_Buckets : Positive; Maximum_Size : Positive) is new Abstract_Bag with private; subtype Bag is Unconstrained_Bag (Number_Of_Buckets => Buckets, Maximum_Size => Maximum_Size);
The intention is that users shouldn't need to change their source.
The slender support for concurrency (Guarded and Synchronized forms) has been removed.
You may find you need concurrency support when using the Components to help implement your own abstractions. You'll probably find that the best approach is to implement the required concurrency behaviour with tasks, protected types and (if you choose) semaphores and locks from BC.Support.Synchronization, using the Components within this environment.
BC.Support.Memory_Streams provides in-memory stream support.
BC.Containers.Maps.Hash_Statistics and BC.Containers.Sets.Hash_Statistics are withdrawn.
BC.Container_Error (raised when sorting unsortable container types) becomes Sort_Error.
The support for smart pointers (in BC.Smart) is deprecated; use BC.Support.Smart_Pointers instead.
There are some brief notes on the BC.Support packages.
None not already discussed.
None.
None.
Noted that the Case Study is in fact meant to be a tutorial!
Added further recommendation to use Collections instead of Lists.
Inserted a couple of pragma Elaborate_Bodys.
Added tests to suppress warnings when instantiating a bounded container of size 1 (I know this sounds silly, it happens with a code generator that's a bit naive still in this area).
Improved closed Iterator (Visit, Modify) performance.
Optimisations on BC.Containers.Trees.AVL.Validate, thanks to Steve Deller.
Implemented "=" properly for Bounded and Dynamic Maps. Completed implementation of Maps.Are_Equal.
Modifications to BC.Containers.Maps.Unbounded to allow the new Configuration_Demo to build with GNAT 3.14p (and GCC-3.1). It won't build with 3.13p, by the way, and has finalization problems with GNAT 3.15a.
Anh Vo has contributed a pair of storage managers.
The new storage pool management scheme, introduced in the 20011011 release, breaks GNAT 3.12.
Converted the Tests and Demos page to report compiler compatibility.
The Containers that don't provide structural sharing (Bags,
Collections, Dequeues, Maps, Queues, Rings, Sets and Stacks) now
support Streams ('Input, 'Output).
Unfortunately, GNAT 3.13p doesn't support this for dynamic or
unbounded forms (runtime errors), while ObjectAda fails at runtime
when the Item type is a discriminated record (OK for tagged
types, though). Walking on broken glass here.
Corrected an error in the annotation of BC.Graphs.Destroy_Arc.
Added usage of maps to the case study.
Removed BC.Support.Nodes (spreading its functionality to the using packages).
Removed unused First, Last variants in BC.Support.{Bounded,Dynamic,Unbounded}.
Dynamic Components didn't support "=" properly (predefined equality used for array comparison, LRM 4.5.2(24)).
Pat Rogers has added a storage manager for real-time applications.
ObjectAda, AdaMulti and Apex have a problem with BC.Copy, BC.Filter.
ObjectAda has trouble with sort_test.adb.
ObjectAda has trouble with user_map.adb.
I removed the Mind-It facility, they've decided to charge for the service.
The way Storage Management is specified has
changed significantly: you now supply a single generic
parameter of type
System.Storage_Pools.Root_Storage_Pool'Class.
This will be painful to start with, but should simplify matters in
the long run.
The version of Sets.Add that doesn't tell you if the newly added Item was in fact already there becomes a primitive operation rather than a class-wide one.
BC.Containers.Maps.Hash_Statistics didn't work for Bounded Maps.
You couldn't override equality for a Map's Key.
Added commentary to BC.Copy, BC.Filter.
Continued indenting to the GNAT defaults.
Began rework of tests so as to give a clear pass/fail indication. So far only for Collections, Maps, Sets.
Began work on a case study.
Added a with abort to a requeue in BC.Support.Synchronization.
Bounded Bags, Maps and Sets use a bounded hash table. This reduces the space requirement considerably and means that the Available function returns the correct value.
Began re-indenting to the GNAT default (basically, 3 spaces standard indent, 2 spaces for continuations).
Added BC.Containers.Quicksort, BC.Containers.Shellsort generics (implemented as child packages, on the theory that you won't want the clutter in BC.Containers if you don't need it).
Removed BC.Containers.Copy, BC.Containers.Filter generics.
Bounded forms have an Available function, returning the number of free entries. The same function is now available for Dynamic and Unbounded forms (in which case it returns Natural'Last; just don't believe it!
Added Synchronized forms for Dynamic and Unbounded Maps.
Added BC.Containers.Maps.Hash_Statistics to report how well the hashing algorithm is doing. Easy enough to do the same for Bags, Sets ..
Added noisy exception handlers to all the test programs ..
.. because an assertion in the Bounded Container support package was off by one, and the test programs were putting GNAT's exception message in a log file that was a relic of the old malloc checking.
Unbounded Maps missed out on the 20010325 change in which Containers no longer allocated their representation from the heap; fixed.
Synchronized Maps didn't allow you to override "=".
The GNAT compiler
problem (GNAT was too permissive) noted in the June 1999 release
is still there .. fixed, I hope, in
BC.Support.Synchronization.
I think the reason I've not seen this problem is that I've never been
able to get the concurrency support working with the free versions of
the Aonix compiler. The least I can do is to try compiling
synchronization support on its own! .. and OA 7.2 would have found
it. Apologies.
Containers no longer allocate their representation from the heap. This particularly affects Bounded forms, which no longer use the heap at all (at any rate in non-Guarded, non-Synchronized forms).
Bounded forms now use a strategy derived from that in the C++ Components to minimise the amount of data copying on insertion and removal.
Lists no longer allow the use of Remove to delete an
element that is aliased by another List (the new exception
BC.Referenced will be raised).
I hope this won't upset too many of you, but if you were using
this feature you were living dangerously! miscalculated reference
counts, dangling pointers, ... the simplest thing to do is to
Clear the second List.
For consistency, what were the Bounded forms' Size parameters are now all Maximum_Size.
For consistency, the Dynamic forms' Create operation has been replaced by a new generic parameter Initial_Size.
Added generic Copy, Filter functions to
BC; this allows you to copy or filter between different
instantiations of BC.Containers (for the same Item type, of
course).
I think these remove the need for BC.Containers.Copy,
BC.Containers.Filter.
If AVL_Tree.Insert finds that there is already an element
which compares equal to the given element, it now replaces the
existing element. This is in case you have important non-key record
components that you wish to change.
An alternative strategy in this situation is to make the actual
item type a pointer to your record, so that you can change the
indicated non-key fields as required (not the key fields,
please!)
The concrete Lists are now declared as plain List rather than Single_List, Double_List (there is no Abstract_List, perhaps there should be!).
The concrete Graphs, Vertices and Arcs are now declared as plain Graph, Vertex and Arc (and the abstract types in BC.Graphs are Abstract_Graph, Abstract_Vertex, and Abstract_Arc).
Maps now have the standard Container generic type Item as the range, and the Map generic type Key as the domain. If you are a Map user, you'll have to change your code's logic (as well as the type names, see above).
Added generic Copy, Filter functions to BC.Containers.
Hash functions (for Bags, Maps, Sets) now expected to return Natural rather than Positive.
The Map comments used to claim that Maps cache references. This was not true.
Removed Dynamic Queues' Create(Size) operation (now a generic
parameter); for use with synchronized Queues. The problem is that this
was a function, so derived types would have had to override it.
This change will have to apply to other Dynamic forms.
Added a Pop_Value operation for Queues; semantically necessary for synchronized Queues.
Removed the unnecessary (illegal?) Initialize(Ring_Iterator) operation.
Iterators are visibly Controlled. The Controlled bit is because of work on synchronized forms, and the visible bit is because of a GNAT 3.13 problem with finalization when using a function return value to initialize a classwide value.
Lots of work on BC.Support.Synchronization.
Implemented the remaining Bounded and Dynamic forms (Collections, Deques, Ordered Collections, Ordered Queues, Queues and Rings).
Added a Null_Container operation, so users can initialize structures containing Containers.
Began an alternative approach to the provision of Guarded and Synchronized forms. You can see this in BC.Containers.Guarded, BC.Containers.Maps.Synchronized and Map_Test_Concurrent. Unfortunately there seems to be a disagreement between compilers about this one!
Fixed an error in passive modifying iteration, where the first element was visited repeatedly. This has changed BC.Containers.Access_Current_Item's profile.
Added Deques (in the Unbounded form only so far).
In AVL Trees and Lists, removed the aliased specification on elements, which forces the element to be constrained even if the discriminant has a default.
In response to a report from T E Dennison, speeded up the creation of Iterators. Note, this requires that iterators be declared of type Containers.Interator'Class, and initialized at the point of declaration.
Copying of Ordered Collections using Collections.Copy is now stable.
Removed unnecessary private operations on some Containers.
Synchronized Unbounded Maps had no "=" operation.
The added Map iterator features (which allow access to the Value) have been reworked in the same style as the standard Container iterators. They are only available when the Iterator concerned is viewed as a Map_Iterator.
Smart Pointers now have a Null_Pointer declaration.
Bounded forms didn't properly implement equality (thanks to Mark Bond for this one).
Hash tables now compile with APEX as well as GNAT and ObjectAda 7.1.
Reorganised the source files so that tests and demos go in subdirectories.
Uses signature-based Hash Tables (for Bags, Maps, Sets).
Includes Guarded and Synchronized Maps.
Added the ability to delete the item an Iterator is currently indicating (Delete_Item_At (It : Iterator)). Note, this feature doesn't yet work for Bags, Maps, Rings or Sets.
The C++ code offers two variants of accessors such as Queues.Front, one of which returns a value while the other returns a reference. The second case is now supported by generics such as eg Queues.Process_Front.
The Copy operation of Collections, Queues, Rings and Stacks checks for self-assignment before proceeding.
Synchronized Unbounded Rings now support blocking (balking); eg, an attempt to Pop will block until the Ring has something in it to pop. For related reasons, the Pop_Value operation is provided.
AVL Trees had an error (inherited from the C++) which would sometimes corrupt the Tree on deletion.
Containers have new versions of the Visit and Modify generics that include a parameter as an argument to Visit and Modify that is passed to the Apply routine. Thanks to Steve Doiel.
Added pragma Elaborate_Body throughout.
Continued the renaming of Container parameters from Obj to something slightly more mnemonic.
Added Unbounded Ordered Queues.
AVL Trees are no longer limited.
Corrected ordering problem with Unbounded Ordered Collections when keys are equal. Insert now adds from the front of the Collection, Append from the rear.
Added Unbounded Collections and Unbounded Ordered Collections.
BC.Support.Bounded, BC.Support.Unbounded subprogram specs were confused about whether indexing was from 0 (as in the C++) or 1 (in the Ada). BC.Support.Unbounded.Append(2) had an error when appending after the first element.
Corrected a GNAT compiler problem (GNAT was too permissive).
Added ObjectAda-special versions of the Bag test driver (avoiding compiler problems).
Included the accidentally-omitted Bounded and Dynamic Bag sources.
Added Unbounded Rings in standard, Guarded and Synchronized forms.
ObjectAda problems with Semaphores.
Eliminated a problem where a function call, used only for its side effect and not for its result, was deleted by high optimisation levels (-O3).
Passive iteration (in BC.Containers) didn't reset the passed-in Iterator.
Notes from John P. Woodruff on use with Rational Apex.
Added a word-counter demo, as suggested by John English in the Ada Standard Component Library Working Group.
Further contributions.
Containers require a (defaultable) "=" operation for Items.
Added Bags (only in the Unbounded form so far).
Added Sets.
Reworked Iteration; passive iteration now obtains the Container over which to iterate via an Iterator bound to the container. This allows different styles of iteration with one interface.
Graphs have three Vertex iterators: incoming only, outgoing only, both ways.
Binary trees have in-order, pre-order and post-order iterators; Multiway trees have pre-order and post-order iterators. Only passive iteration is available, and the style is different from that of other Containers.
If a section of a list which didn't contain a shared node was purged, an invalid pointer access (Constraint_Error) would occur. This error was in the C++ (where it was OK, it seems, to free() a null pointer).
Assignment involving unbounded forms didn't correctly invalidate the cache in the copy.
Began a demos page.
Began a "contributions" section, with initial contributions from Daniel Gaudry.
Corrected an error in AVL trees (only the second one that is an error in the original C++ and not in the translation!).
Added ObjectAda-special versions of test drivers (avoiding compiler problems).
Removed a use of the GNAT-special 'Img attribute.
Removed a couple of badly-placed pragma Inlines.
Added Maps.
Added AVL Trees.
Removed some abbreviations; for instance, in BC.Containers.Stacks.Unbounded, the type Unb_Stack becomes Unbounded_Stack. These changes will break existing code.
Reworked Iteration throughout, with a vast improvement in the efficiency of List iterators. These changes will break existing code; compiler problems mean that you can't use GNAT 3.10p.
Moved Graph iterators up to the parent package (BC.Graphs), and included a little demonstration of Graph usage (Ada_Units).
For consistency, the concrete Graph, Vertex and Arc types are now prefixed with Undirected_ or Directed_ as appropriate; eg, a directed Vertex becomes Directed_Vertex.
Added Graphs. There are more compiler problems, I'm afraid, though we have found a workround for one of the old ones.
Internal changes in Storage Management.
Updated notes on compiler problems to give a workround for users of ObjectAda 7.1 Special Edition.
Storage Management added, thanks to Pat Rogers. This has tickled some compiler problems, please check to see if you're affected.
Fixed inefficiency in Unbounded (and perhaps Dynamic) forms of Queues and Stacks.
Storage Management for Dynamic and Unbounded forms required that we instantiate some support packages inside the using generic rather than having the user pre-instantiate them. We decided to adopt the same policy for Bounded forms too. These changes will break existing code.
Added some comments to package specs.
Added some minor demo code (storage, time_lists and time_queues).
Bugfix release.
There were several storage leaks.
It's illegal to declare abstract subprograms in a private part.
The Stack and Queue iterators were broken (by sjw).
First release by Simon Wright. Added Binary and Multiway Trees, Smart Pointers.