⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oblist.h

📁 oracle oci 轻量级封装库,很方便和实用!适合于简单的数据库操作.绝对精品.垃圾就不上传了.
💻 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 + -