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

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

?? stl_rope.h

?? 著名的SGI的STL lib源碼.(C++范型類編成,沒有合適的分類,但是放到數據結構類別中也絕對適合)
?? H
?? 第 1 頁 / 共 5 頁
字號:
/* * Copyright (c) 1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation.  Silicon Graphics makes no * representations about the suitability of this software for any * purpose.  It is provided "as is" without express or implied warranty. *//* NOTE: This is an internal header file, included by other STL headers. *   You should not attempt to use it directly. */#ifndef __SGI_STL_INTERNAL_ROPE_H# define __SGI_STL_INTERNAL_ROPE_H# ifdef __GC#   define __GC_CONST const# else#   define __GC_CONST   // constant except for deallocation# endif# ifdef __STL_SGI_THREADS#    include <mutex.h># endif__STL_BEGIN_NAMESPACE#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)#pragma set woff 1174#endif// The end-of-C-string character.// This is what the draft standard says it should be.template <class charT>inline charT __eos(charT*) { return charT(); }// Test for basic character types.// For basic character types leaves having a trailing eos.template <class charT>inline bool __is_basic_char_type(charT *) { return false; }template <class charT>inline bool __is_one_byte_char_type(charT *) { return false; }inline bool __is_basic_char_type(char *) { return true; }inline bool __is_one_byte_char_type(char *) { return true; }inline bool __is_basic_char_type(wchar_t *) { return true; }// Store an eos iff charT is a basic character type.// Do not reference __eos if it isn't.template <class charT>inline void __cond_store_eos(charT&) {}inline void __cond_store_eos(char& c) { c = 0; }inline void __cond_store_eos(wchar_t& c) { c = 0; }	// rope<charT,Alloc> is a sequence of charT.// Ropes appear to be mutable, but update operations// really copy enough of the data structure to leave the original// valid.  Thus ropes can be logically copied by just copying// a pointer value.// The __eos function is used for those functions that// convert to/from C-like strings to detect the end of the string.// __compare is used as the character comparison function.template <class charT>class char_producer {    public:	virtual ~char_producer() {};	virtual void operator()(size_t start_pos, size_t len, charT* buffer)		= 0;	// Buffer should really be an arbitrary output iterator.	// That way we could flatten directly into an ostream, etc.	// This is thoroughly impossible, since iterator types don't	// have runtime descriptions.};// Sequence buffers://// Sequence must provide an append operation that appends an// array to the sequence.  Sequence buffers are useful only if// appending an entire array is cheaper than appending element by element.// This is true for many string representations.// This should  perhaps inherit from ostream<sequence::value_type>// and be implemented correspondingly, so that they can be used// for formatted.  For the sake of portability, we don't do this yet.//// For now, sequence buffers behave as output iterators.  But they also// behave a little like basic_ostringstream<sequence::value_type> and a// little like containers.template<class sequence, size_t buf_sz = 100#   if defined(__sgi) && !defined(__GNUC__)#	 define __TYPEDEF_WORKAROUND         ,class v = typename sequence::value_type#   endif        >// The 3rd parameter works around a common compiler bug.class sequence_buffer : public output_iterator {    public:#       ifndef __TYPEDEF_WORKAROUND	    typedef typename sequence::value_type value_type;#	else	    typedef v value_type;#	endif    protected:	sequence *prefix;	value_type buffer[buf_sz];	size_t buf_count;    public:	void flush() {	    prefix->append(buffer, buffer + buf_count);	    buf_count = 0;	}	~sequence_buffer() { flush(); }	sequence_buffer() : prefix(0), buf_count(0) {}	sequence_buffer(const sequence_buffer & x) {	    prefix = x.prefix;            buf_count = x.buf_count;            copy(x.buffer, x.buffer + x.buf_count, buffer);	}	sequence_buffer(sequence_buffer & x) {	    x.flush();	    prefix = x.prefix;	    buf_count = 0;	}	sequence_buffer(sequence& s) : prefix(&s), buf_count(0) {}	sequence_buffer& operator= (sequence_buffer& x) {	    x.flush();	    prefix = x.prefix;	    buf_count = 0;	    return *this;	}	sequence_buffer& operator= (const sequence_buffer& x) {	    prefix = x.prefix;	    buf_count = x.buf_count;	    copy(x.buffer, x.buffer + x.buf_count, buffer);	    return *this;	}	void push_back(value_type x)	{	    if (buf_count < buf_sz) {		buffer[buf_count] = x;		++buf_count;	    } else {		flush();		buffer[0] = x;		buf_count = 1;	    }	}	void append(value_type *s, size_t len)	{	    if (len + buf_count <= buf_sz) {		size_t i, j;		for (i = buf_count, j = 0; j < len; i++, j++) {		    buffer[i] = s[j];		}		buf_count += len;	    } else if (0 == buf_count) {		prefix->append(s, s + len);	    } else {		flush();		append(s, len);	    }	}	sequence_buffer& write(value_type *s, size_t len)	{	    append(s, len);	    return *this;	}	sequence_buffer& put(value_type x)	{	    push_back(x);	    return *this;	}	sequence_buffer& operator=(const value_type& rhs)	{	    push_back(rhs);	    return *this;	}	sequence_buffer& operator*() { return *this; }	sequence_buffer& operator++() { return *this; }	sequence_buffer& operator++(int) { return *this; }};// The following should be treated as private, at least for now.template<class charT>class __rope_char_consumer {    public:	// If we had member templates, these should not be virtual.	// For now we need to use run-time parametrization where	// compile-time would do.  Hence this should all be private	// for now.	// The symmetry with char_producer is accidental and temporary.	virtual ~__rope_char_consumer() {};	virtual bool operator()(const charT* buffer, size_t len) = 0;};//// What follows should really be local to rope.  Unfortunately,// that doesn't work, since it makes it impossible to define generic// equality on rope iterators.  According to the draft standard, the// template parameters for such an equality operator cannot be inferred// from the occurence of a member class as a parameter.// (SGI compilers in fact allow this, but the result wouldn't be// portable.)// Similarly, some of the static member functions are member functions// only to avoid polluting the global namespace, and to circumvent// restrictions on type inference for template functions.//template<class CharT, class Alloc=__ALLOC> class rope;template<class CharT, class Alloc> struct __rope_RopeConcatenation;template<class CharT, class Alloc> struct __rope_RopeLeaf;template<class CharT, class Alloc> struct __rope_RopeFunction;template<class CharT, class Alloc> struct __rope_RopeSubstring;template<class CharT, class Alloc> class __rope_iterator;template<class CharT, class Alloc> class __rope_const_iterator;template<class CharT, class Alloc> class __rope_charT_ref_proxy;template<class CharT, class Alloc> class __rope_charT_ptr_proxy;//// The internal data structure for representing a rope.  This is// private to the implementation.  A rope is really just a pointer// to one of these.//// A few basic functions for manipulating this data structure// are members of RopeBase.  Most of the more complex algorithms// are implemented as rope members.//// Some of the static member functions of RopeBase have identically// named functions in rope that simply invoke the RopeBase versions.//template<class charT, class Alloc>struct __rope_RopeBase {    typedef rope<charT,Alloc> my_rope;    typedef simple_alloc<charT, Alloc> DataAlloc;    typedef simple_alloc<__rope_RopeConcatenation<charT,Alloc>, Alloc> CAlloc;    typedef simple_alloc<__rope_RopeLeaf<charT,Alloc>, Alloc> LAlloc;    typedef simple_alloc<__rope_RopeFunction<charT,Alloc>, Alloc> FAlloc;    typedef simple_alloc<__rope_RopeSubstring<charT,Alloc>, Alloc> SAlloc;    public:    enum { max_rope_depth = 45 };    enum {leaf, concat, substringfn, function} tag:8;    bool is_balanced:8;    unsigned char depth;    size_t size;    __GC_CONST charT * c_string;			/* Flattened version of string, if needed.  */			/* typically 0.                             */			/* If it's not 0, then the memory is owned  */			/* by this node.                            */			/* In the case of a leaf, this may point to */			/* the same memory as the data field.	    */#   ifndef __GC#       if defined(__STL_WIN32THREADS)	    long refcount;  	// InterlockedIncrement wants a long *#	else	    size_t refcount;#	endif	// We count references from rope instances	// and references from other rope nodes.  We	// do not count const_iterator references.	// Iterator references are counted so that rope modifications	// can be detected after the fact.	// Generally function results are counted, i.e.	// a pointer returned by a function is included at the	// point at which the pointer is returned.	// The recipient should decrement the count if the	// result is not needed.	// Generally function arguments are not reflected	// in the reference count.  The callee should increment	// the count before saving the argument someplace that	// will outlive the call.#   endif#   ifndef __GC#       ifdef __STL_SGI_THREADS	    // Reference counting with multiple threads and no	    // hardware or thread package support is pretty awful.	    // Mutexes are normally too expensive.	    // We'll assume a COMPARE_AND_SWAP(destp, old, new)	    // operation, which might be cheaper.#           if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64))#               define __add_and_fetch(l,v) add_then_test((unsigned long *)l,v)#           endif	    void init_refcount_lock() {}	    void incr_refcount ()	    {		__add_and_fetch(&refcount, 1);	    }	    size_t decr_refcount ()	    {		return __add_and_fetch(&refcount, (size_t)(-1));	    }#       elif defined(__STL_WIN32THREADS)	    void init_refcount_lock() {}            void incr_refcount ()            {                InterlockedIncrement(&refcount);            }            size_t decr_refcount ()            {                return InterlockedDecrement(&refcount);            }#	elif defined(__STL_PTHREADS)	    // This should be portable, but performance is expected	    // to be quite awful.  This really needs platform specific	    // code.	    pthread_mutex_t refcount_lock;	    void init_refcount_lock() {		pthread_mutex_init(&refcount_lock, 0);	    }	    void incr_refcount ()            {   		pthread_mutex_lock(&refcount_lock);                ++refcount;		pthread_mutex_unlock(&refcount_lock);            }            size_t decr_refcount ()            {   		size_t result;		pthread_mutex_lock(&refcount_lock);                result = --refcount;		pthread_mutex_unlock(&refcount_lock);                return result;            }#	else	    void init_refcount_lock() {}	    void incr_refcount ()	    {		++refcount;	    }	    size_t decr_refcount ()	    {		--refcount;		return refcount;	    }#       endif#   else	void incr_refcount () {}#   endif	static void free_string(charT *, size_t len);			// Deallocate data section of a leaf.			// This shouldn't be a member function.			// But its hard to do anything else at the			// moment, because it's templatized w.r.t.			// an allocator.			// Does nothing if __GC is defined.#   ifndef __GC	  void free_c_string();	  void free_tree();			// Deallocate t. Assumes t is not 0.	  void unref_nonnil()	  {	      if (0 == decr_refcount()) free_tree();	  }	  void ref_nonnil()	  {	      incr_refcount();	  }	  static void unref(__rope_RopeBase* t)	  {	      if (0 != t) {		  t -> unref_nonnil();	      }	  }	  static void ref(__rope_RopeBase* t)	  {	      if (0 != t) t -> incr_refcount();	  }	  static void free_if_unref(__rope_RopeBase* t) 	  {	      if (0 != t && 0 == t -> refcount) t -> free_tree();	  }#   else /* __GC */	  void unref_nonnil() {}	  void ref_nonnil() {}	  static void unref(__rope_RopeBase* t) {}	  static void ref(__rope_RopeBase* t) {}	  static void fn_finalization_proc(void * tree, void *);	  static void free_if_unref(__rope_RopeBase* t) {}#   endif    // The data fields of leaves are allocated with some    // extra space, to accomodate future growth and for basic    // character types, to hold a trailing eos character.    enum { alloc_granularity = 8 };    static size_t rounded_up_size(size_t n) {        size_t size_with_eos;	             if (__is_basic_char_type((charT *)0)) {    	    size_with_eos = n + 1;    	} else {  	    size_with_eos = n;	}#       ifdef __GC   	   return size_with_eos;#	else	   // Allow slop for in-place expansion.	   return (size_with_eos + alloc_granularity-1)			&~ (alloc_granularity-1);#	endif    }};template<class charT, class Alloc>struct __rope_RopeLeaf : public __rope_RopeBase<charT,Alloc> {  public:  // Apparently needed by VC++    __GC_CONST charT* data;     /* Not necessarily 0 terminated. */				/* The allocated size is	 */				/* rounded_up_size(size), except */				/* in the GC case, in which it	 */				/* doesn't matter.		 */};template<class charT, class Alloc>struct __rope_RopeConcatenation : public __rope_RopeBase<charT,Alloc> {  public:    __rope_RopeBase<charT,Alloc>* left;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产日韩综合久久精品| 亚洲精品亚洲人成人网| 91浏览器打开| 国产91丝袜在线观看| 国产真实乱对白精彩久久| 蜜臀99久久精品久久久久久软件| 五月激情丁香一区二区三区| 亚洲国产另类精品专区| 一级中文字幕一区二区| 亚洲女同一区二区| 亚洲午夜av在线| 亚洲超碰97人人做人人爱| 亚洲国产综合视频在线观看| 天天综合色天天综合色h| 偷窥少妇高潮呻吟av久久免费| 亚洲国产成人精品视频| 亚洲成人动漫精品| 麻豆成人在线观看| 国产精品一区免费在线观看| 成人永久免费视频| 99视频精品在线| 欧美在线免费视屏| 亚洲男人的天堂一区二区| 中文字幕综合网| 一区二区三区不卡在线观看| 日韩高清一级片| 黑人巨大精品欧美黑白配亚洲| 国产精品一区二区果冻传媒| 99久久精品情趣| 欧美日韩精品欧美日韩精品一| 欧美区在线观看| 26uuu色噜噜精品一区| 国产精品入口麻豆原神| 亚洲国产日韩精品| 国产在线精品一区二区夜色| av在线播放不卡| 欧美精品xxxxbbbb| 久久久精品天堂| 亚洲一区在线看| 国产在线视频一区二区三区| 色成年激情久久综合| 91精品国产一区二区三区蜜臀| 久久精品欧美日韩| 亚洲成人综合视频| 国产99精品视频| 欧美视频一区在线| 国产婷婷色一区二区三区| 一区二区三区色| 国产一区二区三区日韩| 91久久一区二区| 久久久不卡网国产精品一区| 亚洲无线码一区二区三区| 国产精品综合久久| 51精品秘密在线观看| 国产精品久久三| 激情小说亚洲一区| 91老师片黄在线观看| 久久久久久久久伊人| 日本aⅴ亚洲精品中文乱码| 99久久综合狠狠综合久久| 精品久久国产老人久久综合| 亚洲高清不卡在线观看| 色老综合老女人久久久| 久久精品在线观看| 美女视频黄a大片欧美| 欧美日韩一区高清| 亚洲免费伊人电影| 成人综合在线网站| 久久综合狠狠综合久久综合88 | 国产精品一二三四区| 欧美精品视频www在线观看| 亚洲天堂福利av| 不卡欧美aaaaa| 国产女人aaa级久久久级| 国产美女视频91| 欧美成人一区二区| 精品一区二区在线播放| 日韩欧美一二三| 日韩中文字幕1| 91精品国产91久久久久久一区二区| 一区二区三区免费网站| 色香色香欲天天天影视综合网| 国产精品毛片久久久久久| 大白屁股一区二区视频| 日本一区二区视频在线观看| 国产精品一区二区三区乱码 | 国产精品一区在线观看你懂的| 日韩美女视频在线| 国产精品久久久久影视| 99热精品国产| 亚洲永久精品大片| 欧美理论片在线| 日本在线不卡视频一二三区| 91精品婷婷国产综合久久性色| 日精品一区二区三区| 精品播放一区二区| 高清国产一区二区三区| 亚洲同性gay激情无套| 一本大道久久精品懂色aⅴ| 亚洲成人精品一区| 久久综合精品国产一区二区三区| 国产**成人网毛片九色 | 欧美四级电影在线观看| 日本91福利区| 国产精品免费丝袜| 色老汉av一区二区三区| 蜜桃av一区二区在线观看| 国产欧美一区二区精品婷婷| 色综合久久中文字幕| 青椒成人免费视频| 日本一区二区成人| 欧美揉bbbbb揉bbbbb| 极品美女销魂一区二区三区| 中文字幕日韩一区| 在线成人av影院| 国产成人免费在线观看| 亚洲一区在线观看免费| 精品99一区二区三区| 91丨porny丨在线| 老色鬼精品视频在线观看播放| 国产视频一区在线播放| 欧美综合一区二区三区| 国产成人免费在线视频| 亚洲va韩国va欧美va| 中文字幕第一区综合| 在线播放91灌醉迷j高跟美女| 国产精品一区二区不卡| 日韩国产精品大片| 亚洲欧美国产三级| 欧美精品一区二区不卡| 91成人在线精品| 成人污视频在线观看| 免费欧美日韩国产三级电影| 亚洲精品视频在线看| 久久日韩精品一区二区五区| 在线播放亚洲一区| 色8久久人人97超碰香蕉987| 国产成人精品三级| 九九在线精品视频| 天堂va蜜桃一区二区三区漫画版 | 欧洲激情一区二区| 国产精品夜夜嗨| 蜜桃视频一区二区三区在线观看| 亚洲一区二区三区四区五区黄| 国产精品美女www爽爽爽| 精品国产一区二区精华| 91精品国产入口在线| 欧美少妇bbb| 在线观看一区二区精品视频| 99re6这里只有精品视频在线观看| 国产精品系列在线播放| 激情偷乱视频一区二区三区| 久久国产三级精品| 久久电影国产免费久久电影| 蜜桃视频一区二区| 久久精品噜噜噜成人av农村| 麻豆一区二区三| 美女精品一区二区| 蓝色福利精品导航| 国产综合一区二区| 国产成人精品网址| 成人综合婷婷国产精品久久| 成人福利视频网站| 99热这里都是精品| 欧美综合色免费| 欧美色偷偷大香| 宅男在线国产精品| 91精品国产一区二区三区蜜臀| 在线不卡a资源高清| 欧美成人bangbros| 久久久综合网站| 国产精品女上位| 亚洲一区免费观看| 奇米亚洲午夜久久精品| 免费黄网站欧美| 国产乱人伦精品一区二区在线观看| 国产成a人无v码亚洲福利| 成人av在线播放网址| 色婷婷国产精品久久包臀| 欧美裸体一区二区三区| 欧美精品一区二区久久久| 国产精品国产三级国产| 亚洲一区二区三区免费视频| 五月婷婷综合网| 国产**成人网毛片九色| 欧美在线免费播放| 日韩一区二区免费高清| 中文字幕av一区二区三区| 一区二区成人在线观看| 精彩视频一区二区| 99久久99久久久精品齐齐| 91精品福利在线| 久久亚洲一区二区三区四区| 亚洲美女一区二区三区| 另类小说图片综合网| 成人小视频在线| 日韩视频在线一区二区| 亚洲人成7777| 国产一区二区三区在线观看免费视频| 成人av网址在线观看|