?? oblist.h
字號:
#ifndef _OBLIST_H
#define _OBLIST_H
#ifdef WIN32
#ifdef OBLIST_EXPORTS
#define OBLIST_API __declspec(dllexport)
#else
#define OBLIST_API __declspec(dllimport)
#endif
#else
#define OBLIST_API
#endif
class ObList;
class OBLIST_API DBObject {
public:
DBObject();
};
typedef struct Node
{
Node* pNext;
Node* pPrev;
void* data;
}Node;
class OBLIST_API ObList {
public:
ObList();
~ObList();
// Attributes
int GetCount() {return m_nCount;};
void SetCount(int count) {m_nCount=count;};
Node* GetHead(){return m_pNodeHead;};
Node* GetTail(){return m_pNodeTail;};
// Operations
// add before head or after tail
void AddHead(void* newElement);
void AddTail(void* newElement);
// remove before head or after tail
void AddHead(ObList* pNewList);
void AddTail(ObList* pNewList);
// add another list of elements before head or after tail
void RemoveHead();
void RemoveTail();
// remove all elements
void RemoveAll();
// remove an element at a given position
void RemoveAt(int nIndex);
void RemoveAt(Node* node);
// getting an element at a given position
Node* GetNext(Node* node);
Node* GetPrev(Node* node);
Node* GetAt(int nIndex);
void SetAt(int nIndex,void* newElement);
// inserting before or after a given position
Node* InsertBefore(Node* node, void* newElement);
Node* InsertAfter(Node* node, void* newElement);
Node* FindAfter(void* searchValue, Node* startAfter = NULL) ;
Node* FindBefore(void* searchValue, Node* startBefore = NULL) ;
virtual ObList& operator = (ObList& list);
// Implementation
protected:
Node* m_pNodeHead;
Node* m_pNodeTail;
int m_nCount;
protected:
Node* NewNode();
ObList& Copy(ObList&);
};
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -