|
#ifndef CAMDEV_BUILDER_H
|
#define CAMDEV_BUILDER_H
|
#include <string>
|
#include <vector>
|
#include "CamDev.h"
|
using namespace std;
|
|
/**
|
* 摄像头设备构建器
|
*/
|
class CamDevBuilder {
|
public:
|
CamDevBuilder& addid(int id) {
|
camDevMap[CamDev_id] = to_string(id);
|
return *this;
|
}
|
CamDevBuilder& addcam_dev_id(std::string cam_dev_id) {
|
camDevMap[CamDev_cam_dev_id] = cam_dev_id;
|
return *this;
|
}
|
CamDevBuilder& addname(std::string name) {
|
camDevMap[CamDev_name] = name;
|
return *this;
|
}
|
CamDevBuilder& addaddr(std::string addr) {
|
camDevMap[CamDev_addr] = addr;
|
return *this;
|
}
|
CamDevBuilder& addlongitude(std::string longitude) {
|
camDevMap[CamDev_longitude] = longitude;
|
return *this;
|
}
|
CamDevBuilder& addlatitude(std::string latitude) {
|
camDevMap[CamDev_latitude] = latitude;
|
return *this;
|
}
|
CamDevBuilder& addip(std::string ip) {
|
camDevMap[CamDev_ip] = ip;
|
return *this;
|
}
|
CamDevBuilder& addport(int port) {
|
camDevMap[CamDev_port] = to_string(port);
|
return *this;
|
}
|
CamDevBuilder& addusername(std::string username) {
|
camDevMap[CamDev_username] = username;
|
return *this;
|
}
|
CamDevBuilder& addpassword(std::string password) {
|
camDevMap[CamDev_password] = password;
|
return *this;
|
}
|
CamDevBuilder& addbrand(std::string brand) {
|
camDevMap[CamDev_brand] = brand;
|
return *this;
|
}
|
CamDevBuilder& addreserved(std::string reserved) {
|
camDevMap[CamDev_reserved] = reserved;
|
return *this;
|
}
|
CamDevBuilder& addtype(std::string type) {
|
camDevMap[CamDev_type] = type;
|
return *this;
|
}
|
/** 摄像头设备 map */
|
std::map<std::string, std::string>& buildCamDevMap() {
|
return camDevMap;
|
}
|
public:
|
std::map<std::string, std::string> camDevMap;
|
};
|
|
#endif //CAMDEV_BUILDER_H
|