Please Note: MaxQueue
requires StringTheory and Reflection
One of Clarions strongest features is a built-in data structure known as a
Queue. MaxQueue builds on this feature, making queues more powerful,
easier and safer to use.
Global Unthreaded Queues
Global, Unthreaded Queues are bad because they are
not thread safe. They were popular in Clarion 5.5 and earlier (because
they could be safely used there) but from Clarion 6 they became unsafe,
and should be removed, where possible from a program. Unfortunately in
large programs this is easier said than done, and replacing global
unthreaded queues (with memory tables, or whatever) can be a large task.
MaxQueue offers an alternative to replacing global unthreaded queues, by
making them thread safe. Changes are made at the global declaration
level, but existing code which access the queue remains unaltered. [1]
This increases the safety of the global queue, while at the same time
reducing the number of changes required to existing code.
[1] Not all the queue functions are duplicated, so there are some
possible places in the code where a compile error may occur. A simple
alternate line of code can easily be used in these situations. The
compiler will alert you to places where this is necessary.
Extended Queue Syntax (More Methods!)
While the supplied Queue procedures are adequate to
read and write to the queue, there are cases where the syntax is clumsy.
It is also notable that the syntax is similar to, but does not match the
syntax for the file drivers. MaxQueue offers additional methods which
can make processing queues simpler and more intuitive (and in some cases
faster).
New methods include Set, Next, Previous, Copy, Merge, Add, Subtract and
more.
Load and Save
Queues can be loaded from and to either StringTheory
objects, or a text file, using Load, Save, LoadFile,SaveFile.
Queues In Queues
It is possible, and reasonably straight-forward to
create Queues-in-Queues. However working with these can tricky, and if
they are not free'd correctly then they can lead to memory leaks. By
linking into the
Reflection accessory (which is free) safe Queue
disposes are done internally using the normal FREE method.
CapeSoft believes that if you aren't satisfied with
our products, we would like them back - and we will refund you the money.
This allows you to purchase our products with confidence. You can read our
full refund policy
here.