summaryrefslogtreecommitdiff
path: root/src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp')
-rw-r--r--src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp122
1 files changed, 98 insertions, 24 deletions
diff --git a/src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp b/src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp
index 90589dc..201d486 100644
--- a/src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp
+++ b/src/test/src-gen/core/commonapi/tests/DerivedTypeCollection.hpp
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 3.1.2.v201507021046.
+* Used org.genivi.commonapi.core 3.1.4.v201511201311.
* 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.
@@ -58,11 +58,8 @@ struct DerivedTypeCollection {
}
};
- typedef std::vector<TestStruct> TestArrayTestStruct;
+ typedef std::vector<DerivedTypeCollection::TestStruct> TestArrayTestStruct;
typedef std::unordered_map<uint32_t, ::commonapi::tests::DerivedTypeCollection::TestArrayTestStruct> TestMap;
- /**
- * description: Common errors.
- */
struct TestEnum : CommonAPI::Enumeration<int32_t> {
enum Literal : int32_t {
@@ -72,9 +69,24 @@ struct DerivedTypeCollection {
E_NOT_USED = 3
};
- TestEnum() = default;
+ TestEnum()
+ : CommonAPI::Enumeration<int32_t>(static_cast<int32_t>(Literal::E_UNKNOWN)) {}
TestEnum(const Literal &_value)
: CommonAPI::Enumeration<int32_t>(static_cast<int32_t>(_value)) {}
+ TestEnum(const int32_t &_value)
+ : CommonAPI::Enumeration<int32_t>(_value) {}
+
+ inline bool validate() const {
+ switch (value_) {
+ case static_cast<int32_t>(Literal::E_UNKNOWN):
+ case static_cast<int32_t>(Literal::E_OK):
+ case static_cast<int32_t>(Literal::E_OUT_OF_RANGE):
+ case static_cast<int32_t>(Literal::E_NOT_USED):
+ return true;
+ default:
+ return false;
+ }
+ }
inline bool operator==(const TestEnum &_other) const { return (value_ == _other.value_); }
inline bool operator!=(const TestEnum &_other) const { return (value_ != _other.value_); }
@@ -96,14 +108,28 @@ struct DerivedTypeCollection {
E_NEW = 4
};
- TestEnumExtended() = default;
+ TestEnumExtended()
+ : TestEnum(static_cast<TestEnum::Literal>(Literal::E_NEW)) {}
TestEnumExtended(const Literal &_value)
- : TestEnum(static_cast<TestEnum::Literal>(_value)) {}
+ : TestEnum(static_cast<int32_t>(_value)) {}
+ TestEnumExtended(const int32_t &_value)
+ : TestEnum(_value) {}
+ TestEnumExtended(const TestEnum::Literal &_value)
+ : TestEnum(_value) {}
TestEnumExtended &operator=(const TestEnum::Literal &_value) {
value_ = static_cast<int32_t>(_value);
return (*this);
}
+ inline bool validate() const {
+ switch (value_) {
+ case static_cast<int32_t>(Literal::E_NEW):
+ return true;
+ default:
+ return TestEnum::validate();
+ }
+ }
+
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_); }
@@ -124,9 +150,16 @@ struct DerivedTypeCollection {
E_NEW2 = 5
};
- TestEnumExtended2() = default;
+ TestEnumExtended2()
+ : TestEnumExtended(static_cast<TestEnumExtended::Literal>(Literal::E_NEW2)) {}
TestEnumExtended2(const Literal &_value)
- : TestEnumExtended(static_cast<TestEnumExtended::Literal>(_value)) {}
+ : TestEnumExtended(static_cast<int32_t>(_value)) {}
+ TestEnumExtended2(const int32_t &_value)
+ : TestEnumExtended(_value) {}
+ TestEnumExtended2(const TestEnum::Literal &_value)
+ : TestEnumExtended(_value) {}
+ TestEnumExtended2(const TestEnumExtended::Literal &_value)
+ : TestEnumExtended(_value) {}
TestEnumExtended2 &operator=(const TestEnumExtended::Literal &_value) {
value_ = static_cast<int32_t>(_value);
return (*this);
@@ -136,6 +169,15 @@ struct DerivedTypeCollection {
return (*this);
}
+ inline bool validate() const {
+ switch (value_) {
+ case static_cast<int32_t>(Literal::E_NEW2):
+ return true;
+ default:
+ return TestEnumExtended::validate();
+ }
+ }
+
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_); }
@@ -187,9 +229,23 @@ struct DerivedTypeCollection {
E3 = 2
};
- TestEnumMissingValue() = default;
+ TestEnumMissingValue()
+ : CommonAPI::Enumeration<int32_t>(static_cast<int32_t>(Literal::E1)) {}
TestEnumMissingValue(const Literal &_value)
: CommonAPI::Enumeration<int32_t>(static_cast<int32_t>(_value)) {}
+ TestEnumMissingValue(const int32_t &_value)
+ : CommonAPI::Enumeration<int32_t>(_value) {}
+
+ inline bool validate() const {
+ switch (value_) {
+ case static_cast<int32_t>(Literal::E1):
+ case static_cast<int32_t>(Literal::E2):
+ case static_cast<int32_t>(Literal::E3):
+ return true;
+ default:
+ return false;
+ }
+ }
inline bool operator==(const TestEnumMissingValue &_other) const { return (value_ == _other.value_); }
inline bool operator!=(const TestEnumMissingValue &_other) const { return (value_ != _other.value_); }
@@ -211,7 +267,7 @@ struct DerivedTypeCollection {
struct TestPolymorphicStruct : CommonAPI::PolymorphicStruct {
static std::shared_ptr<TestPolymorphicStruct> create(CommonAPI::Serial _serial);
- const CommonAPI::Serial getSerial() const { return TESTPOLYMORPHICSTRUCT_SERIAL; }
+ CommonAPI::Serial getSerial() const { return TESTPOLYMORPHICSTRUCT_SERIAL; }
TestPolymorphicStruct() {
}
@@ -245,14 +301,25 @@ struct DerivedTypeCollection {
break;
}
}
-
template<class _Output>
- void writeType(CommonAPI::TypeOutputStream<_Output> &_output) {
- _output.writeType(std::get<0>(values_));
- _output.writeType(std::get<1>(values_));
+ void writeType(CommonAPI::TypeOutputStream<_Output> &_output, const CommonAPI::EmptyDeployment *_depl) {
+ _output.writeType(std::get<0>(values_), _depl);
+ _output.writeType(std::get<1>(values_), _depl);
+ switch (getSerial()) {
+ case TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL:
+ static_cast<TestExtendedPolymorphicStruct *>(this)->template writeType<_Output>(_output, _depl);
+ break;
+ default:
+ break;
+ }
+ }
+ template<class _Output, class _Deployment>
+ void writeType(CommonAPI::TypeOutputStream<_Output> &_output, const _Deployment *_depl) {
+ _output.writeType(std::get<0>(values_), std::get<0>(_depl->values_));
+ _output.writeType(std::get<1>(values_), std::get<1>(_depl->values_));
switch (getSerial()) {
case TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL:
- static_cast<TestExtendedPolymorphicStruct *>(this)->template writeType<_Output>(_output);
+ static_cast<TestExtendedPolymorphicStruct *>(this)->template writeType<_Output, _Deployment>(_output, _depl);
break;
default:
break;
@@ -274,8 +341,8 @@ struct DerivedTypeCollection {
template<class _Output, class _Deployment>
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_));
+ _output.template writeValue<>(std::get<0>(values_), std::get<0>(_depl->values_));
+ _output.template writeValue<>(std::get<1>(values_), std::get<1>(_depl->values_));
switch (getSerial()) {
case TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL:
static_cast<TestExtendedPolymorphicStruct *>(this)->template writeValue<>(_output, _depl);
@@ -303,7 +370,7 @@ struct DerivedTypeCollection {
};
struct TestExtendedPolymorphicStruct : TestPolymorphicStruct {
- const CommonAPI::Serial getSerial() const { return TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL; }
+ CommonAPI::Serial getSerial() const { return TESTEXTENDEDPOLYMORPHICSTRUCT_SERIAL; }
TestExtendedPolymorphicStruct() {
}
@@ -314,6 +381,7 @@ struct DerivedTypeCollection {
}
template<class _Input>
void readValue(CommonAPI::InputStream<_Input> &_input, const CommonAPI::EmptyDeployment *_depl) {
+ (void) _depl;
_input.template readValue<CommonAPI::EmptyDeployment>(std::get<0>(values_));
}
@@ -321,20 +389,24 @@ struct DerivedTypeCollection {
void readValue(CommonAPI::InputStream<_Input> &_input, const _Deployment *_depl) {
_input.template readValue<>(std::get<0>(values_), std::get<2>(_depl->values_));
}
-
template<class _Output>
- void writeType(CommonAPI::TypeOutputStream<_Output> &_output) {
- _output.writeType(std::get<0>(values_));
+ void writeType(CommonAPI::TypeOutputStream<_Output> &_output, const CommonAPI::EmptyDeployment *_depl) {
+ _output.writeType(std::get<0>(values_), _depl);
+ }
+ template<class _Output, class _Deployment>
+ void writeType(CommonAPI::TypeOutputStream<_Output> &_output, const _Deployment *_depl) {
+ _output.writeType(std::get<0>(values_), std::get<2>(_depl->values_));
}
template<class _Output>
void writeValue(CommonAPI::OutputStream<_Output> &_output, const CommonAPI::EmptyDeployment *_depl) {
+ (void) _depl;
_output.template writeValue<CommonAPI::EmptyDeployment>(std::get<0>(values_));
}
template<class _Output, class _Deployment>
void writeValue(CommonAPI::OutputStream<_Output> &_output, const _Deployment *_depl) {
- _output.template writeValue<>(std::get<0>(values_), _depl, std::get<2>(_depl->values_));
+ _output.template writeValue<>(std::get<0>(values_), 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; }
@@ -431,4 +503,6 @@ namespace std {
};
}
+
+
#endif // COMMONAPI_TESTS_Derived_Type_Collection_HPP_