aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/utils
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-11-26 16:19:46 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-11-28 16:11:47 +0100
commit3fb5cd5d762006c3bc20ffc7acd86f8a74156f9b (patch)
treea32efe1dcd74b45a91f55cf9c3568998b58217b9 /low-can-binding/utils
parenta16b570f1e8607f1c984cef4c281df9d5b7b129e (diff)
Add some typedef to reduce the size of the lines
Bug-AGL : SPEC-2779 Bug-AGL: SPEC-2976 Change-Id: Iebcf7492133cd7789d301593ff999b24ae10a054 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/utils')
-rw-r--r--low-can-binding/utils/signals.cpp2
-rw-r--r--low-can-binding/utils/signals.hpp15
2 files changed, 10 insertions, 7 deletions
diff --git a/low-can-binding/utils/signals.cpp b/low-can-binding/utils/signals.cpp
index 4895395f..a26906e0 100644
--- a/low-can-binding/utils/signals.cpp
+++ b/low-can-binding/utils/signals.cpp
@@ -39,7 +39,7 @@ namespace utils
/// @brief return the subscribed_signals map.
///
/// @return Map of subscribed signals.
- std::map<int, std::shared_ptr<low_can_subscription_t> >& signals_manager_t::get_subscribed_signals()
+ map_subscription& signals_manager_t::get_subscribed_signals()
{
return subscribed_signals_;
}
diff --git a/low-can-binding/utils/signals.hpp b/low-can-binding/utils/signals.hpp
index b28942e7..b7b2ca03 100644
--- a/low-can-binding/utils/signals.hpp
+++ b/low-can-binding/utils/signals.hpp
@@ -29,12 +29,15 @@
#include "../binding/low-can-subscription.hpp"
+typedef std::list<std::shared_ptr<signal_t>> list_ptr_signal_t;
+typedef std::list<std::shared_ptr<diagnostic_message_t>> list_ptr_diag_msg_t;
+
namespace utils
{
struct signals_found
{
- std::list<std::shared_ptr<signal_t> > signals;
- std::list<std::shared_ptr<diagnostic_message_t> > diagnostic_messages;
+ list_ptr_signal_t signals;
+ list_ptr_diag_msg_t diagnostic_messages;
};
/// @brief Signal manager singleton hold subscription object with attached afb_event_t and its mutex
@@ -45,7 +48,7 @@ namespace utils
{
private:
std::mutex subscribed_signals_mutex_;
- std::map<int, std::shared_ptr<low_can_subscription_t> > subscribed_signals_; ///< Map containing all subscribed signals, key is the socket int value.
+ map_subscription subscribed_signals_; ///< Map containing all subscribed signals, key is the socket int value.
signals_manager_t(); ///< Private constructor to make singleton class.
@@ -53,11 +56,11 @@ namespace utils
static signals_manager_t& instance();
std::mutex& get_subscribed_signals_mutex();
- std::map<int, std::shared_ptr<low_can_subscription_t> >& get_subscribed_signals();
+ map_subscription& get_subscribed_signals();
struct signals_found find_signals(const openxc_DynamicField &key);
- void find_diagnostic_messages(const openxc_DynamicField &key, std::vector<std::shared_ptr<diagnostic_message_t> >& found_signals);
- void find_signals(const openxc_DynamicField &key, std::vector<std::shared_ptr<signal_t> >& found_signals);
+ void find_diagnostic_messages(const openxc_DynamicField &key, vect_ptr_diag_msg_t& found_signals);
+ void find_signals(const openxc_DynamicField &key, vect_ptr_signal_t& found_signals);
template <typename T>
void lookup_signals_by_name(const std::string& key, std::vector<std::shared_ptr<T> > signals, std::list<std::shared_ptr<T> >& found_signals)