From bb896e17508570752848e628e4487074fe3f9978 Mon Sep 17 00:00:00 2001 From: Lutz Bichler Date: Fri, 27 Feb 2015 09:37:43 +0100 Subject: Adaptations after completing the SOME/IP code generation (the first usage of the deployment infrastructure). --- include/CommonAPI/Deployment.hpp | 8 ++------ include/CommonAPI/Struct.hpp | 8 ++++---- include/CommonAPI/Variant.hpp | 4 ++-- src/CommonAPI/Deployment.cpp | 13 ------------- 4 files changed, 8 insertions(+), 25 deletions(-) delete mode 100644 src/CommonAPI/Deployment.cpp diff --git a/include/CommonAPI/Deployment.hpp b/include/CommonAPI/Deployment.hpp index df88250..c4f8550 100644 --- a/include/CommonAPI/Deployment.hpp +++ b/include/CommonAPI/Deployment.hpp @@ -46,9 +46,9 @@ namespace CommonAPI { // > itsDeployment( struct Deployment { - Deployment(_Types... _values) : values_(_values...) {} + Deployment(_Types*... _values) : values_(_values...) {} - std::tuple<_Types...> values_; + std::tuple<_Types*...> values_; }; template @@ -71,10 +71,6 @@ struct MapDeployment { // Convenience definition of an empty deployment. typedef Deployment<> EmptyDeployment; -// The general purpose empty deployment. Use this whenever -// you need to provide a reference to an empty deployment. -extern EmptyDeployment empty; - } // namespace CommonAPI #endif // COMMONAPI_DEPLOYABLE_HPP_ diff --git a/include/CommonAPI/Struct.hpp b/include/CommonAPI/Struct.hpp index 86f50af..a0bd42c 100644 --- a/include/CommonAPI/Struct.hpp +++ b/include/CommonAPI/Struct.hpp @@ -39,7 +39,7 @@ struct StructReader<_Index, _Input, _V<_Values...>, _D<_Depls...>> { _V<_Values...> &_values, const _D<_Depls...> *_depls) { StructReader<_Index-1, _Input, _V<_Values...>, _D<_Depls...>>{}(_input, _values, _depls); - _input.template readValue<>(std::get<_Index>(_values.values_), &std::get<_Index>(_depls->values_)); + _input.template readValue<>(std::get<_Index>(_values.values_), std::get<_Index>(_depls->values_)); } }; @@ -63,7 +63,7 @@ struct StructReader<0, _Input, _V<_Values...>, _D<_Depls...>> { void operator()(InputStream<_Input> &_input, _V<_Values...> &_values, const _D<_Depls...> *_depls) { - _input.template readValue<>(std::get<0>(_values.values_), &std::get<0>(_depls->values_)); + _input.template readValue<>(std::get<0>(_values.values_), std::get<0>(_depls->values_)); } }; @@ -91,7 +91,7 @@ struct StructWriter<_Index, _Output, _V<_Values...>, _D<_Depls...>> { const _V<_Values...> &_values, const _D<_Depls...> *_depls) { StructWriter<_Index-1, _Output, _V<_Values...>, _D<_Depls...>>{}(_output, _values, _depls); - _output.template writeValue<>(std::get<_Index>(_values.values_), &std::get<_Index>(_depls->values_)); + _output.template writeValue<>(std::get<_Index>(_values.values_), std::get<_Index>(_depls->values_)); } }; @@ -115,7 +115,7 @@ struct StructWriter<0, _Output, _V<_Values...>, _D<_Depls...>> { void operator()(OutputStream<_Output> &_output, const _V<_Values...> &_values, const _D<_Depls...> *_depls) { - _output.template writeValue<>(std::get<0>(_values.values_), &std::get<0>(_depls->values_)); + _output.template writeValue<>(std::get<0>(_values.values_), std::get<0>(_depls->values_)); } }; diff --git a/include/CommonAPI/Variant.hpp b/include/CommonAPI/Variant.hpp index 9f3d5ea..c04030b 100644 --- a/include/CommonAPI/Variant.hpp +++ b/include/CommonAPI/Variant.hpp @@ -358,7 +358,7 @@ struct ApplyStreamVisitor<_Visitor, _Variant, _Deployment, _Type, _Types...> { static void visit(_Visitor &_visitor, _Variant &_variant, const _Deployment *_depl) { if (_variant.getValueType() == index) { _visitor(_variant.template get<_Type>(), - &std::getvalues_)>::value-index>(_depl->values_)); + std::getvalues_)>::value-index>(_depl->values_)); } else { ApplyStreamVisitor< _Visitor, _Variant, _Deployment, _Types... @@ -369,7 +369,7 @@ struct ApplyStreamVisitor<_Visitor, _Variant, _Deployment, _Type, _Types...> { static void visit(_Visitor &_visitor, const _Variant &_variant, const _Deployment *_depl) { if (_variant.getValueType() == index) { _visitor(_variant.template get<_Type>(), - &std::getvalues_)>::value-index>(_depl->values_)); + std::getvalues_)>::value-index>(_depl->values_)); } else { ApplyStreamVisitor< _Visitor, _Variant, _Deployment, _Types... diff --git a/src/CommonAPI/Deployment.cpp b/src/CommonAPI/Deployment.cpp deleted file mode 100644 index 261cac8..0000000 --- a/src/CommonAPI/Deployment.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (C) 2015 BMW Group -// Author: Lutz Bichler (lutz.bichler@bmw.de) -// 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 - -namespace CommonAPI { - -EmptyDeployment empty; - -} // namespace CommonAPI -- cgit v1.2.1