Fixed DevStudio 2003 build with memory check code.
[pwlib.git] / samples / queue / main.h
blob4774d64869005d41e83b98f518ce827557a108a4
1 /*
2 * main.h
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
16 * under the License.
18 * The Original Code is Jester
20 * The Initial Developer of the Original Code is Derek J Smithies
22 * Contributor(s): ______________________________________.
24 * $Log$
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.
35 #ifndef _QUEUE_MAIN_H
36 #define _QUEUE_MAIN_H
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)
48 public:
49 /**Constructor, which initalises version number, application name etc*/
50 QueueProcess();
52 /**Execution starts here, where the command line is processed. In here, the
53 child threads (for generating and consuming data) are launched. */
54 void Main();
56 protected:
58 #ifdef DOC_PLUS_PLUS
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);
63 #else
64 PDECLARE_NOTIFIER(PThread, QueueProcess, GenerateBlockData);
65 #endif
67 #ifdef DOC_PLUS_PLUS
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);
72 #else
73 PDECLARE_NOTIFIER(PThread, QueueProcess, ConsumeBlockData);
74 #endif
76 /**The class that acts as a queue */
77 PQueueChannel queue;
79 /**The number of iterations we run for */
80 PINDEX iterations;
82 /**The delay (in ms) between consecutive writes */
83 PINDEX writeDelay;
85 /**the delay (in ms) between consucutive reads */
86 PINDEX readDelay;
88 /**The size (in bytes) of each write block */
89 PINDEX writeSize;
91 /**The size (in bytes) of each read block */
92 PINDEX readSize;
96 #endif // _QUEUE_MAIN_H
99 // End of File ///////////////////////////////////////////////////////////////