Crypto++
8.4
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
6 #ifndef CRYPTOPP_QUEUE_H
7 #define CRYPTOPP_QUEUE_H
34 {
return CurrentSize();}
40 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
42 size_t Get(
byte &outByte);
43 size_t Get(
byte *outString,
size_t getMax);
45 size_t Peek(
byte &outByte)
const;
46 size_t Peek(
byte *outString,
size_t peekMax)
const;
52 void SetNodeSize(
size_t nodeSize);
54 lword CurrentSize()
const;
59 void Unget(
byte inByte);
60 void Unget(
const byte *inString,
size_t length);
62 const byte * Spy(
size_t &contiguousSize)
const;
64 void LazyPut(
const byte *inString,
size_t size);
65 void LazyPutModifiable(
byte *inString,
size_t size);
66 void UndoLazyPut(
size_t size);
67 void FinalizeLazyPut();
72 byte operator[](
lword i)
const;
82 : m_queue(queue), m_node(NULLPTR), m_position(0), m_offset(0), m_lazyString(NULLPTR), m_lazyLength(0)
85 lword GetCurrentPosition() {
return m_position;}
88 {
return m_queue.CurrentSize() - m_position;}
92 size_t Get(
byte &outByte);
93 size_t Get(
byte *outString,
size_t getMax);
95 size_t Peek(
byte &outByte)
const;
96 size_t Peek(
byte *outString,
size_t peekMax)
const;
103 const ByteQueueNode *m_node;
106 const byte *m_lazyString;
113 void CleanupUsedNodes();
119 ByteQueueNode *m_head, *m_tail;
122 bool m_lazyStringModifiable;
130 : m_bq(bq) {bq.LazyPut(inString, size);}
144 :
LazyPutter(bq) {bq.LazyPutModifiable(inString, size);}
151 template<>
inline void swap(CryptoPP::ByteQueue &a, CryptoPP::ByteQueue &b)
use this to make sure LazyPut is finalized in event of exception
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 IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
Data structure used to store byte strings.
size_t Get(byte *outString, size_t getMax)
Retrieve a block of bytes.
Walker(const ByteQueue &queue)
Construct a ByteQueue Walker.
size_t Get(byte *outString, size_t getMax)
Retrieve a block of bytes.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.
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.
Base class for all exceptions thrown by the library.
bool operator==(const OID &lhs, const OID &rhs)
Compare two OIDs for equality.
size_t Peek(byte &outByte) const
Peek a 8-bit byte.
like LazyPutter, but does a LazyPutModifiable instead
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 Get(byte &outByte)
Retrieve a 8-bit byte.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
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.
bool AnyRetrievable() const
Determines whether bytes are ready for retrieval.
Crypto++ library namespace.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
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.
bool operator!=(const OID &lhs, const OID &rhs)
Compare two OIDs for inequality.
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.