Bill Baldwin's Queue Requirements
I had not originally thought to write any requirements for this project because (1) I have a decent idea of what I want, and
(2) I do not need to communicate this with any software engineer to implement it (I'll do that).
However, I decided that it would be a good idea, both to show that I do think about this, and because it has been a while since I
thought about this, and I may not be that sure of what I want.
This is the list of requirements.
-
The data structure will be a queue of characters.
-
There will be no peek capabilities.
-
The initial implementation will be a circular array queue.
-
It will be assumed that only one thread will remove characters from the queue at a time. That is, possible contention on the
use of the queue by threads will be resolved outside of this code.
-
The interface going into the queue and coming out of the queue will be the same so that code could be debugged without the
queue, and then have the queue inserted with no other changes to the code required.
-
The Queue will be created as a COM object. (I will not say ATL because I really don't care. The ATL is an implementation consideration.)
-
The Queue will have a means of accessing the other end of the queue from either end. That is, if I'm given one end, then it will be
possible for me to get a pointer to the other end.
-
The queue will be implemented in C++. Note that it is possible to write COM objects in other languages, such as C, or certainly
assembly language.
-
It will be possible to get a string of characters off the queue at one time. This will allow for the minimum number of system calls
if the input if from a serial port.
-
It will be possible to have as many instances of the queue as needed at one time.
-
The queue will hold a maximum of 4K characters at once. Later requirements may change this, perhaps making it user defined.
-
There will be a method of clearing the queue from either end.
-
There will be a time limit on the length of time the queue will wait for the buffer to be filled.
-
If the buffer is not filled, then a shorter length will be returned, and an indication that the queue was not filled. The indication will
not be viewed as an error condition.
-
The time limit will be specified by the user every time that there is a request for characters.
-
There will be a method of setting parameters for the queue from either end.
Before I begin this project I want to be sure to note that this will be copywrited code. Any use of this code for any purpose is
prohibited until I decide what to do with it. I will probably decide to release it under the famous gnu copywrite, but the decision
has not been made yet, and will not be made until the code is completed.
Last Updated September 06, 2009.
Queue index page