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

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

?? clist.hxx

?? ecos下的gui開發(fā)源代碼
?? HXX
字號:
#ifndef CYGONCE_INFRA_CLIST_HXX
#define CYGONCE_INFRA_CLIST_HXX

//==========================================================================
//
//      clist.hxx
//
//      Standard types, and some useful coding macros.
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos 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 or (at your option) any later version.
//
// eCos 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 eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s):     nickg
// Contributors:  nickg
// Date:        2000-11-08
// Purpose:     Simple circular list implementation
// Description: A simple implementation of circular lists.
// Usage:       #include "cyg/infra/clist.hxx"
//              ...
//              
//####DESCRIPTIONEND####
//
//==========================================================================

#include <cyg/infra/cyg_type.h>

// -------------------------------------------------------------------------
// Class and structure conversion macros.
// CYG_CLASSFROMFIELD translates a pointer to a field of a struct or
// class into a pointer to the class.
// CYG_OFFSETOFBASE yields the offset of a base class of a derived
// class.
// CYG_CLASSFROMBASE translates a pointer to a base class into a pointer
// to a selected derived class. The base class object _must_ be part of
// the specified derived class. This is essentially a poor mans version
// of the RTTI dynamic_cast operator.
// Caveat: These macros do not work for virtual base classes.

// Note: These definitions are exact duplicates of definitions in
// ktypes.h. If either definition is changed, the other should be too
// to avoid compiler messages.

#define CYG_CLASSFROMFIELD(_type_,_member_,_ptr_)\
    ((_type_ *)((char *)(_ptr_)-((char *)&(((_type_ *)0)->_member_))))

#define CYG_OFFSETOFBASE(_type_,_base_)\
    ((char *)((_base_ *)((_type_ *)4)) - (char *)4)

# define CYG_CLASSFROMBASE(_class_,_base_,_ptr_)\
    ((_class_ *)((char *)(_ptr_) - CYG_OFFSETOFBASE(_class_,_base_)))


// -------------------------------------------------------------------------
// Cyg_DNode class.
// This simply represents a double linked node that is intended to
// be a base member of the class that is being managed.

class Cyg_DNode
{
    friend class Cyg_CList;
    
    Cyg_DNode   *next;
    Cyg_DNode   *prev;

public:

    Cyg_DNode()
    {
        // Initialize pointers to point here
        next = prev = this;
    };

    // Accessor and test functions
    Cyg_DNode *get_next() { return next; };
    Cyg_DNode *get_prev() { return prev; };
    cyg_bool  in_list() { return next != this; };
    
    // Insert a node into the list before this one,
    // so that it becomes this nodes predecessor in
    // the list.
    void insert( Cyg_DNode *node )
    {
        node->next = this;
        node->prev = prev;
        prev->next = node;
        prev = node;
    };

    // Append a node after this one so that it become
    // this nodes sucessor in the list.
    void append( Cyg_DNode *node )
    {
        node->prev = this;
        node->next = next;
        next->prev = node;
        next = node;
    };

    // Unlink this node from it's list. It is safe to apply this to an
    // already unlinked node.
    void unlink()
    {
        next->prev = prev;
        prev->next = next;
        next = prev = this;
    };
    
    ~Cyg_DNode()
    {
        // If this node is still linked, unlink it.
        if( next != this )
            unlink();
    };
    
};

// -------------------------------------------------------------------------
// Cyg_CList class.

// This is a simple class that manages a circular list of DNodes. This
// object points to the head of the list and provides functions to
// manipulate the head and tail of the list.

class Cyg_CList
{
    Cyg_DNode   *head;                  // list head pointer

public:

    Cyg_CList()
    {
        head = NULL;
    };

    // Accessor and test functions
    Cyg_DNode *get_head() { return head; };
    Cyg_DNode *get_tail() { return head?head->prev:NULL; };
    cyg_bool empty() { return head == NULL; };
    
    // Add a node at the head of the list
    void add_head( Cyg_DNode *node )
    {
        if( head == NULL )
            head = node;
        else
        {
            head->insert( node );
            head = node;
        }
    };

    // Remove the node at the head of the list
    Cyg_DNode *rem_head()
    {
        Cyg_DNode *node = head;
        if( node != NULL )
        {
            // There is a node available
            Cyg_DNode *next = node->next;
            if( next == node )
            {
                // Only node on list
                head = NULL;
            }
            else
            {
                // remove head node and move head to next.
                node->unlink();
                head = next;
            }
        }
        return node;
    };


    // Add a node at the tail of the list
    void add_tail( Cyg_DNode *node )
    {
        if( head == NULL )
            head = node;
        else
            head->insert( node );
    };

    // Remove the node at the tail of the list
    Cyg_DNode *rem_tail()
    {
        if( head == NULL )
            return NULL;

        Cyg_DNode *node = head->prev;

        if( node == head )
            head = NULL;
        else node->unlink();
        
        return node;
    };

