This commit is contained in:
Jean Flach 2018-02-27 14:48:37 +01:00 committed by Gunnar Beutner
parent 6e7421eab0
commit 419103b407
2 changed files with 16 additions and 1 deletions

View File

@ -60,7 +60,7 @@ void Stream::SignalDataAvailable(void)
}
}
bool Stream::WaitForData()
bool Stream::WaitForData(void)
{
if (!SupportsWaiting())
BOOST_THROW_EXCEPTION(std::runtime_error("Stream does not support waiting."));
@ -94,6 +94,16 @@ bool Stream::WaitForData(int timeout)
static void StreamDummyCallback(void)
{ }
void Stream::SetCorked(bool corked)
{
m_Corked = corked;
}
bool Stream::IsCorked(void) const
{
return m_Corked;
}
void Stream::Close(void)
{
OnDataAvailable.disconnect_all_slots();

View File

@ -131,6 +131,9 @@ public:
virtual bool SupportsWaiting(void) const;
virtual void SetCorked(bool corked);
bool IsCorked(void) const;
virtual bool IsDataAvailable(void) const;
void RegisterDataHandler(const boost::function<void(const Stream::Ptr&)>& handler);
@ -145,6 +148,8 @@ private:
boost::mutex m_Mutex;
boost::condition_variable m_CV;
bool m_Corked{false};
};
}