return head_.get();
}
+ /**
+ * returns the first IOBuf in the chain and removes it from the chain
+ *
+ * @return first IOBuf in the chain or nullptr if none.
+ */
+ std::unique_ptr<folly::IOBuf> pop_front();
+
/**
* Total chain length, only valid if cacheLength was specified in the
* constructor.
return chainLength_;
}
+ /**
+ * Returns true iff the IOBuf chain length is 0.
+ */
+ bool empty() const {
+ return !head_ || head_->empty();
+ }
+
const Options& options() const {
return options_;
}
+ /**
+ * Clear the queue. Note that this does not release the buffers, it
+ * just sets their length to zero; useful if you want to reuse the
+ * same queue without reallocating.
+ */
+ void clear();
+
/** Movable */
IOBufQueue(IOBufQueue&&);
IOBufQueue& operator=(IOBufQueue&&);