-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjob_open62541_node.cpp
62 lines (47 loc) · 1.21 KB
/
job_open62541_node.cpp
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
#include "job_open62541_node.h"
using namespace open62541;
/* Class JobDecNode */
JobDecNode::JobDecNode(opcuac::jobsptr old) noexcept : open62541::Job(old)
{
}
/* Class JNumeric */
JNumeric::JNumeric(opcuac::jobsptr old, const int& id, const int& ns) noexcept
: open62541::JobDecNode(old)
{
UA_NodeId_init(&this->target_);
this->target_ = UA_NODEID_NUMERIC(ns, id);
this->add_info(PRAEFIX_ID, std::to_string(id));
this->add_info(PRAEFIX_NS, std::to_string(ns));
this->add_info(PRAEFIX_NODE, "Numeric");
}
JNumeric::~JNumeric() noexcept
{
/* Clean up */
UA_NodeId_clear(&this->target_);
}
UA_NodeId&
JNumeric::nodeID(void)
{
return this->target_;
}
/* Class JString */
JString::JString(opcuac::jobsptr old, const std::string& id, const int& ns) noexcept
: open62541::JobDecNode(old)
{
UA_NodeId_init(&this->target_);
this->target_ = UA_NODEID_STRING_ALLOC(ns, id.c_str());
this->add_info(PRAEFIX_ID, id);
this->add_info(PRAEFIX_NS, std::to_string(ns));
this->add_info(PRAEFIX_NODE, "String");
}
JString::~JString() noexcept
{
/* Clean up */
UA_NodeId_clear(&this->target_);
}
UA_NodeId&
JString::nodeID(void)
{
return this->target_;
}
/* Eof */