aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/utils
diff options
context:
space:
mode:
authorArthur Guyader <arthur.guyader@iot.bzh>2019-08-27 14:48:29 +0200
committerArthur Guyader <arthur.guyader@iot.bzh>2019-08-30 15:11:52 +0200
commit6d6b880b2769add860cb0f135e0f784f8aaf5e00 (patch)
tree52c4cd0559dbc6504a5ced77d732bd712efeadb1 /low-can-binding/utils
parentd4899192ccda96a8ee328bad3e16efdc98c2a856 (diff)
Add some typedef to reduce the size of the lines
Bug-AGL : SPEC-2779 Change-Id: Iebcf7492133cd7789d301593ff999b24ae10a054 Signed-off-by: Arthur Guyader <arthur.guyader@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)