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();}
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;
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();
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;
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.
Data structure used to store byte strings.
LazyPutter(ByteQueue &bq, const byte *inString, size_t size)
Construct a LazyPutter.
Walker(const ByteQueue &queue)
Construct a ByteQueue Walker.
void LazyPutModifiable(byte *inString, size_t size)
Insert data in the queue.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
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.
Helper class to finalize Puts on ByteQueue.
bool operator!=(const ByteQueue &rhs) const
Bitwise compare two ByteQueue.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
Base class for bufferless filters.
word64 lword
Large word type.
bool AnyRetrievable() const
Determines whether bytes are ready for retrieval.
Crypto++ library namespace.
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.
void LazyPut(const byte *inString, size_t size)
Insert data in the queue.