diff options
Diffstat (limited to 'indra/llmessage/llioutil.cpp')
-rw-r--r-- | indra/llmessage/llioutil.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/indra/llmessage/llioutil.cpp b/indra/llmessage/llioutil.cpp new file mode 100644 index 0000000000..b0369439e6 --- /dev/null +++ b/indra/llmessage/llioutil.cpp @@ -0,0 +1,76 @@ +/** + * @file llioutil.cpp + * @author Phoenix + * @date 2005-10-05 + * @brief Utility functionality for the io pipes. + * + * Copyright (c) 2005-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "linden_common.h" +#include "llioutil.h" + +/** + * LLIOFlush + */ +LLIOPipe::EStatus LLIOFlush::process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump) +{ + eos = true; + return STATUS_OK; +} + +/** + * @class LLIOSleep + */ +LLIOPipe::EStatus LLIOSleep::process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump) +{ + if(mSeconds > 0.0) + { + if(pump) pump->sleepChain(mSeconds); + mSeconds = 0.0; + return STATUS_BREAK; + } + return STATUS_DONE; +} + +/** + * @class LLIOAddChain + */ +LLIOPipe::EStatus LLIOAddChain::process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump) +{ + pump->addChain(mChain, mTimeout); + return STATUS_DONE; +} + +/** + * LLChangeChannel + */ +LLChangeChannel::LLChangeChannel(S32 is, S32 becomes) : + mIs(is), + mBecomes(becomes) +{ +} + +void LLChangeChannel::operator()(LLSegment& segment) +{ + if(segment.isOnChannel(mIs)) + { + segment.setChannel(mBecomes); + } +} |