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

📄 aggregate.h

📁 设计模式之Iterator
💻 H
字号:
#ifndef _AGGREGATE_H_ 
#define _AGGREGATE_H_

class Iterator;

typedef int Object;

class Interator;

class Aggregate 
{ 
public: 
	virtual ~Aggregate();
	virtual Iterator* CreateIterator() = 0;
	virtual Object GetItem(int idx) = 0;
	virtual int GetSize() = 0;
protected: 
	Aggregate();
private:
};

class ConcreteAggregate:public Aggregate 
{ 
public: 
	enum {SIZE = 3};
	ConcreteAggregate();
	~ConcreteAggregate();
	Iterator* CreateIterator();
	Object GetItem(int idx);
	int GetSize();
protected:
private: 
	Object _objs[SIZE];
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -