aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/binding/configuration.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-11 01:12:11 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-11 01:12:11 +0200
commit6222973c39ee02ad52a5d0b4b400024157ff2eeb (patch)
tree08fff1571d6089dd7674166aac6e424a9826b4b3 /CAN-binder/low-can-binding/binding/configuration.cpp
parentd253ada94487232ccd33b68a69fd44ff7840fab7 (diff)
Massive use of shared_ptr about signal and diag message. WIP
Vector of shared_ptr is made to shared ownership about object around project. This is the default returned value by getter methods when lookup and manipulating them. Change-Id: Id37947bb5994b629f4bf3faecc5ffac81c55e1e6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/binding/configuration.cpp')
-rw-r--r--CAN-binder/low-can-binding/binding/configuration.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/CAN-binder/low-can-binding/binding/configuration.cpp b/CAN-binder/low-can-binding/binding/configuration.cpp
index da9d16b2..005e6629 100644
--- a/CAN-binder/low-can-binding/binding/configuration.cpp
+++ b/CAN-binder/low-can-binding/binding/configuration.cpp
@@ -57,7 +57,7 @@ std::vector<std::shared_ptr<can_signal_t> > configuration_t::get_can_signals()
return can_message_set_[active_message_set_].get_can_signals();
}
-std::vector<diagnostic_message_t>& configuration_t::get_diagnostic_messages()
+std::vector<std::shared_ptr<diagnostic_message_t> > configuration_t::get_diagnostic_messages()
{
return diagnostic_messages_[active_message_set_];
}
@@ -83,7 +83,7 @@ void configuration_t::set_active_message_set(uint8_t id)
}
-diagnostic_message_t* configuration_t::get_diagnostic_message(std::string message_name) const
+std::shared_ptr<diagnostic_message_t> configuration_t::get_diagnostic_message(std::string message_name) const
{
struct utils::signals_found found;
found = utils::signals_manager_t::instance().find_signals(build_DynamicField(message_name));
@@ -94,7 +94,7 @@ diagnostic_message_t* configuration_t::get_diagnostic_message(std::string messag
DiagnosticRequest* configuration_t::get_request_from_diagnostic_message(std::string message_name) const
{
- diagnostic_message_t* diag_msg = get_diagnostic_message(message_name);
+ std::shared_ptr<diagnostic_message_t> diag_msg = get_diagnostic_message(message_name);
if( diag_msg != nullptr && diag_msg->get_supported())
return new DiagnosticRequest(diag_msg->build_diagnostic_request());
return nullptr;