Crypto++
8.6
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
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);}
265 template<>
inline void swap(CryptoPP::ByteQueue &a, CryptoPP::ByteQueue &b)
Helper class to finalize Puts on ByteQueue.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
void swap(::SecBlock< T, A > &a, ::SecBlock< T, A > &b)
Swap two SecBlocks.
void FinalizeLazyPut()
Insert data in the queue.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
Data structure used to store byte strings.
void SetNodeSize(size_t nodeSize)
Set node size.
LazyPutter(ByteQueue &bq, const byte *inString, size_t size)
Construct a LazyPutter.
void swap(ByteQueue &rhs)
Swap contents with another ByteQueue.
size_t Get(byte *outString, size_t getMax)
Retrieve a block of bytes.
Walker(const ByteQueue &queue)
Construct a ByteQueue Walker.
void LazyPutModifiable(byte *inString, size_t size)
Insert data in the queue.
size_t Get(byte *outString, size_t getMax)
Retrieve a block of bytes.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.
ByteQueue & operator=(const ByteQueue &rhs)
Assign contents from another ByteQueue.
byte operator[](lword index) const
Retrieve data from the queue.
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true)
Transfer bytes from this object to another BufferedTransformation.
ByteQueue(size_t nodeSize=0)
Construct a ByteQueue.
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
size_t Peek(byte *outString, size_t peekMax) const
Peek a block of bytes.
ByteQueue(const ByteQueue ©)
Copy construct a ByteQueue.
Classes providing basic library services.
LazyPutterModifiable(ByteQueue &bq, byte *inString, size_t size)
Construct a LazyPutterModifiable.
Base class for all exceptions thrown by the library.
bool operator==(const OID &lhs, const OID &rhs)
Compare two OIDs for equality.
void Unget(byte inByte)
Insert data in the queue.
size_t Peek(byte &outByte) const
Peek a 8-bit byte.
Helper class to finalize Puts on ByteQueue.
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 Clear()
Empty the queue.
size_t Get(byte &outByte)
Retrieve a 8-bit byte.
const byte * Spy(size_t &contiguousSize) const
Peek data in the queue.
bool operator!=(const ByteQueue &rhs) const
Bitwise compare two ByteQueue.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
void Unget(const byte *inString, size_t length)
Insert data in the queue.
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.
Base class for bufferless filters.
word64 lword
Large word type.
lword CurrentSize() const
Determine data size.
bool AnyRetrievable() const
Determines whether bytes are ready for retrieval.
void UndoLazyPut(size_t size)
Remove data from the queue.
Crypto++ library namespace.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
bool IsEmpty() const
Determine data availability.
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.
size_t Get(byte &outByte)
Retrieve a 8-bit byte.
size_t Peek(byte &outByte) const
Peek a 8-bit byte.
size_t Peek(byte *outString, size_t peekMax) const
Peek a block of bytes.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
const lword LWORD_MAX
Large word type max value.
Interface for retrieving values given their names.
Abstract base classes that provide a uniform interface to this library.
bool operator==(const ByteQueue &rhs) const
Bitwise compare two ByteQueue.
void LazyPut(const byte *inString, size_t size)
Insert data in the queue.