Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CStreamBuffer.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2002 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  */
00014 
00015 #ifndef CSTREAMBUFFER_H
00016 #define CSTREAMBUFFER_H
00017 
00018 #include "BasicTypes.h"
00019 #include "stdlist.h"
00020 #include "stdvector.h"
00021 
00023 
00026 class CStreamBuffer {
00027 public:
00028     CStreamBuffer();
00029     ~CStreamBuffer();
00030 
00032 
00033 
00035 
00040     const void*         peek(UInt32 n);
00041 
00043 
00047     void                pop(UInt32 n);
00048 
00050 
00053     void                write(const void* data, UInt32 n);
00054 
00056 
00057 
00058 
00060 
00063     UInt32              getSize() const;
00064 
00066 
00067 private:
00068     static const UInt32 kChunkSize;
00069 
00070     typedef std::vector<UInt8> Chunk;
00071     typedef std::list<Chunk> ChunkList;
00072 
00073     ChunkList           m_chunks;
00074     UInt32              m_size;
00075     UInt32              m_headUsed;
00076 };
00077 
00078 #endif

Generated on Fri Nov 6 00:21:14 2009 for synergy-plus by  doxygen 1.3.9.1