FIFOBufferStream (g++ pacify)
This commit is contained in:
Родитель
cfbcce0481
Коммит
69bd6f6ee9
|
@ -12,8 +12,8 @@ objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel Base64Decoder Base64E
|
||||||
BinaryReader BinaryWriter Bugcheck ByteOrder Channel Checksum Configurable ConsoleChannel \
|
BinaryReader BinaryWriter Bugcheck ByteOrder Channel Checksum Configurable ConsoleChannel \
|
||||||
CountingStream DateTime LocalDateTime DateTimeFormat DateTimeFormatter DateTimeParser \
|
CountingStream DateTime LocalDateTime DateTimeFormat DateTimeFormatter DateTimeParser \
|
||||||
Debugger DeflatingStream DigestEngine DigestStream DirectoryIterator \
|
Debugger DeflatingStream DigestEngine DigestStream DirectoryIterator \
|
||||||
Environment Event EventArgs ErrorHandler Exception FPEnvironment File Glob \
|
Environment Event EventArgs ErrorHandler Exception FIFOBufferStream FPEnvironment File \
|
||||||
FileChannel Formatter FormattingChannel HexBinaryDecoder LineEndingConverter \
|
FileChannel Formatter FormattingChannel Glob HexBinaryDecoder LineEndingConverter \
|
||||||
HexBinaryEncoder InflatingStream Latin1Encoding Latin2Encoding Latin9Encoding LogFile \
|
HexBinaryEncoder InflatingStream Latin1Encoding Latin2Encoding Latin9Encoding LogFile \
|
||||||
Logger LoggingFactory LoggingRegistry LogStream NamedEvent NamedMutex NullChannel \
|
Logger LoggingFactory LoggingRegistry LogStream NamedEvent NamedMutex NullChannel \
|
||||||
MemoryPool MD4Engine MD5Engine Manifest Message Mutex \
|
MemoryPool MD4Engine MD5Engine Manifest Message Mutex \
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "Poco/Foundation.h"
|
#include "Poco/Foundation.h"
|
||||||
|
#include "Poco/Exception.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
|
@ -134,7 +135,7 @@ public:
|
||||||
/// is thrown.
|
/// is thrown.
|
||||||
{
|
{
|
||||||
if (!_ownMem)
|
if (!_ownMem)
|
||||||
throw InvalidAccessException("Cannot resize buffer which does not own its storage.");
|
throw Poco::InvalidAccessException("Cannot resize buffer which does not own its storage.");
|
||||||
|
|
||||||
poco_assert(newCapacity);
|
poco_assert(newCapacity);
|
||||||
|
|
||||||
|
|
|
@ -132,8 +132,8 @@ class Foundation_API FIFOBufferStream: public FIFOIOS, public std::iostream
|
||||||
/// An output stream for writing to a FIFO.
|
/// An output stream for writing to a FIFO.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Poco::BasicEvent<bool>& writable;
|
|
||||||
Poco::BasicEvent<bool>& readable;
|
Poco::BasicEvent<bool>& readable;
|
||||||
|
Poco::BasicEvent<bool>& writable;
|
||||||
|
|
||||||
explicit FIFOBufferStream(FIFOBuffer& buffer);
|
explicit FIFOBufferStream(FIFOBuffer& buffer);
|
||||||
/// Creates the FIFOBufferStream with supplied buffer as initial value.
|
/// Creates the FIFOBufferStream with supplied buffer as initial value.
|
||||||
|
|
|
@ -166,36 +166,36 @@ void FIFOIOS::close()
|
||||||
|
|
||||||
FIFOBufferStream::FIFOBufferStream(FIFOBuffer& fifoBuffer):
|
FIFOBufferStream::FIFOBufferStream(FIFOBuffer& fifoBuffer):
|
||||||
FIFOIOS(fifoBuffer),
|
FIFOIOS(fifoBuffer),
|
||||||
|
std::iostream(&_buf),
|
||||||
readable(_buf.fifoBuffer().readable),
|
readable(_buf.fifoBuffer().readable),
|
||||||
writable(_buf.fifoBuffer().writable),
|
writable(_buf.fifoBuffer().writable)
|
||||||
std::iostream(&_buf)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FIFOBufferStream::FIFOBufferStream(char* pBuffer, std::size_t length):
|
FIFOBufferStream::FIFOBufferStream(char* pBuffer, std::size_t length):
|
||||||
FIFOIOS(pBuffer, length),
|
FIFOIOS(pBuffer, length),
|
||||||
|
std::iostream(&_buf),
|
||||||
readable(_buf.fifoBuffer().readable),
|
readable(_buf.fifoBuffer().readable),
|
||||||
writable(_buf.fifoBuffer().writable),
|
writable(_buf.fifoBuffer().writable)
|
||||||
std::iostream(&_buf)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FIFOBufferStream::FIFOBufferStream(const char* pBuffer, std::size_t length):
|
FIFOBufferStream::FIFOBufferStream(const char* pBuffer, std::size_t length):
|
||||||
FIFOIOS(pBuffer, length),
|
FIFOIOS(pBuffer, length),
|
||||||
|
std::iostream(&_buf),
|
||||||
readable(_buf.fifoBuffer().readable),
|
readable(_buf.fifoBuffer().readable),
|
||||||
writable(_buf.fifoBuffer().writable),
|
writable(_buf.fifoBuffer().writable)
|
||||||
std::iostream(&_buf)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FIFOBufferStream::FIFOBufferStream(std::size_t length):
|
FIFOBufferStream::FIFOBufferStream(std::size_t length):
|
||||||
FIFOIOS(length),
|
FIFOIOS(length),
|
||||||
|
std::iostream(&_buf),
|
||||||
readable(_buf.fifoBuffer().readable),
|
readable(_buf.fifoBuffer().readable),
|
||||||
writable(_buf.fifoBuffer().writable),
|
writable(_buf.fifoBuffer().writable)
|
||||||
std::iostream(&_buf)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ objects = ActiveMethodTest ActivityTest ActiveDispatcherTest \
|
||||||
CountingStreamTest CryptTestSuite DateTimeFormatterTest \
|
CountingStreamTest CryptTestSuite DateTimeFormatterTest \
|
||||||
DateTimeParserTest DateTimeTest LocalDateTimeTest DateTimeTestSuite DigestStreamTest \
|
DateTimeParserTest DateTimeTest LocalDateTimeTest DateTimeTestSuite DigestStreamTest \
|
||||||
Driver DynamicFactoryTest FPETest FileChannelTest FileTest GlobTest FilesystemTestSuite \
|
Driver DynamicFactoryTest FPETest FileChannelTest FileTest GlobTest FilesystemTestSuite \
|
||||||
FoundationTestSuite HMACEngineTest HexBinaryTest LoggerTest \
|
FIFOBufferStreamTest FoundationTestSuite HMACEngineTest HexBinaryTest LoggerTest \
|
||||||
LoggingFactoryTest LoggingRegistryTest LoggingTestSuite LogStreamTest \
|
LoggingFactoryTest LoggingRegistryTest LoggingTestSuite LogStreamTest \
|
||||||
NamedEventTest NamedMutexTest ProcessesTestSuite ProcessTest \
|
NamedEventTest NamedMutexTest ProcessesTestSuite ProcessTest \
|
||||||
MemoryPoolTest MD4EngineTest MD5EngineTest ManifestTest \
|
MemoryPoolTest MD4EngineTest MD5EngineTest ManifestTest \
|
||||||
|
|
|
@ -169,6 +169,8 @@ void FIFOBufferStreamTest::testNotify()
|
||||||
assert (1 == _writableToNot);
|
assert (1 == _writableToNot);
|
||||||
assert (1 == _notToWritable);
|
assert (1 == _notToWritable);
|
||||||
|
|
||||||
|
iostr.clear();
|
||||||
|
assert (iostr.good());
|
||||||
iostr << "This is a test " << 42 << std::ends << std::flush;
|
iostr << "This is a test " << 42 << std::ends << std::flush;
|
||||||
assert (iostr.rdbuf()->fifoBuffer().isFull());
|
assert (iostr.rdbuf()->fifoBuffer().isFull());
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче