diff options
author | Asen Kirov <akirov@luxoft.com> | 2016-01-08 17:28:24 +0200 |
---|---|---|
committer | Asen Kirov <akirov@luxoft.com> | 2016-01-08 17:28:24 +0200 |
commit | eb6f505884f9f94b552929635b86a6a22d322163 (patch) | |
tree | 32c9a84303d34ede069692a9e7488d16bf57ac02 /src/components/rpc_base | |
parent | e012d256997425786230741a60c66001b4a4ed6e (diff) | |
download | sdl_core-eb6f505884f9f94b552929635b86a6a22d322163.tar.gz |
Fix endpoints data copying during Policy Table Update
Up to now, when performing Policy Table Update, the module_config part
of the policy table was not copied. The change adds copying of this
part. The code is taken from CustomSDL/sdl_panasonic/develop (dd8ade70),
with just a small fix about copying exchange_after_x_ignition_cycles.
Fixes: APPLINK-20261
Diffstat (limited to 'src/components/rpc_base')
-rw-r--r-- | src/components/rpc_base/include/rpc_base/rpc_base.h | 2 | ||||
-rw-r--r-- | src/components/rpc_base/include/rpc_base/rpc_base_inl.h | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base.h b/src/components/rpc_base/include/rpc_base/rpc_base.h index 1792262a0f..019f7edc0e 100644 --- a/src/components/rpc_base/include/rpc_base/rpc_base.h +++ b/src/components/rpc_base/include/rpc_base/rpc_base.h @@ -393,6 +393,8 @@ class Optional { const T& operator*() const; T* operator->(); const T* operator->() const; + + void assign_if_valid(const Optional<T>& value); // For pointer-like 'if (optional_value)' tests // Better than operator bool because bool can be implicitly // casted to integral types diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h index 9a59e169c2..2241a4707b 100644 --- a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h +++ b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h @@ -604,6 +604,13 @@ const T* Optional<T>::operator->() const { } template<typename T> +void Optional<T>::assign_if_valid(const Optional<T>& value) { + if (value.is_initialized()) { + value_ = value.value_; + } +} + +template<typename T> Optional<T>::operator const void*() const { return is_initialized() ? &value_ : NULL; } |