writEAble => writAble

This commit is contained in:
Aleksandar Fabijanic 2012-04-29 02:03:09 +00:00
parent 156a43150d
commit d22ecbaa3e
3 changed files with 33 additions and 33 deletions

View File

@ -63,16 +63,16 @@ class FIFOBuffer
/// is needed.
{
public:
mutable Poco::BasicEvent<bool> Writeable;
mutable Poco::BasicEvent<bool> Writable;
/// Event indicating "writeability" of the buffer,
/// triggerred as follows:
///
/// * when buffer transitions from non-full to full,
/// Writeable event observers are notified, with
/// Writable event observers are notified, with
/// false value as the argument
///
/// * when buffer transitions from full to non-full,
/// Writeable event observers are notified, with
/// Writable event observers are notified, with
/// true value as the argument
mutable Poco::BasicEvent<bool> Readable;
@ -248,9 +248,9 @@ private:
Readable.notify(this, f);
if (usedBefore == _buffer.size() && _used < _buffer.size())
Writeable.notify(this, t);
Writable.notify(this, t);
else if (usedBefore < _buffer.size() && _used == _buffer.size())
Writeable.notify(this, f);
Writable.notify(this, f);
}
FIFOBuffer();

View File

@ -245,7 +245,7 @@ void CoreTest::testFIFOBufferChar()
std::vector<T> v;
f.Readable += delegate(this, &CoreTest::onReadable);
f.Writeable += delegate(this, &CoreTest::onWriteable);
f.Writable += delegate(this, &CoreTest::onWritable);
for (T c = '0'; c < '0' + 10; ++c)
v.push_back(c);
@ -325,13 +325,13 @@ void CoreTest::testFIFOBufferChar()
assert(1 == _notToReadable);
assert(0 == _readableToNot);
assert(0 == _notToWriteable);
assert(0 == _writeableToNot);
assert(0 == _notToWritable);
assert(0 == _writableToNot);
f.read(b, 6);
assert(1 == _notToReadable);
assert(1 == _readableToNot);
assert(0 == _notToWriteable);
assert(0 == _writeableToNot);
assert(0 == _notToWritable);
assert(0 == _writableToNot);
assert (5 == b.size());
assert (20 == f.size());
@ -342,13 +342,13 @@ void CoreTest::testFIFOBufferChar()
assert(1 == _notToReadable);
assert(1 == _readableToNot);
assert(0 == _notToWriteable);
assert(0 == _writeableToNot);
assert(0 == _notToWritable);
assert(0 == _writableToNot);
assert (5 == f.write(b));
assert(2 == _notToReadable);
assert(1 == _readableToNot);
assert(0 == _notToWriteable);
assert(0 == _writeableToNot);
assert(0 == _notToWritable);
assert(0 == _writableToNot);
assert (20 == f.size());
assert (5 == f.used());
@ -371,13 +371,13 @@ void CoreTest::testFIFOBufferChar()
assert(2 == _notToReadable);
assert(1 == _readableToNot);
assert(0 == _notToWriteable);
assert(0 == _writeableToNot);
assert(0 == _notToWritable);
assert(0 == _writableToNot);
f.resize(3, false);
assert(2 == _notToReadable);
assert(2 == _readableToNot);
assert(0 == _notToWriteable);
assert(0 == _writeableToNot);
assert(0 == _notToWritable);
assert(0 == _writableToNot);
assert (3 == f.size());
assert (0 == f.used());
assert (f.isEmpty());
@ -390,23 +390,23 @@ void CoreTest::testFIFOBufferChar()
assert(2 == _notToReadable);
assert(2 == _readableToNot);
assert(0 == _notToWriteable);
assert(0 == _writeableToNot);
assert(0 == _notToWritable);
assert(0 == _writableToNot);
f.write(b);
assert(3 == _notToReadable);
assert(2 == _readableToNot);
assert(0 == _notToWriteable);
assert(1 == _writeableToNot);
assert(0 == _notToWritable);
assert(1 == _writableToNot);
f.read(b);
assert(3 == _notToReadable);
assert(3 == _readableToNot);
assert(1 == _notToWriteable);
assert(1 == _writeableToNot);
assert(1 == _notToWritable);
assert(1 == _writableToNot);
assert (f.isEmpty());
f.Readable -= delegate(this, &CoreTest::onReadable);
f.Writeable -= delegate(this, &CoreTest::onReadable);
f.Writable -= delegate(this, &CoreTest::onReadable);
}
@ -684,10 +684,10 @@ void CoreTest::onReadable(bool& b)
};
void CoreTest::onWriteable(bool& b)
void CoreTest::onWritable(bool& b)
{
if (b) ++_notToWriteable;
else ++_writeableToNot;
if (b) ++_notToWritable;
else ++_writableToNot;
}
@ -695,8 +695,8 @@ void CoreTest::setUp()
{
_readableToNot = 0;
_notToReadable = 0;
_writeableToNot = 0;
_notToWriteable = 0;
_writableToNot = 0;
_notToWritable = 0;
}

View File

@ -65,13 +65,13 @@ public:
protected:
void onReadable(bool& b);
void onWriteable(bool& b);
void onWritable(bool& b);
private:
int _readableToNot;
int _notToReadable;
int _writeableToNot;
int _notToWriteable;
int _writableToNot;
int _notToWritable;
};