renamed FIFOBuffer => BasicFIFOBufer, FIFOBuffer typedef, renamed Bufer::allocated() => Buffer:capacity() to match STL convention

This commit is contained in:
Aleksandar Fabijanic
2012-04-29 02:37:54 +00:00
parent d22ecbaa3e
commit e10566779e
3 changed files with 33 additions and 24 deletions

View File

@@ -52,7 +52,7 @@ namespace Poco {
template <class T>
class FIFOBuffer
class BasicFIFOBuffer
/// A simple buffer class with support for re-entrant,
/// FIFO-style read/write operations. as well as
/// empty/full transition notifications. Buffer size
@@ -63,6 +63,8 @@ class FIFOBuffer
/// is needed.
{
public:
typedef T Type;
mutable Poco::BasicEvent<bool> Writable;
/// Event indicating "writeability" of the buffer,
/// triggerred as follows:
@@ -87,7 +89,7 @@ public:
/// Readable event observers are notified, with true value
/// as the argument
FIFOBuffer(std::size_t size, bool notify = false):
BasicFIFOBuffer(std::size_t size, bool notify = false):
_buffer(size),
_begin(0),
_used(0),
@@ -96,7 +98,7 @@ public:
{
}
~FIFOBuffer()
~BasicFIFOBuffer()
/// Destroys the FIFOBuffer.
{
}
@@ -253,9 +255,9 @@ private:
Writable.notify(this, f);
}
FIFOBuffer();
FIFOBuffer(const FIFOBuffer&);
FIFOBuffer& operator = (const FIFOBuffer&);
BasicFIFOBuffer();
BasicFIFOBuffer(const BasicFIFOBuffer&);
BasicFIFOBuffer& operator = (const BasicFIFOBuffer&);
Buffer<T> _buffer;
std::size_t _begin;
@@ -265,6 +267,12 @@ private:
};
//
// We provide an instantiation for char
//
typedef BasicFIFOBuffer<char> FIFOBuffer;
} // namespace Poco