From 49d0b428ca19852d49965f35328a314f22d88807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Gehring?= Date: Wed, 17 Jun 2015 05:12:07 -0700 Subject: CommonAPI 3.1.2 --- .../core/commonapi/tests/DerivedTypeCollection.hpp | 434 +++++++++++++++++++++ 1 file changed, 434 insertions(+) create mode 100644 src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp (limited to 'src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp') diff --git a/src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp b/src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp new file mode 100644 index 0000000..70675c4 --- /dev/null +++ b/src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp @@ -0,0 +1,434 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* 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/. +*/ +#ifndef COMMONAPI_TESTS_Derived_Type_Collection_HPP_ +#define COMMONAPI_TESTS_Derived_Type_Collection_HPP_ + + +#include + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace commonapi { +namespace tests { + +struct DerivedTypeCollection { + struct TestStruct : CommonAPI::Struct<::commonapi::tests::PredefinedTypeCollection::TestString, uint16_t> { + + TestStruct() { + } + TestStruct(const ::commonapi::tests::PredefinedTypeCollection::TestString &_testString, const uint16_t &_uintValue) + { + std::get<0>(values_) = _testString; + std::get<1>(values_) = _uintValue; + } + /** + * description: the name of the property + */ + inline const ::commonapi::tests::PredefinedTypeCollection::TestString &getTestString() const { return std::get<0>(values_); } + inline void setTestString(const ::commonapi::tests::PredefinedTypeCollection::TestString &_value) { std::get<0>(values_) = _value; } + /** + * description: the actual value + */ + inline const uint16_t &getUintValue() const { return std::get<1>(values_); } + inline void setUintValue(const uint16_t &_value) { std::get<1>(values_) = _value; } + bool operator==(const TestStruct &_other) const; + inline bool operator!=(const TestStruct &_other) const { + return !((*this) == _other); + } + + }; + typedef std::vector TestArrayTestStruct; + typedef std::unordered_map TestMap; + /** + * description: Common errors. + */ + + struct TestEnum : CommonAPI::Enumeration { + enum Literal : int32_t { + E_UNKNOWN = 0, + E_OK = 1, + E_OUT_OF_RANGE = 2, + E_NOT_USED = 3 + }; + + TestEnum() = default; + TestEnum(const Literal &_value) + : CommonAPI::Enumeration(static_cast(_value)) {} + + inline bool operator==(const TestEnum &_other) const { return (value_ == _other.value_); } + inline bool operator!=(const TestEnum &_other) const { return (value_ != _other.value_); } + inline bool operator<=(const TestEnum &_other) const { return (value_ <= _other.value_); } + inline bool operator>=(const TestEnum &_other) const { return (value_ >= _other.value_); } + inline bool operator<(const TestEnum &_other) const { return (value_ < _other.value_); } + inline bool operator>(const TestEnum &_other) const { return (value_ > _other.value_); } + + inline bool operator==(const Literal &_value) const { return (value_ == static_cast(_value)); } + inline bool operator!=(const Literal &_value) const { return (value_ != static_cast(_value)); } + inline bool operator<=(const Literal &_value) const { return (value_ <= static_cast(_value)); } + inline bool operator>=(const Literal &_value) const { return (value_ >= static_cast(_value)); } + inline bool operator<(const Literal &_value) const { return (value_ < static_cast(_value)); } + inline bool operator>(const Literal &_value) const { return (value_ > static_cast(_value)); } + }; + + struct TestEnumExtended : TestEnum { + enum Literal : int32_t { + E_NEW = 4 + }; + + TestEnumExtended() = default; + TestEnumExtended(const Literal &_value) + : TestEnum(static_cast(_value)) {} + TestEnumExtended &operator=(const TestEnum::Literal &_value) { + value_ = static_cast(_value); + return (*this); + } + + inline bool operator==(const TestEnumExtended &_other) const { return (value_ == _other.value_); } + inline bool operator!=(const TestEnumExtended &_other) const { return (value_ != _other.value_); } + inline bool operator<=(const TestEnumExtended &_other) const { return (value_ <= _other.value_); } + inline bool operator>=(const TestEnumExtended &_other) const { return (value_ >= _other.value_); } + inline bool operator<(const TestEnumExtended &_other) const { return (value_ < _other.value_); } + inline bool operator>(const TestEnumExtended &_other) const { return (value_ > _other.value_); } + + inline bool operator==(const Literal &_value) const { return (value_ == static_cast(_value)); } + inline bool operator!=(const Literal &_value) const { return (value_ != static_cast(_value)); } + inline bool operator<=(const Literal &_value) const { return (value_ <= static_cast(_value)); } + inline bool operator>=(const Literal &_value) const { return (value_ >= static_cast(_value)); } + inline bool operator<(const Literal &_value) const { return (value_ < static_cast(_value)); } + inline bool operator>(const Literal &_value) const { return (value_ > static_cast(_value)); } + }; + + struct TestEnumExtended2 : TestEnumExtended { + enum Literal : int32_t { + E_NEW2 = 5 + }; + + TestEnumExtended2() = default; + TestEnumExtended2(const Literal &_value) + : TestEnumExtended(static_cast(_value)) {} + TestEnumExtended2 &operator=(const TestEnumExtended::Literal &_value) { + value_ = static_cast(_value); + return (*this); + } + TestEnumExtended &operator=(const TestEnum::Literal &_value) { + value_ = static_cast(_value); + return (*this); + } + + inline bool operator==(const TestEnumExtended2 &_other) const { return (value_ == _other.value_); } + inline bool operator!=(const TestEnumExtended2 &_other) const { return (value_ != _other.value_); } + inline bool operator<=(const TestEnumExtended2 &_other) const { return (value_ <= _other.value_); } + inline bool operator>=(const TestEnumExtended2 &_other) const { return (value_ >= _other.value_); } + inline bool operator<(const TestEnumExtended2 &_other) const { return (value_ < _other.value_); } + inline bool operator>(const TestEnumExtended2 &_other) const { return (value_ > _other.value_); } + + inline bool operator==(const Literal &_value) const { return (value_ == static_cast(_value)); } + inline bool operator!=(const Literal &_value) const { return (value_ != static_cast(_value)); } + inline bool operator<=(const Literal &_value) const { return (value_ <= static_cast(_value)); } + inline bool operator>=(const Literal &_value) const { return (value_ >= static_cast(_value)); } + inline bool operator<(const Literal &_value) const { return (value_ < static_cast(_value)); } + inline bool operator>(const Literal &_value) const { return (value_ > static_cast(_value)); } + }; + struct TestStructExtended : CommonAPI::Struct<::commonapi::tests::PredefinedTypeCollection::TestString, uint16_t, TestEnumExtended2> { + + TestStructExtended() { + } + TestStructExtended(const ::commonapi::tests::PredefinedTypeCollection::TestString &_testString, const uint16_t &_uintValue, const TestEnumExtended2 &_testEnumExtended2) + { + std::get<0>(values_) = _testString; + std::get<1>(values_) = _uintValue; + std::get<2>(values_) = _testEnumExtended2; + } + /** + * description: the name of the property + */ + inline const ::commonapi::tests::PredefinedTypeCollection::TestString &getTestString() const { return std::get<0>(values_); } + inline void setTestString(const ::commonapi::tests::PredefinedTypeCollection::TestString &_value) { std::get<0>(values_) = _value; } + /** + * description: the actual value + */ + inline const uint16_t &getUintValue() const { return std::get<1>(values_); } + inline void setUintValue(const uint16_t &_value) { std::get<1>(values_) = _value; } + inline const TestEnumExtended2 &getTestEnumExtended2() const { return std::get<2>(values_); } + inline void setTestEnumExtended2(const TestEnumExtended2 &_value) { std::get<2>(values_) = _value; } + bool operator==(const TestStructExtended &_other) const; + inline bool operator!=(const TestStructExtended &_other) const { + return !((*this) == _other); + } + + }; + typedef std::unordered_map> TestEnumMap; + + struct TestEnumMissingValue : CommonAPI::Enumeration { + enum Literal : int32_t { + E1 = 0, + E2 = 1, + E3 = 2 + }; + + TestEnumMissingValue() = default; + TestEnumMissingValue(const Literal &_value) + : CommonAPI::Enumeration(static_cast(_value)) {} + + inline bool operator==(const TestEnumMissingValue &_other) const { return (value_ == _other.value_); } + inline bool operator!=(const TestEnumMissingValue &_other) const { return (value_ != _other.value_); } + inline bool operator<=(const TestEnumMissingValue &_other) const { return (value_ <= _other.value_); } + inline bool operator>=(const TestEnumMissingValue &_other) const { return (value_ >= _other.value_); } + inline bool operator<(const TestEnumMissingValue &_other) const { return (value_ < _other.value_); } + inline bool operator>(const TestEnumMissingValue &_other) const { return (value_ > _other.value_); } + + inline bool operator==(const Literal &_value) const { return (value_ == static_cast(_value)); } + inline bool operator!=(const Literal &_value) const { return (value_ != static_cast(_value)); } + inline bool operator<=(const Literal &_value) const { return (value_ <= static_cast(_value)); } + inline bool operator>=(const Literal &_value) const { return (value_ >= static_cast(_value)); } + inline bool operator<(const Literal &_value) const { return (value_ < static_cast(_value)); } + inline bool operator>(const Literal &_value) const { return (value_ > static_cast(_value)); } + }; + typedef std::vector TestArrayUInt64; + static const CommonAPI::Serial TESTPOLYMORPHICSTRUCT_SERIAL = 0x8F51A326; + static const CommonAPI::Serial TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL = 0xA49310F2; + + struct TestPolymorphicStruct : CommonAPI::PolymorphicStruct { + static std::shared_ptr create(CommonAPI::Serial _serial); + const CommonAPI::Serial getSerial() const { return TESTPOLYMORPHICSTRUCT_SERIAL; } + + TestPolymorphicStruct() { + } + TestPolymorphicStruct(const ::commonapi::tests::PredefinedTypeCollection::TestString &_testString, const uint16_t &_uintValue) + { + std::get<0>(values_) = _testString; + std::get<1>(values_) = _uintValue; + } + template + void readValue(CommonAPI::InputStream<_Input> &_input, const CommonAPI::EmptyDeployment *_depl) { + _input.template readValue(std::get<0>(values_)); + _input.template readValue(std::get<1>(values_)); + switch (getSerial()) { + case TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL: + static_cast(this)->template readValue<_Input>(_input, _depl); + break; + default: + break; + } + } + + template + void readValue(CommonAPI::InputStream<_Input> &_input, const _Deployment *_depl) { + _input.template readValue<>(std::get<0>(values_), std::get<0>(_depl->values_)); + _input.template readValue<>(std::get<1>(values_), std::get<1>(_depl->values_)); + switch (getSerial()) { + case TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL: + static_cast(this)->template readValue<>(_input, _depl); + break; + default: + break; + } + } + + template + void writeType(CommonAPI::TypeOutputStream<_Output> &_output) { + _output.writeType(std::get<0>(values_)); + _output.writeType(std::get<1>(values_)); + switch (getSerial()) { + case TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL: + static_cast(this)->template writeType<_Output>(_output); + break; + default: + break; + } + } + + template + void writeValue(CommonAPI::OutputStream<_Output> &_output, const CommonAPI::EmptyDeployment *_depl) { + _output.template writeValue(std::get<0>(values_)); + _output.template writeValue(std::get<1>(values_)); + switch (getSerial()) { + case TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL: + static_cast(this)->template writeValue<_Output>(_output, _depl); + break; + default: + break; + } + } + + template + void writeValue(CommonAPI::OutputStream<_Output> &_output, const _Deployment *_depl) { + _output.template writeValue<>(std::get<0>(values_), _depl, std::get<0>(_depl->values_)); + _output.template writeValue<>(std::get<1>(values_), _depl, std::get<1>(_depl->values_)); + switch (getSerial()) { + case TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL: + static_cast(this)->template writeValue<>(_output, _depl); + break; + default: + break; + } + } + /** + * description: the name of the property + */ + inline const ::commonapi::tests::PredefinedTypeCollection::TestString &getTestString() const { return std::get<0>(values_); } + inline void setTestString(const ::commonapi::tests::PredefinedTypeCollection::TestString &_value) { std::get<0>(values_) = _value; } + /** + * description: the actual value + */ + inline const uint16_t &getUintValue() const { return std::get<1>(values_); } + inline void setUintValue(const uint16_t &_value) { std::get<1>(values_) = _value; } + + std::tuple<::commonapi::tests::PredefinedTypeCollection::TestString, uint16_t> values_; + bool operator==(const TestPolymorphicStruct &_other) const; + inline bool operator!=(const TestPolymorphicStruct &_other) const { + return !((*this) == _other); + } + + }; + struct TestExtendedPolymorphicStruct : TestPolymorphicStruct { + const CommonAPI::Serial getSerial() const { return TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL; } + + TestExtendedPolymorphicStruct() { + } + TestExtendedPolymorphicStruct(const ::commonapi::tests::PredefinedTypeCollection::TestString &_testString, const uint16_t &_uintValue, const uint32_t &_additionalValue) + : TestPolymorphicStruct(_testString, _uintValue) + { + std::get<0>(values_) = _additionalValue; + } + template + void readValue(CommonAPI::InputStream<_Input> &_input, const CommonAPI::EmptyDeployment *_depl) { + _input.template readValue(std::get<0>(values_)); + } + + template + void readValue(CommonAPI::InputStream<_Input> &_input, const _Deployment *_depl) { + _input.template readValue<>(std::get<0>(values_), std::get<2>(_depl->values_)); + } + + template + void writeType(CommonAPI::TypeOutputStream<_Output> &_output) { + _output.writeType(std::get<0>(values_)); + } + + template + void writeValue(CommonAPI::OutputStream<_Output> &_output, const CommonAPI::EmptyDeployment *_depl) { + _output.template writeValue(std::get<0>(values_)); + } + + template + void writeValue(CommonAPI::OutputStream<_Output> &_output, const _Deployment *_depl) { + _output.template writeValue<>(std::get<0>(values_), _depl, std::get<2>(_depl->values_)); + } + inline const uint32_t &getAdditionalValue() const { return std::get<0>(values_); } + inline void setAdditionalValue(const uint32_t &_value) { std::get<0>(values_) = _value; } + + std::tuple values_; + bool operator==(const TestExtendedPolymorphicStruct &_other) const; + inline bool operator!=(const TestExtendedPolymorphicStruct &_other) const { + return !((*this) == _other); + } + + }; + typedef std::unordered_map> MapIntToPolymorphic; + struct StructWithPolymorphicMember : CommonAPI::Struct> { + + StructWithPolymorphicMember() { + } + StructWithPolymorphicMember(const uint32_t &_numberValue, const std::shared_ptr &_polymorphicMember) + { + std::get<0>(values_) = _numberValue; + std::get<1>(values_) = _polymorphicMember; + } + inline const uint32_t &getNumberValue() const { return std::get<0>(values_); } + inline void setNumberValue(const uint32_t &_value) { std::get<0>(values_) = _value; } + inline const std::shared_ptr &getPolymorphicMember() const { return std::get<1>(values_); } + inline void setPolymorphicMember(const std::shared_ptr &_value) { std::get<1>(values_) = _value; } + bool operator==(const StructWithPolymorphicMember &_other) const; + inline bool operator!=(const StructWithPolymorphicMember &_other) const { + return !((*this) == _other); + } + + }; + struct StructWithEnumKeyMap : CommonAPI::Struct { + + StructWithEnumKeyMap() { + } + StructWithEnumKeyMap(const TestEnumMap &_testMap) + { + std::get<0>(values_) = _testMap; + } + inline const TestEnumMap &getTestMap() const { return std::get<0>(values_); } + inline void setTestMap(const TestEnumMap &_value) { std::get<0>(values_) = _value; } + bool operator==(const StructWithEnumKeyMap &_other) const; + inline bool operator!=(const StructWithEnumKeyMap &_other) const { + return !((*this) == _other); + } + + }; + + + +static inline const char* getTypeCollectionName() { + static const char* typeCollectionName = "commonapi.tests.DerivedTypeCollection"; + return typeCollectionName; +} + + +}; // struct DerivedTypeCollection + +} // namespace tests +} // namespace commonapi + +namespace CommonAPI { +} + + +namespace std { + //Hash for TestEnum + template<> + struct hash<::commonapi::tests::DerivedTypeCollection::TestEnum> { + inline size_t operator()(const ::commonapi::tests::DerivedTypeCollection::TestEnum& testEnum) const { + return static_cast(testEnum); + } + }; + //Hash for TestEnumExtended2 + template<> + struct hash<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2> { + inline size_t operator()(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2& testEnumExtended2) const { + return static_cast(testEnumExtended2); + } + }; + //Hash for TestEnumMissingValue + template<> + struct hash<::commonapi::tests::DerivedTypeCollection::TestEnumMissingValue> { + inline size_t operator()(const ::commonapi::tests::DerivedTypeCollection::TestEnumMissingValue& testEnumMissingValue) const { + return static_cast(testEnumMissingValue); + } + }; + //Hash for TestEnumExtended + template<> + struct hash<::commonapi::tests::DerivedTypeCollection::TestEnumExtended> { + inline size_t operator()(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended& testEnumExtended) const { + return static_cast(testEnumExtended); + } + }; +} + +#endif // COMMONAPI_TESTS_Derived_Type_Collection_HPP_ -- cgit v1.2.1