aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-18 19:50:02 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-19 14:48:23 +0200
commit3bc17dd60bfd97e36b12849d4d3a5dd3d093a426 (patch)
tree8d0dd786c859551d965b1fa3497f15ae25e3551c /CAN-binder/low-can-binding
parent465001c7ef7479e7cfb7af7af180ed6419a5ab49 (diff)
Use shared_ptr for can_message_set too.
Change-Id: I3ba4881d5fc01a69d55e101b9a07c2019dda1d4b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding')
-rw-r--r--CAN-binder/low-can-binding/binding/configuration-generated.cpp5
-rw-r--r--CAN-binder/low-can-binding/binding/configuration.cpp8
-rw-r--r--CAN-binder/low-can-binding/binding/configuration.hpp4
3 files changed, 8 insertions, 9 deletions
diff --git a/CAN-binder/low-can-binding/binding/configuration-generated.cpp b/CAN-binder/low-can-binding/binding/configuration-generated.cpp
index 24f89ecb..ad31c455 100644
--- a/CAN-binder/low-can-binding/binding/configuration-generated.cpp
+++ b/CAN-binder/low-can-binding/binding/configuration-generated.cpp
@@ -4,7 +4,7 @@
configuration_t::configuration_t()
: can_bus_manager_{utils::config_parser_t{"/etc/dev-mapping.conf"}}
, can_message_set_{
- can_message_set_t{0,"example",
+ {std::make_shared<can_message_set_t>(can_message_set_t{0,"example",
{ // beginning can_message_definition_ vector
{std::make_shared<can_message_definition_t>(can_message_definition_t{"can0",0x3D9,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
{ // beginning can_signals vector
@@ -220,7 +220,6 @@ configuration_t::configuration_t()
})}
} // end can_signals vector
})} // end can_message_definition entry
-
}, // end can_message_definition vector
{ // beginning diagnostic_messages_ vector
{std::make_shared<diagnostic_message_t>(diagnostic_message_t{
@@ -455,7 +454,7 @@ configuration_t::configuration_t()
true
})}
} // end diagnostic_messages_ vector
- } // end can_message_set entry
+ })} // end can_message_set entry
} // end can_message_set vector
{}
diff --git a/CAN-binder/low-can-binding/binding/configuration.cpp b/CAN-binder/low-can-binding/binding/configuration.cpp
index 7f53c620..cc2b8f23 100644
--- a/CAN-binder/low-can-binding/binding/configuration.cpp
+++ b/CAN-binder/low-can-binding/binding/configuration.cpp
@@ -42,24 +42,24 @@ uint8_t configuration_t::get_active_message_set() const
return active_message_set_;
}
-const std::vector<can_message_set_t>& configuration_t::get_can_message_set()
+const std::vector<std::shared_ptr<can_message_set_t> >& configuration_t::get_can_message_set()
{
return can_message_set_;
}
std::vector<std::shared_ptr<can_signal_t> > configuration_t::get_can_signals()
{
- return can_message_set_[active_message_set_].get_can_signals();
+ return can_message_set_[active_message_set_]->get_can_signals();
}
std::vector<std::shared_ptr<diagnostic_message_t> > configuration_t::get_diagnostic_messages()
{
- return can_message_set_[active_message_set_].get_diagnostic_messages();
+ return can_message_set_[active_message_set_]->get_diagnostic_messages();
}
std::vector<std::shared_ptr<can_message_definition_t> > configuration_t::get_can_message_definition()
{
- return can_message_set_[active_message_set_].get_can_message_definition();
+ return can_message_set_[active_message_set_]->get_can_message_definition();
}
uint32_t configuration_t::get_signal_id(diagnostic_message_t& sig) const
diff --git a/CAN-binder/low-can-binding/binding/configuration.hpp b/CAN-binder/low-can-binding/binding/configuration.hpp
index 409c4cda..a3bb1894 100644
--- a/CAN-binder/low-can-binding/binding/configuration.hpp
+++ b/CAN-binder/low-can-binding/binding/configuration.hpp
@@ -47,7 +47,7 @@ class configuration_t
diagnostic_manager_t diagnostic_manager_; ///< Diagnostic manager use to manage diagnostic message communication.
uint8_t active_message_set_ = 0; ///< Which is the active message set ? Default to 0.
- std::vector<can_message_set_t> can_message_set_; ///< Vector holding all message set from JSON signals description file
+ std::vector<std::shared_ptr<can_message_set_t> > can_message_set_; ///< Vector holding all message set from JSON signals description file
//std::vector<std::vector<can_message_definition_t>> can_message_definition_; ///< Vector of vector holding all can message definition from JSON signals description file. This describe a CAN message. First vector map to message set
//std::vector<std::vector<can_signal_t>> can_signals_; ///< Vector of vector holding all can signasl from JSON signals description file. A CAN signal is a part of a CAN message. First vector map to message set
//std::vector<std::vector<std::shared_ptr<diagnostic_message_t> > > diagnostic_messages_; ///< Vector of vector holding all diagnostics messages from JSON signals description file. First vector map to message set
@@ -65,7 +65,7 @@ class configuration_t
uint8_t get_active_message_set() const;
- const std::vector<can_message_set_t>& get_can_message_set();
+ const std::vector<std::shared_ptr<can_message_set_t> >& get_can_message_set();
std::vector<std::shared_ptr<can_signal_t> > get_can_signals();