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

📄 com_clg_pre.h

📁 在本实例中,实现了单体模式,工厂模式,门面模式以及STL编程
💻 H
字号:
#pragma once
#ifndef COM_CLG_PRE_H
#define COM_CLG_PRE_H 1
#include "clg_pre.h"
#include "student.h"
#include"com_stu1.h"
#include<vector>
#include"string"
#include"iostream"
using namespace std;
class com_clg_pre:public clg_pre
{
public:
	vector<CString> v_Student;
	vector<CString>::iterator it;
	static com_clg_pre *com_pre;
	com_clg_pre()
	{
	   this->name="xiaoli";
	   v_Student.push_back("2005101");
	   v_Student.push_back("2005102");
	   v_Student.push_back("2005103");
	}
	student* zhaodao(CString strid)
	{   
		v_Student.rbegin();
		for(it=v_Student.begin();it<v_Student.end();it++)
		{
			if(strid==*it)
		  {    
			  return new com_stu(strid);;
		  }
		}
		return NULL;
	}
	static com_clg_pre* createpre()//利用单体模式,确立院长只可以有一个
		{
   if(com_pre==NULL)
   {
      com_pre=new com_clg_pre();
   }
   return com_pre;
   }

};


#endif

⌨️ 快捷键说明

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