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)
bool operator==(const OID &lhs, const OID &rhs)
Compare two OIDs for equality.
bool operator!=(const OID &lhs, const OID &rhs)
Compare two OIDs for inequality.
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.
ByteQueue(const ByteQueue ©)
Copy construct a ByteQueue.
byte * CreatePutSpace(size_t &size)
Request space which can be written into by the caller.
size_t Get(byte &outByte)
Retrieve a 8-bit byte.
size_t Peek(byte &outByte) const
Peek a 8-bit byte.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
size_t Peek(byte *outString, size_t peekMax) const
Peek a block of bytes.
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.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
bool AnyRetrievable() const
Determines whether bytes are 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 all exceptions thrown by the library.
use this to make sure LazyPut is finalized in event of exception
like LazyPutter, but does a LazyPutModifiable instead
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.