Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * Copyright 1995, Brown University, Providence, RI
3
 *
4
 * Permission to use and modify this software and its documentation for
5
 * any purpose other than its incorporation into a commercial product is
6
 * hereby granted without fee.  Permission to copy and distribute this
7
 * software and its documentation only for non-commercial use is also
8
 * granted without fee, provided, however, that the above copyright notice
9
 * appear in all copies, that both that copyright notice and this permission
10
 * notice appear in supporting documentation, that the name of Brown
11
 * University not be used in advertising or publicity pertaining to
12
 * distribution of the software without specific, written prior permission,
13
 * and that the person doing the distribution notify Brown University of
14
 * such distributions outside of his or her organization. Brown University
15
 * makes no representations about the suitability of this software for
16
 * any purpose.  It is provided "as is" without express or implied warranty.
17
 * Brown University requests notification of any modifications to this
18
 * software or its documentation.
19
 *
20
 * Send the following redistribution information:
21
 *
22
 *      Name:
23
 *      Organization:
24
 *      Address (postal and/or electronic):
25
 *
26
 * To:
27
 *      Software Librarian
28
 *      Computer Science Department, Box 1910
29
 *      Brown University
30
 *      Providence, RI 02912
31
 *
32
 *              or
33
 *
34
 *      brusd@cs.brown.edu
35
 *
36
 * We will acknowledge all electronic notifications.
37
 */
38
 
39
#ifndef BUFFER_CLASS_DEF
40
class BUFFER {
41
  public:
42
    BUFFER(int itemSize, int bytesGet=4, int bytesSave=3, int stepSize=25);
43
    ~BUFFER();
44
    int addToBuffer(void *item);
45
    const char * const nextBufferItem(int *looped);
46
  private:
47
    int _size, bufferSize, location, firstRetrieve;
48
    const int _bytesGet, _bytesSave, _stepSize, sizeGet;
49
    int sizeSave;
50
    char *tmpBlock;
51
    char **buffer;
52
    static long totalAllocated;
53
};
54
#define BUFFER_CLASS_DEF
55
#endif