diff options
author | Jürgen Gehring <juergen.gehring@bmw.de> | 2015-06-17 05:12:07 -0700 |
---|---|---|
committer | Jürgen Gehring <juergen.gehring@bmw.de> | 2015-06-17 05:12:07 -0700 |
commit | 49d0b428ca19852d49965f35328a314f22d88807 (patch) | |
tree | 4b8d945f29cac4b4b599f79a872cc5029288f5c5 /src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp | |
parent | 54982071a99484488207ad3bd5e9391a15bffe02 (diff) | |
download | genivi-common-api-dbus-runtime-49d0b428ca19852d49965f35328a314f22d88807.tar.gz |
CommonAPI 3.1.23.1.2
Diffstat (limited to 'src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp')
-rw-r--r-- | src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp | 268 |
1 files changed, 268 insertions, 0 deletions
diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp new file mode 100644 index 0000000..e51777c --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp @@ -0,0 +1,268 @@ +/* +* 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/. +*/ +#include <v1_0/commonapi/tests/TestInterfaceStubDefault.hpp> +#include <assert.h> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +TestInterfaceStubDefault::TestInterfaceStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(TestInterface::getInterfaceVersion()) { +} + +const CommonAPI::Version& TestInterfaceStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client) { + return interfaceVersion_; +} + +TestInterfaceStubRemoteEvent* TestInterfaceStubDefault::initStubAdapter(const std::shared_ptr<TestInterfaceStubAdapter> &_adapter) { + CommonAPI::Stub<TestInterfaceStubAdapter, TestInterfaceStubRemoteEvent>::stubAdapter_ = _adapter; + return &remoteEventHandler_; +} + +const uint32_t& TestInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute() { + return testPredefinedTypeAttributeAttributeValue_; +} + +const uint32_t& TestInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestPredefinedTypeAttributeAttribute(); +} + +void TestInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(uint32_t _value) { + const bool valueChanged = trySetTestPredefinedTypeAttributeAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireTestPredefinedTypeAttributeAttributeChanged(testPredefinedTypeAttributeAttributeValue_); + } +} + +bool TestInterfaceStubDefault::trySetTestPredefinedTypeAttributeAttribute(uint32_t _value) { + if (!validateTestPredefinedTypeAttributeAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testPredefinedTypeAttributeAttributeValue_ != _value); + testPredefinedTypeAttributeAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestInterfaceStubDefault::validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t &_value) { + return true; +} + +void TestInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value) { + setTestPredefinedTypeAttributeAttribute(_value); +} + +void TestInterfaceStubDefault::onRemoteTestPredefinedTypeAttributeAttributeChanged() { + // No operation in default +} + +void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestPredefinedTypeAttributeAttributeChanged() { + assert(defaultStub_ !=NULL); + defaultStub_->onRemoteTestPredefinedTypeAttributeAttributeChanged(); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t _value) { + assert(defaultStub_ !=NULL); + return defaultStub_->trySetTestPredefinedTypeAttributeAttribute(std::move(_value)); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value) { + return onRemoteSetTestPredefinedTypeAttributeAttribute(_value); +} + +const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& TestInterfaceStubDefault::getTestDerivedStructAttributeAttribute() { + return testDerivedStructAttributeAttributeValue_; +} + +const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& TestInterfaceStubDefault::getTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestDerivedStructAttributeAttribute(); +} + +void TestInterfaceStubDefault::setTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + const bool valueChanged = trySetTestDerivedStructAttributeAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireTestDerivedStructAttributeAttributeChanged(testDerivedStructAttributeAttributeValue_); + } +} + +bool TestInterfaceStubDefault::trySetTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + if (!validateTestDerivedStructAttributeAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testDerivedStructAttributeAttributeValue_ != _value); + testDerivedStructAttributeAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestInterfaceStubDefault::validateTestDerivedStructAttributeAttributeRequestedValue(const ::commonapi::tests::DerivedTypeCollection::TestStructExtended &_value) { + return true; +} + +void TestInterfaceStubDefault::setTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + setTestDerivedStructAttributeAttribute(_value); +} + +void TestInterfaceStubDefault::onRemoteTestDerivedStructAttributeAttributeChanged() { + // No operation in default +} + +void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedStructAttributeAttributeChanged() { + assert(defaultStub_ !=NULL); + defaultStub_->onRemoteTestDerivedStructAttributeAttributeChanged(); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + assert(defaultStub_ !=NULL); + return defaultStub_->trySetTestDerivedStructAttributeAttribute(std::move(_value)); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + return onRemoteSetTestDerivedStructAttributeAttribute(_value); +} + +const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& TestInterfaceStubDefault::getTestDerivedArrayAttributeAttribute() { + return testDerivedArrayAttributeAttributeValue_; +} + +const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& TestInterfaceStubDefault::getTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestDerivedArrayAttributeAttribute(); +} + +void TestInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + const bool valueChanged = trySetTestDerivedArrayAttributeAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireTestDerivedArrayAttributeAttributeChanged(testDerivedArrayAttributeAttributeValue_); + } +} + +bool TestInterfaceStubDefault::trySetTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + if (!validateTestDerivedArrayAttributeAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testDerivedArrayAttributeAttributeValue_ != _value); + testDerivedArrayAttributeAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestInterfaceStubDefault::validateTestDerivedArrayAttributeAttributeRequestedValue(const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 &_value) { + return true; +} + +void TestInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + setTestDerivedArrayAttributeAttribute(_value); +} + +void TestInterfaceStubDefault::onRemoteTestDerivedArrayAttributeAttributeChanged() { + // No operation in default +} + +void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedArrayAttributeAttributeChanged() { + assert(defaultStub_ !=NULL); + defaultStub_->onRemoteTestDerivedArrayAttributeAttributeChanged(); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + assert(defaultStub_ !=NULL); + return defaultStub_->trySetTestDerivedArrayAttributeAttribute(std::move(_value)); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + return onRemoteSetTestDerivedArrayAttributeAttribute(_value); +} + + +void TestInterfaceStubDefault::testEmptyMethod(const std::shared_ptr<CommonAPI::ClientId> _client, testEmptyMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::testVoidPredefinedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _uint32Value, std::string _stringValue, testVoidPredefinedTypeMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::testPredefinedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _uint32InValue, std::string _stringInValue, testPredefinedTypeMethodReply_t _reply) { + uint32_t uint32OutValue = 0; + std::string stringOutValue = ""; + _reply(uint32OutValue, stringOutValue); +} + +void TestInterfaceStubDefault::testVoidDerivedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 _testEnumExtended2Value, ::commonapi::tests::DerivedTypeCollection::TestMap _testMapValue, testVoidDerivedTypeMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::testDerivedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 _testEnumExtended2InValue, ::commonapi::tests::DerivedTypeCollection::TestMap _testMapInValue, testDerivedTypeMethodReply_t _reply) { + ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 testEnumExtended2OutValue; + ::commonapi::tests::DerivedTypeCollection::TestMap testMapOutValue; + _reply(testEnumExtended2OutValue, testMapOutValue); +} + +void TestInterfaceStubDefault::TestArrayOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> _client, std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> _inArray, TestArrayOfPolymorphicStructMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::TestMapOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic _inMap, TestMapOfPolymorphicStructMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::TestStructWithPolymorphicMemberMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember _inStruct, TestStructWithPolymorphicMemberMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::TestStructWithEnumKeyMapMember(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap _inStruct, TestStructWithEnumKeyMapMemberReply_t _reply) { + _reply(); +} + + +void TestInterfaceStubDefault::fireTestPredefinedTypeBroadcastEvent(const uint32_t &_uint32Value, const std::string &_stringValue) { + assert(stubAdapter_ !=NULL); + stubAdapter_->fireTestPredefinedTypeBroadcastEvent(_uint32Value, _stringValue); +} +void TestInterfaceStubDefault::fireTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientIdList> _receivers) { + assert(stubAdapter_ !=NULL); + stubAdapter_->sendTestSelectiveBroadcastSelective(_receivers); +} +void TestInterfaceStubDefault::onTestSelectiveBroadcastSelectiveSubscriptionChanged(const std::shared_ptr<CommonAPI::ClientId> _client, const CommonAPI::SelectiveBroadcastSubscriptionEvent _event) { + // No operation in default +} +bool TestInterfaceStubDefault::onTestSelectiveBroadcastSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> _client) { + // Accept in default + return true; +} +std::shared_ptr<CommonAPI::ClientIdList> const TestInterfaceStubDefault::getSubscribersForTestSelectiveBroadcastSelective() { + assert(stubAdapter_ !=NULL); + return(stubAdapter_->getSubscribersForTestSelectiveBroadcastSelective()); +} + +void TestInterfaceStubDefault::fireTestBroadcastWithOutArgsSelective(const uint32_t &_uint32Value, const std::string &_stringValue, const std::shared_ptr<CommonAPI::ClientIdList> _receivers) { + assert(stubAdapter_ !=NULL); + stubAdapter_->sendTestBroadcastWithOutArgsSelective(_uint32Value, _stringValue, _receivers); +} +void TestInterfaceStubDefault::onTestBroadcastWithOutArgsSelectiveSubscriptionChanged(const std::shared_ptr<CommonAPI::ClientId> _client, const CommonAPI::SelectiveBroadcastSubscriptionEvent _event) { + // No operation in default +} +bool TestInterfaceStubDefault::onTestBroadcastWithOutArgsSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> _client) { + // Accept in default + return true; +} +std::shared_ptr<CommonAPI::ClientIdList> const TestInterfaceStubDefault::getSubscribersForTestBroadcastWithOutArgsSelective() { + assert(stubAdapter_ !=NULL); + return(stubAdapter_->getSubscribersForTestBroadcastWithOutArgsSelective()); +} + + + +TestInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(TestInterfaceStubDefault *_defaultStub) + : + defaultStub_(_defaultStub) { +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 |