亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? queue.cpp

?? 常用字符串hash算法
?? CPP
字號:
// queue.cpp - written and placed in the public domain by Wei Dai#include "pch.h"#include "queue.h"#include "filters.h"NAMESPACE_BEGIN(CryptoPP)// this class for use by ByteQueue onlyclass ByteQueueNode{public:	ByteQueueNode(unsigned int maxSize)		: buf(maxSize)	{		m_head = m_tail = 0;		next = 0;	}	inline unsigned int MaxSize() const {return buf.size();}	inline unsigned int CurrentSize() const	{		return m_tail-m_head;	}	inline bool UsedUp() const	{		return (m_head==MaxSize());	}	inline void Clear()	{		m_head = m_tail = 0;	}/*	inline unsigned int Put(byte inByte)	{		if (MaxSize()==m_tail)			return 0;		buf[m_tail++]=inByte;		return 1;	}*/	inline unsigned int Put(const byte *begin, unsigned int length)	{		unsigned int l = STDMIN(length, MaxSize()-m_tail);		memcpy(buf+m_tail, begin, l);		m_tail += l;		return l;	}	inline unsigned int Peek(byte &outByte) const	{		if (m_tail==m_head)			return 0;		outByte=buf[m_head];		return 1;	}	inline unsigned int Peek(byte *target, unsigned int copyMax) const	{		unsigned int len = STDMIN(copyMax, m_tail-m_head);		memcpy(target, buf+m_head, len);		return len;	}	inline unsigned int CopyTo(BufferedTransformation &target, const std::string &channel=BufferedTransformation::NULL_CHANNEL) const	{		unsigned int len = m_tail-m_head;		target.ChannelPut(channel, buf+m_head, len);		return len;	}	inline unsigned int CopyTo(BufferedTransformation &target, unsigned int copyMax, const std::string &channel=BufferedTransformation::NULL_CHANNEL) const	{		unsigned int len = STDMIN(copyMax, m_tail-m_head);		target.ChannelPut(channel, buf+m_head, len);		return len;	}	inline unsigned int Get(byte &outByte)	{		unsigned int len = Peek(outByte);		m_head += len;		return len;	}	inline unsigned int Get(byte *outString, unsigned int getMax)	{		unsigned int len = Peek(outString, getMax);		m_head += len;		return len;	}	inline unsigned int TransferTo(BufferedTransformation &target, const std::string &channel=BufferedTransformation::NULL_CHANNEL)	{		unsigned int len = m_tail-m_head;		target.ChannelPutModifiable(channel, buf+m_head, len);		m_head = m_tail;		return len;	}	inline unsigned int TransferTo(BufferedTransformation &target, unsigned int transferMax, const std::string &channel=BufferedTransformation::NULL_CHANNEL)	{		unsigned int len = STDMIN(transferMax, m_tail-m_head);		target.ChannelPutModifiable(channel, buf+m_head, len);		m_head += len;		return len;	}	inline unsigned int Skip(unsigned int skipMax)	{		unsigned int len = STDMIN(skipMax, m_tail-m_head);		m_head += len;		return len;	}	inline byte operator[](unsigned int i) const	{		return buf[m_head+i];	}	ByteQueueNode *next;	SecByteBlock buf;	unsigned int m_head, m_tail;};// ********************************************************ByteQueue::ByteQueue(unsigned int m_nodeSize)	: m_nodeSize(m_nodeSize), m_lazyLength(0){	m_head = m_tail = new ByteQueueNode(m_nodeSize);}ByteQueue::ByteQueue(const ByteQueue &copy){	CopyFrom(copy);}void ByteQueue::CopyFrom(const ByteQueue &copy){	m_lazyLength = 0;	m_nodeSize = copy.m_nodeSize;	m_head = m_tail = new ByteQueueNode(*copy.m_head);	for (ByteQueueNode *current=copy.m_head->next; current; current=current->next)	{		m_tail->next = new ByteQueueNode(*current);		m_tail = m_tail->next;	}	m_tail->next = NULL;	Put(copy.m_lazyString, copy.m_lazyLength);}ByteQueue::~ByteQueue(){	Destroy();}void ByteQueue::Destroy(){	ByteQueueNode *next;	for (ByteQueueNode *current=m_head; current; current=next)	{		next=current->next;		delete current;	}}void ByteQueue::IsolatedInitialize(const NameValuePairs &parameters){	m_nodeSize = parameters.GetIntValueWithDefault("NodeSize", 256);	Clear();}unsigned long ByteQueue::CurrentSize() const{	unsigned long size=0;	for (ByteQueueNode *current=m_head; current; current=current->next)		size += current->CurrentSize();	return size + m_lazyLength;}bool ByteQueue::IsEmpty() const{	return m_head==m_tail && m_head->CurrentSize()==0 && m_lazyLength==0;}void ByteQueue::Clear(){	Destroy();	m_head = m_tail = new ByteQueueNode(m_nodeSize);	m_lazyLength = 0;}unsigned int ByteQueue::Put2(const byte *inString, unsigned int length, int messageEnd, bool blocking){	if (m_lazyLength > 0)		FinalizeLazyPut();	unsigned int len;	while ((len=m_tail->Put(inString, length)) < length)	{		m_tail->next = new ByteQueueNode(m_nodeSize);		m_tail = m_tail->next;		inString += len;		length -= len;	}	return 0;}void ByteQueue::CleanupUsedNodes(){	while (m_head != m_tail && m_head->UsedUp())	{		ByteQueueNode *temp=m_head;		m_head=m_head->next;		delete temp;	}	if (m_head->CurrentSize() == 0)		m_head->Clear();}void ByteQueue::LazyPut(const byte *inString, unsigned int size){	if (m_lazyLength > 0)		FinalizeLazyPut();	m_lazyString = inString;	m_lazyLength = size;}void ByteQueue::UndoLazyPut(unsigned int size){	if (m_lazyLength < size)		throw InvalidArgument("ByteQueue: size specified for UndoLazyPut is too large");	m_lazyLength -= size;}void ByteQueue::FinalizeLazyPut(){	unsigned int len = m_lazyLength;	m_lazyLength = 0;	if (len)		Put(m_lazyString, len);}unsigned int ByteQueue::Get(byte &outByte){	if (m_head->Get(outByte))	{		if (m_head->UsedUp())			CleanupUsedNodes();		return 1;	}	else if (m_lazyLength > 0)	{		outByte = *m_lazyString++;		m_lazyLength--;		return 1;	}	else		return 0;}unsigned int ByteQueue::Get(byte *outString, unsigned int getMax){	ArraySink sink(outString, getMax);	return TransferTo(sink, getMax);}unsigned int ByteQueue::Peek(byte &outByte) const{	if (m_head->Peek(outByte))		return 1;	else if (m_lazyLength > 0)	{		outByte = *m_lazyString;		return 1;	}	else		return 0;}unsigned int ByteQueue::Peek(byte *outString, unsigned int peekMax) const{	ArraySink sink(outString, peekMax);	return CopyTo(sink, peekMax);}unsigned int ByteQueue::TransferTo2(BufferedTransformation &target, unsigned long &transferBytes, const std::string &channel, bool blocking){	if (blocking)	{		unsigned long bytesLeft = transferBytes;		for (ByteQueueNode *current=m_head; bytesLeft && current; current=current->next)			bytesLeft -= current->TransferTo(target, bytesLeft, channel);		CleanupUsedNodes();		unsigned int len = (unsigned int)STDMIN(bytesLeft, (unsigned long)m_lazyLength);		if (len)		{			target.ChannelPut(channel, m_lazyString, len);			m_lazyString += len;			m_lazyLength -= len;			bytesLeft -= len;		}		transferBytes -= bytesLeft;		return 0;	}	else	{		Walker walker(*this);		unsigned int blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking);		Skip(transferBytes);		return blockedBytes;	}}unsigned int ByteQueue::CopyRangeTo2(BufferedTransformation &target, unsigned long &begin, unsigned long end, const std::string &channel, bool blocking) const{	Walker walker(*this);	walker.Skip(begin);	unsigned long transferBytes = end-begin;	unsigned int blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking);	begin += transferBytes;	return blockedBytes;}void ByteQueue::Unget(byte inByte){	Unget(&inByte, 1);}void ByteQueue::Unget(const byte *inString, unsigned int length){	// TODO: make this more efficient	ByteQueueNode *newHead = new ByteQueueNode(length);	newHead->next = m_head;	m_head = newHead;	m_head->Put(inString, length);}const byte * ByteQueue::Spy(unsigned int &contiguousSize) const{	contiguousSize = m_head->m_tail - m_head->m_head;	if (contiguousSize == 0 && m_lazyLength > 0)	{		contiguousSize = m_lazyLength;		return m_lazyString;	}	else		return m_head->buf + m_head->m_head;}byte * ByteQueue::CreatePutSpace(unsigned int &size){	if (m_lazyLength > 0)		FinalizeLazyPut();	if (m_tail->m_tail == m_tail->MaxSize())	{		m_tail->next = new ByteQueueNode(size < m_nodeSize ? m_nodeSize : STDMAX(m_nodeSize, 1024U));		m_tail = m_tail->next;	}	size = m_tail->MaxSize() - m_tail->m_tail;	return m_tail->buf + m_tail->m_tail;}ByteQueue & ByteQueue::operator=(const ByteQueue &rhs){	Destroy();	CopyFrom(rhs);	return *this;}bool ByteQueue::operator==(const ByteQueue &rhs) const{	const unsigned long currentSize = CurrentSize();	if (currentSize != rhs.CurrentSize())		return false;	Walker walker1(*this), walker2(rhs);	byte b1, b2;	while (walker1.Get(b1) && walker2.Get(b2))		if (b1 != b2)			return false;	return true;}byte ByteQueue::operator[](unsigned long i) const{	for (ByteQueueNode *current=m_head; current; current=current->next)	{		if (i < current->CurrentSize())			return (*current)[i];				i -= current->CurrentSize();	}	assert(i < m_lazyLength);	return m_lazyString[i];}void ByteQueue::swap(ByteQueue &rhs){	std::swap(m_nodeSize, rhs.m_nodeSize);	std::swap(m_head, rhs.m_head);	std::swap(m_tail, rhs.m_tail);	std::swap(m_lazyString, rhs.m_lazyString);	std::swap(m_lazyLength, rhs.m_lazyLength);}// ********************************************************void ByteQueue::Walker::IsolatedInitialize(const NameValuePairs &parameters){	m_node = m_queue.m_head;	m_position = 0;	m_offset = 0;	m_lazyString = m_queue.m_lazyString;	m_lazyLength = m_queue.m_lazyLength;}unsigned int ByteQueue::Walker::Get(byte &outByte){	ArraySink sink(&outByte, 1);	return TransferTo(sink, 1);}unsigned int ByteQueue::Walker::Get(byte *outString, unsigned int getMax){	ArraySink sink(outString, getMax);	return TransferTo(sink, getMax);}unsigned int ByteQueue::Walker::Peek(byte &outByte) const{	ArraySink sink(&outByte, 1);	return CopyTo(sink, 1);}unsigned int ByteQueue::Walker::Peek(byte *outString, unsigned int peekMax) const{	ArraySink sink(outString, peekMax);	return CopyTo(sink, peekMax);}unsigned int ByteQueue::Walker::TransferTo2(BufferedTransformation &target, unsigned long &transferBytes, const std::string &channel, bool blocking){	unsigned long bytesLeft = transferBytes;	unsigned int blockedBytes = 0;	while (m_node)	{		unsigned int len = STDMIN(bytesLeft, (unsigned long)m_node->CurrentSize()-m_offset);		blockedBytes = target.ChannelPut2(channel, m_node->buf+m_node->m_head+m_offset, len, 0, blocking);		if (blockedBytes)			goto done;		m_position += len;		bytesLeft -= len;		if (!bytesLeft)		{			m_offset += len;			goto done;		}		m_node = m_node->next;		m_offset = 0;	}	if (bytesLeft && m_lazyLength)	{		unsigned int len = (unsigned int)STDMIN(bytesLeft, (unsigned long)m_lazyLength);		unsigned int blockedBytes = target.ChannelPut2(channel, m_lazyString, len, 0, blocking);		if (blockedBytes)			goto done;		m_lazyString += len;		m_lazyLength -= len;		bytesLeft -= len;	}done:	transferBytes -= bytesLeft;	return blockedBytes;}unsigned int ByteQueue::Walker::CopyRangeTo2(BufferedTransformation &target, unsigned long &begin, unsigned long end, const std::string &channel, bool blocking) const{	Walker walker(*this);	walker.Skip(begin);	unsigned long transferBytes = end-begin;	unsigned int blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking);	begin += transferBytes;	return blockedBytes;}NAMESPACE_END

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
极品美女销魂一区二区三区免费 | 另类的小说在线视频另类成人小视频在线 | 中文字幕一区二区三中文字幕| 国产精品第13页| 日韩电影在线观看电影| 国产99一区视频免费| 精品视频全国免费看| 国产午夜精品在线观看| 亚洲地区一二三色| 国产iv一区二区三区| 91精品福利在线一区二区三区| 国产精品乱码一区二区三区软件 | 国产精品18久久久久久久久久久久| 色中色一区二区| 久久精品一区蜜桃臀影院| 亚洲成人777| 99久久精品国产精品久久| 日韩精品一区二区三区swag| 亚洲一区二区三区中文字幕在线| 国产精品中文字幕日韩精品| 日韩一二三区视频| 亚洲一区av在线| 99久久精品免费看国产免费软件| 欧美精品一区二区高清在线观看| 亚洲第一二三四区| 色狠狠色噜噜噜综合网| 国产精品欧美久久久久一区二区| 国内精品久久久久影院一蜜桃| 欧美日韩aaa| 亚洲国产日韩一级| 欧美在线观看一二区| 亚洲欧美电影院| 99麻豆久久久国产精品免费| 国产婷婷色一区二区三区| 免费在线一区观看| 日韩免费一区二区| 美国毛片一区二区| 精品国产一区二区亚洲人成毛片 | 中文字幕精品综合| 成人性生交大片免费看中文| 久久久www免费人成精品| 精品一区二区三区蜜桃| 精品久久久影院| 激情综合色综合久久综合| 精品国产免费久久| 国产美女精品人人做人人爽| 久久久不卡影院| 成人v精品蜜桃久久一区| 亚洲欧美在线另类| 色哟哟国产精品| 亚洲国产美女搞黄色| 欧美日韩三级一区| 蜜桃免费网站一区二区三区| 精品日韩成人av| 国产成人综合在线| 中文字幕一区免费在线观看 | 精品在线播放午夜| 国产欧美日韩视频一区二区 | 国产精品青草久久| 色88888久久久久久影院按摩 | 国产精品视频一区二区三区不卡| 成人伦理片在线| 亚洲欧美视频在线观看| 欧美日韩国产a| 久久国产日韩欧美精品| 国产精品拍天天在线| 欧美在线一区二区三区| 人人超碰91尤物精品国产| 欧美精品一区二区三区很污很色的 | 欧美男男青年gay1069videost | 激情小说欧美图片| 国产精品家庭影院| 欧美日韩精品福利| 国产99一区视频免费| 一区二区三区鲁丝不卡| 精品国精品国产尤物美女| 99国产精品99久久久久久| 婷婷国产在线综合| 中文av一区二区| 欧美日韩在线三区| 国产98色在线|日韩| 亚洲成av人片一区二区梦乃| 国产日韩成人精品| 91精选在线观看| av高清不卡在线| 精品一区在线看| 亚洲激情校园春色| 国产日韩欧美制服另类| 欧美日韩日日骚| 99re这里只有精品6| 蜜臀av一区二区在线免费观看| 自拍偷拍国产亚洲| 精品国产sm最大网站免费看| 欧美在线不卡视频| 大胆亚洲人体视频| 精品一区二区三区蜜桃| 亚洲国产精品一区二区www在线| 久久精品一区二区三区av| 欧美日韩免费观看一区三区| 99久久婷婷国产综合精品| 国产一区二区三区精品欧美日韩一区二区三区 | 一区二区三区四区高清精品免费观看 | 欧美日本高清视频在线观看| 99久久伊人精品| 国产精品一区二区久久不卡| 日韩精品三区四区| 亚洲综合激情小说| 亚洲视频综合在线| 国产精品成人免费在线| 久久九九全国免费| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 成人性生交大片免费看在线播放| 麻豆精品一区二区| 日本欧美久久久久免费播放网| 夜夜嗨av一区二区三区网页| 亚洲天堂av一区| 国产精品久久久久久久裸模 | 国产日产欧美一区| 精品久久一区二区| 久久综合久久综合九色| 精品国产制服丝袜高跟| 精品粉嫩超白一线天av| 精品日本一线二线三线不卡| 欧美一区二区三区在线看| 欧美日韩成人综合在线一区二区 | 欧美性一级生活| 91国偷自产一区二区开放时间| 色哟哟国产精品| 欧美三区在线视频| 欧美日韩成人综合| 日韩欧美高清在线| 久久久综合精品| 中文字幕精品在线不卡| 亚洲精品视频免费观看| 一区二区三区中文字幕精品精品| 亚洲精品国产a| 香蕉av福利精品导航| 日韩国产精品91| 国产综合色在线| 国产999精品久久久久久绿帽| 成人av在线播放网址| 色哟哟精品一区| 在线观看91av| 久久久综合九色合综国产精品| 国产精品理论片| 亚洲成人午夜电影| 久久er精品视频| 成人av网址在线| 欧美日韩视频在线第一区| 欧美不卡激情三级在线观看| 国产日韩精品一区二区三区 | 成人sese在线| 欧美日韩大陆在线| 国产欧美日本一区二区三区| 亚洲视频小说图片| 奇米色一区二区| 成人av电影在线观看| 精品视频在线视频| 国产日韩影视精品| 亚洲午夜久久久久久久久电影网 | 国产激情偷乱视频一区二区三区| 97久久精品人人澡人人爽| 欧美日韩日本视频| 国产精品女主播av| 日韩va亚洲va欧美va久久| 国产成人综合在线观看| 欧美日韩成人综合在线一区二区| 精品欧美一区二区三区精品久久| 国产精品免费免费| 喷水一区二区三区| 色综合一区二区三区| 欧美videossexotv100| 亚洲乱码精品一二三四区日韩在线| 日本不卡一区二区三区| 91伊人久久大香线蕉| 精品久久一区二区| 亚洲成人激情综合网| 成人av在线资源网| 精品对白一区国产伦| 亚洲一二三四区| 成人精品视频网站| 久久综合九色综合97_久久久| 亚洲五码中文字幕| www.66久久| 久久日韩粉嫩一区二区三区 | 亚洲成av人片在www色猫咪| 成人免费看的视频| 精品国产污网站| 肉丝袜脚交视频一区二区| 色综合久久中文综合久久牛| 国产日韩欧美高清| 国产乱子伦一区二区三区国色天香 | 极品尤物av久久免费看| 欧美男人的天堂一二区| 亚洲另类中文字| 99视频在线精品| 中文一区二区在线观看| 国产成人免费xxxxxxxx| 337p日本欧洲亚洲大胆精品 | 久久九九国产精品|