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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? buffer.h

?? common c++提供socket
?? H
字號:
// Copyright (C) 1999-2005 Open Source Telecom Corporation.//  // This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.// // This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.// // You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.// // As a special exception, you may use this file as part of a free software// library without restriction.  Specifically, if other files instantiate// templates or use macros or inline functions from this file, or you compile// this file and link it with other files to produce an executable, this// file does not by itself cause the resulting executable to be covered by// the GNU General Public License.  This exception does not however// invalidate any other reasons why the executable file might be covered by// the GNU General Public License.//// This exception applies only to the code released under the name GNU// Common C++.  If you copy code from other releases into a copy of GNU // Common C++, as the General Public License permits, the exception does// not apply to the code that you add in this way.  To avoid misleading// anyone as to the status of such modified files, you must delete// this exception notice from them.//// If you write modifications of your own for GNU Common C++, it is your choice// whether to permit this exception to apply to your modifications.// If you do not wish that, delete this exception notice.///** * @file buffer.h * @short object passing services between threads. **/#ifndef	CCXX_BUFFER_H_#define	CCXX_BUFFER_H_#ifndef CCXX_THREAD_H_#include <cc++/thread.h>#endif#ifdef	CCXX_NAMESPACESnamespace ost {#endif/** * The buffer class represents an IPC service that is built upon a buffer * of fixed capacity that can be used to transfer objects between one or * more producer and consumer threads.  Producer threads post objects * into the buffer, and consumer threads wait for and receive objects from * the buffer.  Semaphores are used to to block the buffer from overflowing * and indicate when there is data available, and mutexes are used to protect * multiple consumers and producer threads from stepping over each other. *  * The buffer class is an abstract class in that the actual data being * buffered is not directly specified within the buffer class itself.  The * buffer class should be used as a base class for a class that actually * impliments buffering and which may be aware of the data types actually * are being buffered.  A template class could be created based on buffer * for this purpose.  Another possibility is to create a class derived * from both Thread and Buffer which can be used to implement message passing * threads. *  * @author David Sugar <dyfet@ostel.com> * @short Producer/Consumer buffer for use between threads. */#ifdef	WIN32class __EXPORT Buffer : public Mutex#elseclass __EXPORT Buffer : public Conditional#endif{private:#ifdef	WIN32	HANDLE	sem_head, sem_tail;#endif	size_t _size;	size_t _used;protected:	/**	 * Invoke derived class buffer peeking method.	 * @return size of object found.	 * @param buf pointer to copy contents of head of buffer to.	 */	virtual size_t onPeek(void *buf) = 0;	/**	 * Invoke derived class object request from buffer.	 * @return size of object returned.	 * @param buf pointer to hold object returned from the buffer.	 */	virtual size_t onWait(void *buf) = 0;	/**	 * Invoke derived class posting of object to buffer.	 * @return size of object posted.	 * @param buf pointer to object being posted to the buffer.	 */	virtual size_t onPost(void *buf) = 0;public:	/**	 * value to return when a timed operation returned with a	 * timeout.	 */	static const size_t timeout;	/**	 * Create a buffer object of known capacity.	 * @param capacity is the integer capacity of the buffer.	 */	Buffer(size_t capacity);	/**	 * In derived functions, may be used to free the actual memory	 * used to hold buffered data.	 */	virtual ~Buffer();	/**	 * Return the capacity of the buffer as specified at creation.	 * @return size of buffer.	 */	inline size_t getSize(void)		{return _size;};	/**	 * Return the current capacity in use for the buffer.  Free space	 * is technically getSize() - getUsed().	 * @return integer used capacity of the buffer.	 * @see #getSize	 */	inline size_t getUsed(void)		{return _used;};	/**	 * Let one or more threads wait for an object to become available	 * in the buffer.  The waiting thread(s) will wait forever if no	 * object is ever placed into the buffer.	 *	 * @return size of object passed by buffer in bytes.	 * @param buf pointer to store object retrieved from the buffer.	 * @param timeout time to wait.	 */	size_t wait(void *buf, timeout_t timeout = 0);	/**	 * Post an object into the buffer and enable a waiting thread to	 * receive it.	 *	 * @return size of object posted in bytes.	 * @param buf pointer to object to store in the buffer.	 * @param timeout time to wait.	 */	size_t post(void *buf, timeout_t timeout = 0);	/**	 * Peek at the current content (first object) in the buffer.	 *	 * @return size of object in the buffer.	 * @param buf pointer to store object found in the buffer.	 */	size_t peek(void *buf);	/**	 * New virtual to test if buffer is a valid object.	 * @return true if object is valid.	 */	virtual bool isValid(void);};/** * A buffer class that holds a known capacity of fixed sized objects defined * during creation. * * @author David Sugar <dyfet@ostel.com> * @short producer/consumer buffer for fixed size objects. */class __EXPORT FixedBuffer : public Buffer{private:	char *buf, *head, *tail;	size_t objsize;protected:	/**	 * Return the first object in the buffer.	 * @return predefined size of this buffers objects.	 * @param buf pointer to copy contents of head of buffer to.	 */	size_t onPeek(void *buf);	/**	 * Wait for and return a fixed object in the buffer.	 * @return predefined size of this buffers objects.	 * @param buf pointer to hold object returned from the buffer.	 */	size_t onWait(void *buf);	/**	 * Post an object of the appropriate size into the buffer.	 * @return predefined size of this buffers objects.	 * @param buf pointer to data to copy into the buffer.	 */	size_t onPost(void *buf);public:	/**	 * Create a buffer of known capacity for objects of a specified	 * size.	 *	 * @param capacity of the buffer.	 * @param objsize for each object held in the buffer.	 */	FixedBuffer(size_t capacity, size_t objsize);	/**	 * Create a copy of an existing fixed size buffer and duplicate	 * it's contents.	 *	 * @param fb existing FixedBuffer object.	 */	FixedBuffer(const FixedBuffer &fb);	/**	 * Destroy the fixed buffer and free the memory used to store objects.	 */	virtual ~FixedBuffer();	FixedBuffer &operator=(const FixedBuffer &fb);	bool isValid(void);};/** * Somewhat generic queue processing class to establish a producer * consumer queue.  This may be used to buffer cdr records, or for * other purposes where an in-memory queue is needed for rapid * posting.  This class is derived from Mutex and maintains a linked * list.  A thread is used to dequeue data and pass it to a callback * method that is used in place of "run" for each item present on the * queue.  The conditional is used to signal the run thread when new * data is posted. * * @short in memory data queue interface. * @author David Sugar <dyfet@ostel.com> */class __EXPORT ThreadQueue : public Mutex, public Thread, public Semaphore{private:	typedef struct _data	{		struct _data *next;		unsigned len;		char data[1];	}	data_t;	bool started;	data_t *first, *last;		// head/tail of list	void run(void);			// private run methodprotected:	const char *name;		// used for save/restore file	/**	 * Start of dequeing.  Maybe we need to connect a database	 * or something, so we have a virtual...	 */	virtual void startQueue(void);	/**	 * End of dequeing, we expect the queue is empty for now.  Maybe	 * we need to disconnect a database or something, so we have	 * another virtual.	 */	virtual void stopQueue(void);	/**	 * Virtual callback method to handle processing of a queued	 * data items.  After the item is processed, it is deleted from	 * memory.  We can call multiple instances of runQueue in order	 * if multiple items are waiting.	 *	 * @param data item being dequed.	 */	virtual void runQueue(void *data) = 0;public:	/**	 * Create instance of our queue and give it a process priority.	 *	 * @param id queue ID.	 * @param pri process priority.	 * @param stack stack size.	 */	ThreadQueue(const char *id, int pri, size_t stack = 0);	/**	 * Destroy the queue.	 */	~ThreadQueue();	/**	 * Put some unspecified data into this queue.  A new qd	 * structure is created and sized to contain a copy of	 * the actual content.	 *	 * @param data pointer to data.	 * @param len size of data.	 */	void post(const void *data, unsigned len);};/** @relates Buffer */inline size_t get(Buffer &b, void *o, timeout_t t = 0)	{return b.wait(o, t);}/** @relates Buffer */inline size_t put(Buffer &b, void *o, timeout_t t = 0)	{return b.post(o, t);}/** @relates Buffer */inline size_t peek(Buffer &b, void *o)	{return b.peek(o);}#ifdef	CCXX_NAMESPACES}#endif#endif/** EMACS ** * Local variables: * mode: c++ * c-basic-offset: 8 * End: */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一区二区三区在线观看| 丰满少妇在线播放bd日韩电影| 国产精品欧美一区二区三区| 精品国产乱码久久久久久夜甘婷婷| 91精品国产全国免费观看| 欧美在线免费观看亚洲| 欧美日韩国产电影| 欧美人动与zoxxxx乱| 5月丁香婷婷综合| 精品区一区二区| 久久精品视频网| 国产欧美日韩另类一区| 亚洲欧美另类久久久精品| 亚洲一线二线三线视频| 一区二区三区高清不卡| 亚洲成av人片一区二区梦乃| 日韩中文字幕亚洲一区二区va在线| 五月婷婷另类国产| 黄一区二区三区| 成人黄色电影在线 | 国产成人综合自拍| 国产成人精品影视| 91日韩一区二区三区| 欧美做爰猛烈大尺度电影无法无天| 欧美色综合久久| 日韩限制级电影在线观看| 久久精品夜色噜噜亚洲aⅴ| 国产精品午夜春色av| 亚洲国产一区二区在线播放| 激情综合色丁香一区二区| 成人美女视频在线观看18| 欧美综合亚洲图片综合区| 精品理论电影在线观看 | 国产色爱av资源综合区| 国产精品色哟哟| 日韩av电影免费观看高清完整版在线观看 | 国产日产欧美精品一区二区三区| 中文字幕中文乱码欧美一区二区 | 国产不卡视频一区| 欧美日韩国产不卡| 中文字幕在线观看不卡| 日一区二区三区| 不卡电影一区二区三区| 91精品国产手机| 亚洲天天做日日做天天谢日日欢| 日韩一区精品字幕| 99热精品国产| 久久久噜噜噜久久中文字幕色伊伊| 亚洲精品ww久久久久久p站| 国产精品一区二区在线观看网站| 在线看国产一区二区| 国产精品污网站| 国内精品伊人久久久久av一坑| 欧美性色aⅴ视频一区日韩精品| 久久综合久久综合久久| 免费观看在线色综合| 欧美在线观看视频在线| 亚洲欧美一区二区视频| 国产很黄免费观看久久| 欧美va亚洲va香蕉在线| 调教+趴+乳夹+国产+精品| 色94色欧美sute亚洲线路一久 | 7777精品伊人久久久大香线蕉的 | 国产一区二区三区综合| 欧美一级淫片007| 亚洲动漫第一页| 在线观看国产91| 亚洲免费av高清| 91麻豆国产自产在线观看| 中文幕一区二区三区久久蜜桃| 韩国三级电影一区二区| 日韩久久精品一区| 狠狠久久亚洲欧美| 精品sm捆绑视频| 激情图片小说一区| 日韩免费高清视频| 久久国产日韩欧美精品| 精品国产乱码久久久久久牛牛| 蜜臀va亚洲va欧美va天堂| 欧美一二三区在线观看| 韩国毛片一区二区三区| 久久久精品影视| 99天天综合性| 亚洲制服丝袜在线| 欧美美女喷水视频| 久久精品国产一区二区| 精品国产乱码久久久久久久久| 国产综合色精品一区二区三区| www久久精品| 成人18精品视频| 亚洲高清一区二区三区| 欧美一卡2卡三卡4卡5免费| 捆绑紧缚一区二区三区视频 | 在线视频欧美精品| 日韩不卡手机在线v区| 久久免费看少妇高潮| 岛国一区二区三区| 一区二区免费视频| 日韩一区二区三区精品视频| 激情综合色播五月| 亚洲精选免费视频| 欧美大片一区二区| 91在线观看视频| 日韩黄色免费网站| 国产欧美一区二区精品忘忧草| 91香蕉视频在线| 久久精品国产精品亚洲综合| 中文字幕中文字幕一区| 91精品国产色综合久久不卡电影| 国产91高潮流白浆在线麻豆| 一区二区三区四区国产精品| 欧美精品一区二区不卡| 91久久精品一区二区三区| 久久精品国产77777蜜臀| 成人免费在线播放视频| 9191国产精品| 91美女片黄在线| 国内精品久久久久影院色| 亚洲免费观看高清| 国产清纯在线一区二区www| 欧美人与禽zozo性伦| av中文一区二区三区| 激情综合一区二区三区| 午夜精品福利一区二区三区av | 一区二区三区四区在线免费观看 | 国产精品黄色在线观看| 日韩一区国产二区欧美三区| 色狠狠色噜噜噜综合网| 极品尤物av久久免费看| 日韩成人精品在线观看| 一区2区3区在线看| 国产精品色噜噜| 久久久久久久综合色一本| 日韩色视频在线观看| 欧美在线你懂的| 91免费精品国自产拍在线不卡| 麻豆精品视频在线观看免费| 偷拍与自拍一区| 午夜av一区二区三区| 亚洲福利视频一区二区| 国产精品乱人伦一区二区| 久久综合九色综合97_久久久| 欧美精品一二三| 在线亚洲免费视频| 在线亚洲精品福利网址导航| 91免费视频网址| 91国产精品成人| 欧美在线综合视频| 欧美色成人综合| 欧美性猛片aaaaaaa做受| 色呦呦一区二区三区| 91啪九色porn原创视频在线观看| 99久久精品一区| 91一区二区三区在线观看| 丁香一区二区三区| 成人黄动漫网站免费app| 99久久国产免费看| 色婷婷久久综合| 欧美日韩国产在线观看| 欧美日韩国产成人在线91| 欧美人成免费网站| 日韩午夜在线观看视频| 精品国产免费视频| 欧美激情在线看| 亚洲女性喷水在线观看一区| 有坂深雪av一区二区精品| 午夜久久久久久电影| 美女看a上一区| 成人精品视频一区二区三区 | 欧美综合亚洲图片综合区| 欧美亚洲愉拍一区二区| 欧美日韩国产首页| 日韩精品专区在线影院观看| 国产精品午夜电影| 亚洲成a人片在线不卡一二三区 | av毛片久久久久**hd| 92精品国产成人观看免费| 欧美又粗又大又爽| 精品国产伦一区二区三区观看体验 | 国产 日韩 欧美大片| 在线观看国产日韩| 亚洲精品在线三区| 最近中文字幕一区二区三区| 无吗不卡中文字幕| 成人综合婷婷国产精品久久 | 亚洲第一福利一区| 亚洲成av人片在线观看无码| 久久精品国产一区二区| 成人激情小说乱人伦| 在线播放中文字幕一区| 欧美国产在线观看| 免费精品视频在线| 在线亚洲人成电影网站色www| 精品电影一区二区三区| 亚洲综合免费观看高清在线观看| 韩国欧美国产一区| 9191久久久久久久久久久| 中文字幕制服丝袜成人av| 久久精品国产**网站演员| 欧美亚洲禁片免费|