    // Merge the supplied list into this one, at the tail.
    void merge( Cyg_CList& list )
    {
        if( list.head == NULL )
            return;                     // Nothing to do
        else if( head == NULL )
            head = list.head;           // this is empty, just move it
        else
        {
            // We have a real merge to do. Adjust the pointers
            // on the two lists so that they become one.

            Cyg_DNode *lh = list.head;
            Cyg_DNode *lt = lh->prev;
            Cyg_DNode *tail = head->prev;

            head->prev = lt;
            lt->next = head;
            tail->next = lh;
            lh->prev = tail;
        }
        list.head = NULL;
    };
    
    // General removal. Deals with what happend if this is only
    // object on list, or is the head.
    void remove( Cyg_DNode *node )
    {
        if( node == head )
            rem_head();
        else node->unlink();
    };

    // Rotation - move the head to the next node in the list.
    void rotate()
    {
        if( head )
            head = head->next;
    };

    // Move a node to the head of the list. Assumes that the
    // node is in this list.
    void to_head( Cyg_DNode *node )
    {
        head = node;
    };

    // Insert a node before one in this list, and deal with what
    // happens if the node happens to be at the head of the list.
    void insert( Cyg_DNode *list_node, Cyg_DNode *node )
    {
        if( list_node == head )
        {
            head->insert( node );
            head = node;
        }
        else list_node->insert( node );
    };
    
    ~Cyg_CList()
    {
        while( head != NULL )
            rem_head();
    };

};

// -------------------------------------------------------------------------
// Cyg_CList_T
// Template class that allows us to make use of the CList class in a
// type-specific way.

template <class T> class Cyg_CList_T
    : public Cyg_CList
{
public:

    Cyg_CList_T() {};
    ~Cyg_CList_T() {};

    T *get_head()
    {
        Cyg_DNode *node = Cyg_CList::get_head();
        if( node ) return CYG_CLASSFROMBASE( T, Cyg_DNode, node );
        return NULL;
    };
    T *get_tail()
    {
        Cyg_DNode *node = Cyg_CList::get_tail();
        if( node ) return CYG_CLASSFROMBASE( T, Cyg_DNode, node );
        return NULL;
    };
    
    T *rem_head()
    {
        Cyg_DNode *node = Cyg_CList::rem_head();
        if( node ) return CYG_CLASSFROMBASE( T, Cyg_DNode, node );
        return NULL;
    };

    T *rem_tail()
    {
        Cyg_DNode *node = Cyg_CList::rem_tail();
        if( node ) return CYG_CLASSFROMBASE( T, Cyg_DNode, node );
        return NULL;
    };

    // The rest just default to the Cyg_CList class operations.
};

// -------------------------------------------------------------------------
// Cyg_DNode_T
// Template class that allows us to make use of the DNode class in a
// type-specific way.

template <class T> class Cyg_DNode_T
    : public Cyg_DNode
{
public:

    Cyg_DNode_T() {};
    ~Cyg_DNode_T() {};

    T *get_next() { return CYG_CLASSFROMBASE( T, Cyg_DNode, Cyg_DNode::get_next() ); };
    T *get_prev() { return CYG_CLASSFROMBASE( T, Cyg_DNode, Cyg_DNode::get_prev() ); };

    // The rest just default to the Cyg_DNode class operations.
};

