binary_endpoints.cpp
Go to the documentation of this file.
1 
11 #include "binary_serialization.h"
12 
16 
17 #include <algorithm>
18 #include <memory>
19 #include <string>
20 
21 namespace OpcUa
22 {
25 {
26 
27 }
28 
31 {
32 
33 }
34 
35 namespace Binary
36 {
37 
38 //-----------------------------------------------------
39 // FindServersParameters
40 //-----------------------------------------------------
41 
42 template<>
44 {
45  return RawSize(params.EndpointUrl) +
46  RawSizeContainer(params.Locales) +
47  RawSizeContainer(params.ServersToReturn);
48 }
49 
50 template<>
51 void DataSerializer::Serialize<FindServersParameters>(const FindServersParameters & params)
52 {
53  *this << params.EndpointUrl;
54  *this << params.Locales;
55  *this << params.ServersToReturn;
56 }
57 
58 template<>
59 void DataDeserializer::Deserialize<FindServersParameters>(FindServersParameters & params)
60 {
61  *this >> params.EndpointUrl;
62  *this >> params.Locales;
63  *this >> params.ServersToReturn;
64 }
65 
66 //---------------------------------------------------
67 // FindServersRequest
68 //---------------------------------------------------
69 
70 template<>
71 std::size_t RawSize<FindServersRequest>(const FindServersRequest & request)
72 {
73  return RawSize(request.TypeId) + RawSize(request.Header) + RawSize(request.Parameters);
74 }
75 
76 template<>
77 void DataSerializer::Serialize<FindServersRequest>(const FindServersRequest & request)
78 {
79  *this << request.TypeId;
80  *this << request.Header;
81  *this << request.Parameters;
82 }
83 
84 template<>
85 void DataDeserializer::Deserialize<FindServersRequest>(FindServersRequest & request)
86 {
87  *this >> request.TypeId;
88  *this >> request.Header;
89  *this >> request.Parameters;
90 }
91 
92 //-----------------------------------------------------
93 // FindServersData
94 //-----------------------------------------------------
95 
96 template<>
97 std::size_t RawSize<FindServersData>(const FindServersData & data)
98 {
99  return RawSizeContainer(data.Descriptions);
100 }
101 
102 template<>
103 void DataSerializer::Serialize<FindServersData>(const FindServersData & data)
104 {
105  SerializeContainer(*this, data.Descriptions);
106 }
107 
108 template<>
109 void DataDeserializer::Deserialize<FindServersData>(FindServersData & data)
110 {
111  DeserializeContainer(*this, data.Descriptions);
112 }
113 
114 //-----------------------------------------------------
115 // FindServersResponse
116 //-----------------------------------------------------
117 
118 template<>
120 {
121  return RawSize(resp.TypeId) + RawSize(resp.Header) + RawSize(resp.Data);
122 }
123 
124 template<>
125 void DataSerializer::Serialize<FindServersResponse>(const FindServersResponse & resp)
126 {
127  *this << resp.TypeId;
128  *this << resp.Header;
129  *this << resp.Data;
130 }
131 
132 template<>
133 void DataDeserializer::Deserialize<FindServersResponse>(FindServersResponse & resp)
134 {
135  *this >> resp.TypeId;
136  *this >> resp.Header;
137  *this >> resp.Data;
138 }
139 
140 }
141 }
142 
std::size_t RawSize< FindServersResponse >(const FindServersResponse &resp)
void SerializeContainer(Stream &out, const Container &c, uint32_t emptySizeValue=~uint32_t())
std::size_t RawSize< FindServersRequest >(const FindServersRequest &request)
void DeserializeContainer(Stream &in, Container &c)
OPC UA Address space part. GNU LGPL.
const char * Binary(const char *input, short n)
std::size_t RawSize< FindServersParameters >(const FindServersParameters &params)
std::size_t RawSizeContainer(const T &container)
std::size_t RawSize< FindServersData >(const FindServersData &data)
std::size_t RawSize(const T &obj)


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:06:03