6#ifndef CRYPTOPP_QUEUE_H
7#define CRYPTOPP_QUEUE_H
41 {
return CurrentSize();}
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;
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);
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;
191 const ByteQueueNode *m_node;
194 const byte *m_lazyString;
201 void CleanupUsedNodes();
206 ByteQueueNode *m_head, *m_tail;
210 bool m_lazyStringModifiable;
222 try {m_bq.FinalizeLazyPut();}
234 : m_bq(bq) {bq.
LazyPut(inString, size);}
265template<>
inline void swap(CryptoPP::ByteQueue &a, CryptoPP::ByteQueue &b)
bool operator==(const OID &lhs, const OID &rhs)
Compare two OIDs for equality.
Base class for bufferless filters.
size_t Peek(byte *outString, size_t peekMax) const
Peek a block of bytes.
size_t Get(byte &outByte)
Retrieve a 8-bit byte.
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true)
Transfer bytes from this object to another BufferedTransformation.
size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const
Copy bytes from this object to another BufferedTransformation.
Walker(const ByteQueue &queue)
Construct a ByteQueue Walker.
size_t Peek(byte &outByte) const
Peek a 8-bit byte.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
size_t Get(byte *outString, size_t getMax)
Retrieve a block of bytes.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
Data structure used to store byte strings.
lword CurrentSize() const
Determine data size.
ByteQueue(const ByteQueue ©)
Copy construct a ByteQueue.
void LazyPut(const byte *inString, size_t size)
Insert data in the queue.
size_t Get(byte &outByte)
Retrieve a 8-bit byte.
byte operator[](lword index) const
Retrieve data from the queue.
void Clear()
Empty the queue.
void Unget(const byte *inString, size_t length)
Insert data in the queue.
void SetNodeSize(size_t nodeSize)
Set node size.
size_t Peek(byte &outByte) const
Peek a 8-bit byte.
bool operator==(const ByteQueue &rhs) const
Bitwise compare two ByteQueue.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
void FinalizeLazyPut()
Insert data in the queue.
size_t Peek(byte *outString, size_t peekMax) const
Peek a block of bytes.
ByteQueue & operator=(const ByteQueue &rhs)
Assign contents from another ByteQueue.
ByteQueue(size_t nodeSize=0)
Construct a ByteQueue.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
size_t Get(byte *outString, size_t getMax)
Retrieve a block of bytes.
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true)
Transfer bytes from this object to another BufferedTransformation.
void UndoLazyPut(size_t size)
Remove data from the queue.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
void Unget(byte inByte)
Insert data in the queue.
bool IsEmpty() const
Determine data availability.
void LazyPutModifiable(byte *inString, size_t size)
Insert data in the queue.
bool operator!=(const ByteQueue &rhs) const
Bitwise compare two ByteQueue.
void swap(ByteQueue &rhs)
Swap contents with another ByteQueue.
bool AnyRetrievable() const
Determines whether bytes are ready for retrieval.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const
Copy bytes from this object to another BufferedTransformation.
const byte * Spy(size_t &contiguousSize) const
Peek data in the queue.
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.
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
Crypto++ library namespace.
void swap(::SecBlock< T, A > &a, ::SecBlock< T, A > &b)
Swap two SecBlocks.
Classes providing basic library services.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.