1 #ifndef CRYPTOPP_MQUEUE_H
2 #define CRYPTOPP_MQUEUE_H
8 NAMESPACE_BEGIN(CryptoPP)
17 {m_queue.IsolatedInitialize(parameters); m_lengths.assign(1, 0U); m_messageCounts.assign(1, 0U);}
18 size_t Put2(
const byte *begin,
size_t length,
int messageEnd,
bool blocking)
20 m_queue.Put(begin, length);
21 m_lengths.back() += length;
24 m_lengths.push_back(0);
25 m_messageCounts.back()++;
29 bool IsolatedFlush(
bool hardFlush,
bool blocking) {
return false;}
30 bool IsolatedMessageSeriesEnd(
bool blocking)
31 {m_messageCounts.push_back(0);
return false;}
33 lword MaxRetrievable()
const
34 {
return m_lengths.front();}
35 bool AnyRetrievable()
const
36 {
return m_lengths.front() > 0;}
38 size_t TransferTo2(BufferedTransformation &target, lword &transferBytes,
const std::string &channel=DEFAULT_CHANNEL,
bool blocking=
true);
39 size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX,
const std::string &channel=DEFAULT_CHANNEL,
bool blocking=
true)
const;
41 lword TotalBytesRetrievable()
const
42 {
return m_queue.MaxRetrievable();}
43 unsigned int NumberOfMessages()
const
44 {
return (
unsigned int)m_lengths.size()-1;}
45 bool GetNextMessage();
47 unsigned int NumberOfMessagesInThisSeries()
const
48 {
return m_messageCounts[0];}
49 unsigned int NumberOfMessageSeries()
const
50 {
return (
unsigned int)m_messageCounts.size()-1;}
52 unsigned int CopyMessagesTo(BufferedTransformation &target,
unsigned int count=UINT_MAX,
const std::string &channel=DEFAULT_CHANNEL)
const;
54 const byte * Spy(
size_t &contiguousSize)
const;
60 std::deque<lword> m_lengths;
61 std::deque<unsigned int> m_messageCounts;
72 EqualityComparisonFilter(BufferedTransformation *attachment=NULL,
bool throwIfNotEqual=
true,
const std::string &firstChannel=
"0",
const std::string &secondChannel=
"1")
73 : m_throwIfNotEqual(throwIfNotEqual), m_mismatchDetected(false)
74 , m_firstChannel(firstChannel), m_secondChannel(secondChannel)
77 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking);
78 bool ChannelMessageSeriesEnd(
const std::string &channel,
int propagation=-1,
bool blocking=
true);
81 unsigned int MapChannel(
const std::string &channel)
const;
82 bool HandleMismatchDetected(
bool blocking);
84 bool m_throwIfNotEqual, m_mismatchDetected;
85 std::string m_firstChannel, m_secondChannel;