-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.h
126 lines (86 loc) · 2.14 KB
/
client.h
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#pragma once
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <memory>
#include <fstream>
#include <iomanip>
#include <chrono>
#include <map>
#include <filesystem>
#include <set>
#include <list>
#include "logger.h"
#include "os_wrappers.h"
#include "client_open62541.h"
#include "common_types.h"
#include "common_defines.h"
#include "job_open62541_node.h"
#define MAX_JOB_LENGTH 100
namespace cab
{
/* Class Client */
class Client
{
public:
/* Basics */
Client();
Client(const Client&) = delete;
Client&
operator=(const Client&) = delete;
Client(Client&&) = delete;
Client&
operator=(Client&&) = delete;
virtual
~Client();
int
connect(int &argc, char *argv[]);
void
disconnect();
void
run_iterate();
/* Cab service / available jobs */
void
add_monitored_item(opcuac::jobsptr);
void
delete_monitored_item(opcuac::jobsptr);
void
read_node(opcuac::jobsptr);
void
write_node(opcuac::jobsptr);
void
browse_nodes(opcuac::jobsptr);
void
print_label(opcuac::jobsptr);
void
replace_label(opcuac::jobsptr);
void
upload_stream(opcuac::jobsptr);
private:
void
show_usage(void);
bool
file_finder(const std::string& dir, const std::string& file);
void
create_job(const std::string& input);
std::map<int, std::string>
parse_args(const std::string& input);
bool
digits(const std::string& str);
opcuac::jobsptr
nodeID_type(opcuac::jobsptr, const std::string&, const std::string&);
void
print_jobs_(void);
void
print_job(opcuac::jobsptr);
opcuac::datasptr
init_data(std::map<int, std::string>&) const;
opc_time_t
system_time(void) const;
/* Variables */
open62541::Client* client_;
std::list<opcuac::jobsptr> jobs_;
};
} // namespace cab
/* Eof */