6#ifndef CRYPTOPP_QUEUE_H
7#define CRYPTOPP_QUEUE_H
12NAMESPACE_BEGIN(CryptoPP)
41 {
return CurrentSize();}
46 byte * CreatePutSpace(
size_t &size);
47 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
49 size_t Get(
byte &outByte);
50 size_t Get(
byte *outString,
size_t getMax);
52 size_t Peek(
byte &outByte)
const;
53 size_t Peek(
byte *outString,
size_t peekMax)
const;
55 size_t TransferTo2(
BufferedTransformation &target,
lword &transferBytes,
const std::string &channel=DEFAULT_CHANNEL,
bool blocking=
true);
61 void SetNodeSize(
size_t nodeSize);
65 lword CurrentSize()
const;
77 void Unget(
byte inByte);
83 void Unget(
const byte *inString,
size_t length);
93 const byte * Spy(
size_t &contiguousSize)
const;
105 void LazyPut(
const byte *inString,
size_t size);
117 void LazyPutModifiable(
byte *inString,
size_t size);
126 void UndoLazyPut(
size_t size);
132 void FinalizeLazyPut();
144 bool operator==(
const ByteQueue &rhs)
const;
157 byte operator[](
lword index)
const;
170 : m_queue(queue), m_node(NULLPTR), m_position(0), m_offset(0), m_lazyString(NULLPTR), m_lazyLength(0)
173 lword GetCurrentPosition() {
return m_position;}
176 {
return m_queue.CurrentSize() - m_position;}
180 size_t Get(
byte &outByte);
181 size_t Get(
byte *outString,
size_t getMax);
183 size_t Peek(
byte &outByte)
const;
184 size_t Peek(
byte *outString,
size_t peekMax)
const;
186 size_t TransferTo2(
BufferedTransformation &target,
lword &transferBytes,
const std::string &channel=DEFAULT_CHANNEL,
bool blocking=
true);
194 const byte *m_lazyString;
201 void CleanupUsedNodes();
210 bool m_lazyStringModifiable;
222 try {m_bq.FinalizeLazyPut();}
223 catch(
const Exception&) {CRYPTOPP_ASSERT(0);}
234 : m_bq(bq) {bq.
LazyPut(inString, size);}
265template<>
inline void swap(CryptoPP::ByteQueue &a, CryptoPP::ByteQueue &b)
Base class for bufferless filters.
Walker(const ByteQueue &queue)
Construct a ByteQueue Walker.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
Data structure used to store byte strings.
void LazyPut(const byte *inString, size_t size)
Insert data in the queue.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
void LazyPutModifiable(byte *inString, size_t size)
Insert data in the queue.
bool operator!=(const ByteQueue &rhs) const
Bitwise compare two ByteQueue.
bool AnyRetrievable() const
Determines whether bytes are ready for retrieval.
Base class for all exceptions thrown by the library.
Helper class to finalize Puts on ByteQueue.
LazyPutter(ByteQueue &bq, const byte *inString, size_t size)
Construct a LazyPutter.
Helper class to finalize Puts on ByteQueue.
LazyPutterModifiable(ByteQueue &bq, byte *inString, size_t size)
Construct a LazyPutterModifiable.
Interface for retrieving values given their names.
const lword LWORD_MAX
Large word type max value.
word64 lword
Large word type.
Abstract base classes that provide a uniform interface to this library.
Classes providing basic library services.