1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 #include "DerivedTypeCollection.h"
8 namespace DerivedTypeCollection {
10 TestStruct::TestStruct(const PredefinedTypeCollection::TestString& testStringValue, const uint16_t& uintValueValue):
11 testString(testStringValue),
12 uintValue(uintValueValue)
16 bool operator==(const TestStruct& lhs, const TestStruct& rhs) {
21 lhs.testString == rhs.testString &&
22 lhs.uintValue == rhs.uintValue
26 void TestStruct::readFromInputStream(CommonAPI::InputStream& inputStream) {
27 inputStream >> testString;
28 inputStream >> uintValue;
31 void TestStruct::writeToOutputStream(CommonAPI::OutputStream& outputStream) const {
32 outputStream << testString;
33 outputStream << uintValue;
35 TestStructExtended::TestStructExtended(const PredefinedTypeCollection::TestString& testStringValue, const uint16_t& uintValueValue, const TestEnumExtended2& testEnumExtended2Value):
36 TestStruct(testStringValue, uintValueValue),
37 testEnumExtended2(testEnumExtended2Value)
41 bool operator==(const TestStructExtended& lhs, const TestStructExtended& rhs) {
46 static_cast<TestStructExtended::TestStruct>(lhs) == static_cast<TestStructExtended::TestStruct>(rhs) &&
47 lhs.testEnumExtended2 == rhs.testEnumExtended2
51 void TestStructExtended::readFromInputStream(CommonAPI::InputStream& inputStream) {
52 TestStruct::readFromInputStream(inputStream);
53 inputStream >> testEnumExtended2;
56 void TestStructExtended::writeToOutputStream(CommonAPI::OutputStream& outputStream) const {
57 TestStruct::writeToOutputStream(outputStream);
58 outputStream << testEnumExtended2;
61 } // namespace DerivedTypeCollection
63 } // namespace commonapi