Components

Containers

The Containers component defines 32-bit and 64-bit containers that have been optimized for parallelism (e.g. List, LinkedList, Map, Set, Queue, PriorityQueue, Stack, BitArray, BitList). On the outside, PTL containers are very similar to containers that many developers are already familiar with, but they have an innovative and proprietary underlying design, which is very conducive to parallelism. This design also allows resizable containers to increase and decrease their size in amortized constant time (no weak worst-case).

The containers contain parallel versions of many common methods (e.g. Add, Assign, Contains, CopyTo, Equals, Erase, IndexOf, Insert, Remove, RemoveAt). In addition, all of the algorithms from PTL's Iterator Algorithms component can be used with any of the containers from the Containers component.

All containers provide iterators that allow the contained objects (elements) to be addressed. Every container defines its iterators and the member functions that create them (e.g. Begin(), End()). Iterators are the primary interface between algorithms and containers.

You can use the PTL Iterator Algorithms component with PTL containers, and you can also design your own algorithms that work with PTL containers by implementing the Iterator interfaces from the Progeneric.PTL.Interfaces component. The Interfaces component is bundled with the Containers component, and you can view its online documentation for more information.

Better by Design

  • Resizable containers can increase and decrease their size in amortized constant time (no weak worst-case).
  • Most containers are defined in pairs: 32-bit and 64-bit versions (e.g. List32, List64). They can coexist in the same environment (32-bit or 64-bit OS), allowing easy transition to 64-bit operating systems.
  • All of the containers provide sentinel iterators (before the first element and after the last element) that are required by a lot of algorithms to function properly.
  • Many container methods also have a parallel version that can tremendously improve the execution speed.
  • All List containers implement very efficient push and pop methods on both ends (PushFront, PopFront, PushBack and PopBack).