/src/opendnp3/cpp/lib/src/gen/objects/Group23.cpp
Line | Count | Source |
1 | | // |
2 | | // _ _ ______ _ _ _ _ _ _ _ |
3 | | // | \ | | | ____| | (_) | (_) | | | | |
4 | | // | \| | ___ | |__ __| |_| |_ _ _ __ __ _| | | | |
5 | | // | . ` |/ _ \ | __| / _` | | __| | '_ \ / _` | | | | |
6 | | // | |\ | (_) | | |___| (_| | | |_| | | | | (_| |_|_|_| |
7 | | // |_| \_|\___/ |______\__,_|_|\__|_|_| |_|\__, (_|_|_) |
8 | | // __/ | |
9 | | // |___/ |
10 | | // |
11 | | // This file is auto-generated. Do not edit manually |
12 | | // |
13 | | // Copyright 2013-2022 Step Function I/O, LLC |
14 | | // |
15 | | // Licensed to Green Energy Corp (www.greenenergycorp.com) and Step Function I/O |
16 | | // LLC (https://stepfunc.io) under one or more contributor license agreements. |
17 | | // See the NOTICE file distributed with this work for additional information |
18 | | // regarding copyright ownership. Green Energy Corp and Step Function I/O LLC license |
19 | | // this file to you under the Apache License, Version 2.0 (the "License"); you |
20 | | // may not use this file except in compliance with the License. You may obtain |
21 | | // a copy of the License at: |
22 | | // |
23 | | // http://www.apache.org/licenses/LICENSE-2.0 |
24 | | // |
25 | | // Unless required by applicable law or agreed to in writing, software |
26 | | // distributed under the License is distributed on an "AS IS" BASIS, |
27 | | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
28 | | // See the License for the specific language governing permissions and |
29 | | // limitations under the License. |
30 | | // |
31 | | |
32 | | #include "Group23.h" |
33 | | |
34 | | #include "app/parsing/DNPTimeParsing.h" |
35 | | #include <ser4cpp/serialization/LittleEndian.h> |
36 | | #include "app/MeasurementFactory.h" |
37 | | #include "app/WriteConversions.h" |
38 | | |
39 | | using namespace ser4cpp; |
40 | | |
41 | | namespace opendnp3 { |
42 | | |
43 | | // ------- Group23Var1 ------- |
44 | | |
45 | 3.00k | Group23Var1::Group23Var1() : flags(0), value(0) |
46 | 3.00k | {} |
47 | | |
48 | | bool Group23Var1::Read(rseq_t& buffer, Group23Var1& output) |
49 | 3.00k | { |
50 | 3.00k | return LittleEndian::read(buffer, output.flags, output.value); |
51 | 3.00k | } |
52 | | |
53 | | bool Group23Var1::Write(const Group23Var1& arg, ser4cpp::wseq_t& buffer) |
54 | 0 | { |
55 | 0 | return LittleEndian::write(buffer, arg.flags, arg.value); |
56 | 0 | } |
57 | | |
58 | | bool Group23Var1::ReadTarget(rseq_t& buff, FrozenCounter& output) |
59 | 3.00k | { |
60 | 3.00k | Group23Var1 value; |
61 | 3.00k | if(Read(buff, value)) |
62 | 3.00k | { |
63 | 3.00k | output = FrozenCounterFactory::From(value.flags, value.value); |
64 | 3.00k | return true; |
65 | 3.00k | } |
66 | 0 | else |
67 | 0 | { |
68 | 0 | return false; |
69 | 0 | } |
70 | 3.00k | } |
71 | | |
72 | | bool Group23Var1::WriteTarget(const FrozenCounter& value, ser4cpp::wseq_t& buff) |
73 | 0 | { |
74 | 0 | return Group23Var1::Write(ConvertGroup23Var1::Apply(value), buff); |
75 | 0 | } |
76 | | |
77 | | // ------- Group23Var2 ------- |
78 | | |
79 | 4.10k | Group23Var2::Group23Var2() : flags(0), value(0) |
80 | 4.10k | {} |
81 | | |
82 | | bool Group23Var2::Read(rseq_t& buffer, Group23Var2& output) |
83 | 4.10k | { |
84 | 4.10k | return LittleEndian::read(buffer, output.flags, output.value); |
85 | 4.10k | } |
86 | | |
87 | | bool Group23Var2::Write(const Group23Var2& arg, ser4cpp::wseq_t& buffer) |
88 | 0 | { |
89 | 0 | return LittleEndian::write(buffer, arg.flags, arg.value); |
90 | 0 | } |
91 | | |
92 | | bool Group23Var2::ReadTarget(rseq_t& buff, FrozenCounter& output) |
93 | 4.10k | { |
94 | 4.10k | Group23Var2 value; |
95 | 4.10k | if(Read(buff, value)) |
96 | 4.10k | { |
97 | 4.10k | output = FrozenCounterFactory::From(value.flags, value.value); |
98 | 4.10k | return true; |
99 | 4.10k | } |
100 | 0 | else |
101 | 0 | { |
102 | 0 | return false; |
103 | 0 | } |
104 | 4.10k | } |
105 | | |
106 | | bool Group23Var2::WriteTarget(const FrozenCounter& value, ser4cpp::wseq_t& buff) |
107 | 0 | { |
108 | 0 | return Group23Var2::Write(ConvertGroup23Var2::Apply(value), buff); |
109 | 0 | } |
110 | | |
111 | | // ------- Group23Var5 ------- |
112 | | |
113 | 1.65k | Group23Var5::Group23Var5() : flags(0), value(0), time(0) |
114 | 1.65k | {} |
115 | | |
116 | | bool Group23Var5::Read(rseq_t& buffer, Group23Var5& output) |
117 | 1.65k | { |
118 | 1.65k | return LittleEndian::read(buffer, output.flags, output.value, output.time); |
119 | 1.65k | } |
120 | | |
121 | | bool Group23Var5::Write(const Group23Var5& arg, ser4cpp::wseq_t& buffer) |
122 | 0 | { |
123 | 0 | return LittleEndian::write(buffer, arg.flags, arg.value, arg.time); |
124 | 0 | } |
125 | | |
126 | | bool Group23Var5::ReadTarget(rseq_t& buff, FrozenCounter& output) |
127 | 1.65k | { |
128 | 1.65k | Group23Var5 value; |
129 | 1.65k | if(Read(buff, value)) |
130 | 1.65k | { |
131 | 1.65k | output = FrozenCounterFactory::From(value.flags, value.value, value.time); |
132 | 1.65k | return true; |
133 | 1.65k | } |
134 | 0 | else |
135 | 0 | { |
136 | 0 | return false; |
137 | 0 | } |
138 | 1.65k | } |
139 | | |
140 | | bool Group23Var5::WriteTarget(const FrozenCounter& value, ser4cpp::wseq_t& buff) |
141 | 0 | { |
142 | 0 | return Group23Var5::Write(ConvertGroup23Var5::Apply(value), buff); |
143 | 0 | } |
144 | | |
145 | | // ------- Group23Var6 ------- |
146 | | |
147 | 1.68k | Group23Var6::Group23Var6() : flags(0), value(0), time(0) |
148 | 1.68k | {} |
149 | | |
150 | | bool Group23Var6::Read(rseq_t& buffer, Group23Var6& output) |
151 | 1.68k | { |
152 | 1.68k | return LittleEndian::read(buffer, output.flags, output.value, output.time); |
153 | 1.68k | } |
154 | | |
155 | | bool Group23Var6::Write(const Group23Var6& arg, ser4cpp::wseq_t& buffer) |
156 | 0 | { |
157 | 0 | return LittleEndian::write(buffer, arg.flags, arg.value, arg.time); |
158 | 0 | } |
159 | | |
160 | | bool Group23Var6::ReadTarget(rseq_t& buff, FrozenCounter& output) |
161 | 1.68k | { |
162 | 1.68k | Group23Var6 value; |
163 | 1.68k | if(Read(buff, value)) |
164 | 1.68k | { |
165 | 1.68k | output = FrozenCounterFactory::From(value.flags, value.value, value.time); |
166 | 1.68k | return true; |
167 | 1.68k | } |
168 | 0 | else |
169 | 0 | { |
170 | 0 | return false; |
171 | 0 | } |
172 | 1.68k | } |
173 | | |
174 | | bool Group23Var6::WriteTarget(const FrozenCounter& value, ser4cpp::wseq_t& buff) |
175 | 0 | { |
176 | 0 | return Group23Var6::Write(ConvertGroup23Var6::Apply(value), buff); |
177 | 0 | } |
178 | | |
179 | | |
180 | | } |