// -------------------------------------------------------------------------
#endif // CYGONCE_INFRA_CLIST_HXX multiple inclusion protection
// EOF clist.hxx

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区日韩欧美| 欧美一级一级性生活免费录像| 日韩欧美中文一区| 亚洲最大的成人av| 成人一区二区三区视频在线观看| 欧美日本一区二区在线观看| 国产精品久久777777| 国产精品1区二区.| 欧美成人性战久久| 久久激情五月激情| 欧美一级欧美三级在线观看| 亚洲国产成人tv| 欧美在线制服丝袜| 亚洲尤物在线视频观看| 色综合久久中文字幕| 亚洲日本一区二区| 99国产一区二区三精品乱码| 中文字幕乱码亚洲精品一区| 成人午夜又粗又硬又大| 国产精品素人视频| 白白色 亚洲乱淫| 中文字幕日韩精品一区| 97se亚洲国产综合自在线不卡| 国产精品高潮呻吟久久| 97久久超碰国产精品电影| 专区另类欧美日韩| 欧美亚男人的天堂| 免费成人美女在线观看.| 亚洲成人福利片| 欧美日韩中字一区| 国产资源精品在线观看| 久久久精品综合| 最新不卡av在线| 亚洲一区二区三区自拍| 日本韩国精品一区二区在线观看| 亚洲你懂的在线视频| 欧美日韩亚洲国产综合| 精品一区二区三区免费观看| 国产亚洲欧洲997久久综合| 91欧美一区二区| 日韩激情中文字幕| 国产欧美日韩久久| 欧美伦理电影网| 处破女av一区二区| 午夜精品久久久久久久蜜桃app| 精品女同一区二区| 91免费在线看| 韩国视频一区二区| 悠悠色在线精品| 久久久www成人免费无遮挡大片| 色综合久久综合网97色综合| 激情成人午夜视频| 亚洲成人午夜电影| 亚洲欧洲精品一区二区三区| 91精品国产免费| 欧美午夜寂寞影院| 91香蕉视频mp4| 成人国产精品免费观看动漫| 图片区小说区区亚洲影院| 久久精品日产第一区二区三区高清版| 91最新地址在线播放| 51久久夜色精品国产麻豆| 日韩在线播放一区二区| 国产午夜精品福利| 在线亚洲人成电影网站色www| 精品一区二区三区免费观看| 一区二区三区免费看视频| 国产三级欧美三级日产三级99| 欧美性感一类影片在线播放| 国产99久久久国产精品潘金网站| 性感美女久久精品| 中文字幕在线一区免费| 久久在线观看免费| 91精品国产一区二区三区 | 欧美三日本三级三级在线播放| 亚洲国产日产av| 亚洲一区二区三区在线| 亚洲欧洲日产国码二区| 国产欧美日韩卡一| 国产日韩欧美亚洲| 欧美经典一区二区三区| 久久久久久久精| 久久久久国产精品人| 国产亚洲欧美一区在线观看| 亚洲男人都懂的| 国产精品无码永久免费888| 国产日产欧美一区| 中文成人av在线| 国产精品女上位| 国产精品久99| 亚洲人被黑人高潮完整版| 国产精品全国免费观看高清| 国产精品国产三级国产| 一级中文字幕一区二区| 亚洲一线二线三线久久久| 亚洲va欧美va国产va天堂影院| 国产精品久久久久一区| 久久久精品tv| 欧美在线你懂得| 欧洲人成人精品| 91精品国产色综合久久久蜜香臀| 欧美成人官网二区| 国产欧美精品一区aⅴ影院| 一区二区中文视频| 久久新电视剧免费观看| 亚洲欧洲99久久| 午夜视频在线观看一区| 国产一区视频导航| 91年精品国产| 精品国产乱码久久久久久1区2区| 国产美女精品一区二区三区| 国产一区不卡视频| 在线观看日韩毛片| 欧美精品一区二区精品网| 亚洲精品你懂的| 国产福利91精品一区| 在线观看欧美日本| 国产欧美一区二区精品仙草咪| 国产精品欧美久久久久无广告 | 成人午夜伦理影院| 91精品婷婷国产综合久久| 国产精品欧美综合在线| 午夜成人在线视频| 一本一道久久a久久精品综合蜜臀| 日韩精品在线一区二区| 亚洲精品免费在线观看| 久久精品99国产国产精| eeuss鲁片一区二区三区在线观看| 在线不卡一区二区| 亚洲精品在线网站| 男人操女人的视频在线观看欧美 | 91久久免费观看| 中文字幕一区二区三中文字幕| 老司机精品视频导航| 色域天天综合网| 综合激情网...| 91啪亚洲精品| 日韩欧美中文一区| 美女视频黄免费的久久| 在线看日韩精品电影| 亚洲美女屁股眼交3| 91久久精品国产91性色tv| 亚洲精品国产一区二区三区四区在线 | 一本一道综合狠狠老| 亚洲色图都市小说| 91香蕉视频在线| 亚洲一区国产视频| 欧美图区在线视频| 日韩国产欧美三级| 成人黄色在线视频| 自拍偷拍国产亚洲| 色哟哟欧美精品| 一区二区三区精品| 欧美视频一二三区| 美美哒免费高清在线观看视频一区二区| 色域天天综合网| 亚洲日本欧美天堂| 欧美久久免费观看| 男人的j进女人的j一区| 国产丝袜美腿一区二区三区| 成人av电影免费观看| 亚洲成av人在线观看| 久久只精品国产| 国产精品系列在线播放| 亚洲综合成人在线| 精品国产免费一区二区三区四区 | 美国三级日本三级久久99| 国产一区二区女| 2022国产精品视频| 欧洲一区在线观看| 久久精品国产澳门| 日韩欧美123| 国产成a人亚洲精品| 午夜精品福利在线| 久久精品水蜜桃av综合天堂| 欧美性高清videossexo| 国产成人亚洲精品青草天美| 欧美国产精品一区二区三区| 欧美日韩国产乱码电影| 成人中文字幕电影| 午夜成人在线视频| 亚洲免费在线视频| 久久久久久久久免费| 成人黄色电影在线| 久久精品国产久精国产| 亚洲一区二区黄色| 国产欧美一区二区精品久导航| 日韩一区二区在线观看视频| 色欧美88888久久久久久影院| 日韩在线一区二区| 亚洲一区二区三区在线| 国产精品三级视频| 精品国产成人系列| 制服丝袜亚洲色图| 欧美日韩不卡在线| 91麻豆视频网站| 91国内精品野花午夜精品| 色婷婷综合久久久久中文 | 久久精品在线免费观看| 欧美一区二区二区|