1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/curriculum-design-express_station_system_gui

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
record.h 1.1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
怎样 Отправлено 06.01.2021 15:16 af2f1d3
#pragma once
#include "basicType.h"
#include "typeHelper.h"
#include <vector>
using namespace std;
enum recType{ADD,DEL,MOD};
class record
{
private:
void setAddTarget(vector<shared_ptr<Basic>> addTarget) //“增”时需要指定增进去的元组,会自动拷贝
{
for(shared_ptr<Basic> v : addTarget)
this->targetTuple.push_back(typeHelper::copy(v));
}
public:
int opSub=-1;
recType type;
record(vector<shared_ptr<Basic>> addTarget) : type(ADD) //“增”的构造函数
{
this->setAddTarget(addTarget);
}
record(int opSub) : opSub(opSub), type(DEL) {} //“删”的构造函数
record(int opSub, vector<shared_ptr<Basic>> modTarget) : opSub(opSub), type(MOD) //“改”的构造函数
{
this->setAddTarget(modTarget);
}
record(const record &r) : opSub(r.opSub), type(r.type)
{
this->setAddTarget(r.targetTuple);
}
~record(){}
vector<shared_ptr<Basic>> targetTuple; //仅当type!=del时使用,变更之后的元组,placeholder对象为不修改
};

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/curriculum-design-express_station_system_gui.git
git@api.gitlife.ru:oschina-mirror/curriculum-design-express_station_system_gui.git
oschina-mirror
curriculum-design-express_station_system_gui
curriculum-design-express_station_system_gui
master