/src/opendnp3/cpp/lib/src/gen/objects/Group50.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 "Group50.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 | | // ------- Group50Var1 ------- |
44 | | |
45 | 3.18k | Group50Var1::Group50Var1() : time(0) |
46 | 3.18k | {} |
47 | | |
48 | | bool Group50Var1::Read(rseq_t& buffer, Group50Var1& output) |
49 | 2.96k | { |
50 | 2.96k | return LittleEndian::read(buffer, output.time); |
51 | 2.96k | } |
52 | | |
53 | | bool Group50Var1::Write(const Group50Var1& arg, ser4cpp::wseq_t& buffer) |
54 | 0 | { |
55 | 0 | return LittleEndian::write(buffer, arg.time); |
56 | 0 | } |
57 | | |
58 | | // ------- Group50Var3 ------- |
59 | | |
60 | 1.13k | Group50Var3::Group50Var3() : time(0) |
61 | 1.13k | {} |
62 | | |
63 | | bool Group50Var3::Read(rseq_t& buffer, Group50Var3& output) |
64 | 465 | { |
65 | 465 | return LittleEndian::read(buffer, output.time); |
66 | 465 | } |
67 | | |
68 | | bool Group50Var3::Write(const Group50Var3& arg, ser4cpp::wseq_t& buffer) |
69 | 0 | { |
70 | 0 | return LittleEndian::write(buffer, arg.time); |
71 | 0 | } |
72 | | |
73 | | // ------- Group50Var4 ------- |
74 | | |
75 | 5.84k | Group50Var4::Group50Var4() : time(0), interval(0), units(0) |
76 | 5.84k | {} |
77 | | |
78 | | bool Group50Var4::Read(rseq_t& buffer, Group50Var4& output) |
79 | 3.99k | { |
80 | 3.99k | return LittleEndian::read(buffer, output.time, output.interval, output.units); |
81 | 3.99k | } |
82 | | |
83 | | bool Group50Var4::Write(const Group50Var4& arg, ser4cpp::wseq_t& buffer) |
84 | 1.84k | { |
85 | 1.84k | return LittleEndian::write(buffer, arg.time, arg.interval, arg.units); |
86 | 1.84k | } |
87 | | |
88 | | bool Group50Var4::ReadTarget(rseq_t& buff, TimeAndInterval& output) |
89 | 3.99k | { |
90 | 3.99k | Group50Var4 value; |
91 | 3.99k | if(Read(buff, value)) |
92 | 3.99k | { |
93 | 3.99k | output = TimeAndIntervalFactory::From(value.time, value.interval, value.units); |
94 | 3.99k | return true; |
95 | 3.99k | } |
96 | 0 | else |
97 | 0 | { |
98 | 0 | return false; |
99 | 0 | } |
100 | 3.99k | } |
101 | | |
102 | | bool Group50Var4::WriteTarget(const TimeAndInterval& value, ser4cpp::wseq_t& buff) |
103 | 1.84k | { |
104 | 1.84k | return Group50Var4::Write(ConvertGroup50Var4::Apply(value), buff); |
105 | 1.84k | } |
106 | | |
107 | | |
108 | | } |