派生自 development/c++

xuxiuxi
2019-03-04 93fcc2eb2db5038ca1944acde9f4c8b751aca930
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
 
#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