summaryrefslogtreecommitdiff
path: root/src/test/commonapi/tests/DerivedTypeCollection.cpp
blob: edf4c7cd8edab30acf0bb975d2f7b1f6973b6448 (plain)
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
63
64
65
66
67
68
69
70
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.core 3.0.1.v201504231326.
* Used org.franca.core 0.9.1.201412191134.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at
* http://mozilla.org/MPL/2.0/.
*/
#include "DerivedTypeCollection.hpp"


namespace commonapi {
namespace tests {


bool DerivedTypeCollection::TestStructExtended::operator==(const DerivedTypeCollection::TestStructExtended& _other) const {
	return (getTestString() == _other.getTestString() && getUintValue() == _other.getUintValue() && getTestEnumExtended2() == _other.getTestEnumExtended2());
}

#ifndef WIN32
const int32_t DerivedTypeCollection::TestEnum::E_UNKNOWN;
const int32_t DerivedTypeCollection::TestEnum::E_OK;
const int32_t DerivedTypeCollection::TestEnum::E_OUT_OF_RANGE;
const int32_t DerivedTypeCollection::TestEnum::E_NOT_USED;
const int32_t DerivedTypeCollection::TestEnumExtended2::E_NEW2;
const int32_t DerivedTypeCollection::TestEnumMissingValue::E1;
const int32_t DerivedTypeCollection::TestEnumMissingValue::E2;
const int32_t DerivedTypeCollection::TestEnumMissingValue::E3;
const int32_t DerivedTypeCollection::TestEnumExtended::E_NEW;
#endif

bool DerivedTypeCollection::TestStruct::operator==(const DerivedTypeCollection::TestStruct& _other) const {
	return (getTestString() == _other.getTestString() && getUintValue() == _other.getUintValue());
}

std::shared_ptr<DerivedTypeCollection::TestPolymorphicStruct> DerivedTypeCollection::TestPolymorphicStruct::create(CommonAPI::Serial _serial) {
	switch (_serial) {
	case DerivedTypeCollection::TESTPOLYMORPHICSTRUCT_SERIAL:
		return std::make_shared<DerivedTypeCollection::TestPolymorphicStruct>();
	case DerivedTypeCollection::TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL:
		return std::make_shared<DerivedTypeCollection::TestExtendedPolymorphicStruct>();
	default:
		break;
	}
	return std::shared_ptr<DerivedTypeCollection::TestPolymorphicStruct>();
}

bool DerivedTypeCollection::TestPolymorphicStruct::operator==(const DerivedTypeCollection::TestPolymorphicStruct& _other) const {
	return (getTestString() == _other.getTestString() && getUintValue() == _other.getUintValue());
}


bool DerivedTypeCollection::TestExtendedPolymorphicStruct::operator==(const DerivedTypeCollection::TestExtendedPolymorphicStruct& _other) const {
	return (getTestString() == _other.getTestString() && getUintValue() == _other.getUintValue() && getAdditionalValue() == _other.getAdditionalValue());
}


bool DerivedTypeCollection::StructWithPolymorphicMember::operator==(const DerivedTypeCollection::StructWithPolymorphicMember& _other) const {
	return (getNumberValue() == _other.getNumberValue() && getPolymorphicMember() == _other.getPolymorphicMember());
}


bool DerivedTypeCollection::StructWithEnumKeyMap::operator==(const DerivedTypeCollection::StructWithEnumKeyMap& _other) const {
	return (getTestMap() == _other.getTestMap());
}


} // namespace tests
} // namespace commonapi