4 * Queue - a tester of the PQueueChannel class in pwlib
6 * Copyright (c) 2006 Derek J Smithies
8 * The contents of this file are subject to the Mozilla Public License
9 * Version 1.0 (the "License"); you may not use this file except in
10 * compliance with the License. You may obtain a copy of the License at
11 * http://www.mozilla.org/MPL/
13 * Software distributed under the License is distributed on an "AS IS"
14 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15 * the License for the specific language governing rights and limitations
18 * The Original Code is Jester
20 * The Initial Developer of the Original Code is Derek J Smithies
22 * Contributor(s): ______________________________________.
25 * Revision 1.2 2006/12/07 20:49:39 dereksmithies
26 * Add doxygen comments to this program.
27 * Add doxygen configure file.
29 * Revision 1.1 2006/12/07 08:46:17 dereksmithies
30 * Initial cut of code to test the operation of PQueueChannel class.
38 #include <ptlib/pprocess.h>
39 #include <ptclib/delaychan.h>
40 #include <ptclib/qchannel.h>
43 /** The main class that is instantiated to do things */
44 class QueueProcess
: public PProcess
46 PCLASSINFO(QueueProcess
, PProcess
)
49 /**Constructor, which initalises version number, application name etc*/
52 /**Execution starts here, where the command line is processed. In here, the
53 child threads (for generating and consuming data) are launched. */
59 /**Generate a Block of data, (an array of bytes) and push them onto the
60 PQueueChannel class, at some user specified rate. The rate of writing
61 the data can be different to the rate of reading the data */
62 virtual void GenerateBlockData(PThread
&, INT
);
64 PDECLARE_NOTIFIER(PThread
, QueueProcess
, GenerateBlockData
);
68 /**Read in a block of data (an array of bytes) from the PQueueChannel
69 class at some user specified rate. The rate of reading the data can be
70 different to the rate of writing the data */
71 virtual void ConsumeBlockData(PThread
&, INT
);
73 PDECLARE_NOTIFIER(PThread
, QueueProcess
, ConsumeBlockData
);
76 /**The class that acts as a queue */
79 /**The number of iterations we run for */
82 /**The delay (in ms) between consecutive writes */
85 /**the delay (in ms) between consucutive reads */
88 /**The size (in bytes) of each write block */
91 /**The size (in bytes) of each read block */
96 #endif // _QUEUE_MAIN_H
99 // End of File ///////////////////////////////////////////////////////////////