product.h

来自「第一次上传」· C头文件 代码 · 共 36 行

H
36
字号
#include "property_mgr.h"
//class product_node;
class product{                                                               //商品类
	//friend class product_node;
public:
    string name_product;                                                     //商品名称
	property_mgr<string>* char_mgr;                                          //描述型属性
	property_mgr<int>* int_mgr;                                              //数值型属性	
	product();                                                               //构造函数
	product(string n_product);                                               //构造函数
	product(string n_product,string n_property,string c_char_property);      //构造函数
	product(string n_product,string n_property,int c_int_property);          //构造函数
};
product::product(){
	name_product="新商品";
	char_mgr=new property_mgr<string>();
	int_mgr=new property_mgr<int>();
}

product::product(string n_product){
	name_product=n_product;
	char_mgr=new property_mgr<string>();
	int_mgr=new property_mgr<int>();
}

product::product(string n_product,string n_property,string c_char_property){
	name_product=n_product;
	char_mgr=new property_mgr<string>(n_property,c_char_property);
	int_mgr=new property_mgr<int>();
}

product::product(string n_product,string n_property,int c_int_property){
	name_product=n_product;
	char_mgr=new property_mgr<string>();
	int_mgr=new property_mgr<int>(n_property,c_int_property);
}

⌨️ 快捷键说明

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