aboutsummaryrefslogtreecommitdiffstats
path: root/src/can
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-10 16:08:06 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:10:41 +0100
commit065a5bdef8c37f8b0466f63e48443dab31e86431 (patch)
tree47b554a3fe13ed99fcd87f298e01b2607f0f6601 /src/can
parent093d7a35c23c65ffef888ded40aea9e77f0e4975 (diff)
We doesn't modify member once getted, we can use const return
and const method. Change-Id: I0f7465af74b1c9a546af45a0d1eea33c93537e0c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can')
-rw-r--r--src/can/can-signals.cpp9
-rw-r--r--src/can/can-signals.hpp5
2 files changed, 10 insertions, 4 deletions
diff --git a/src/can/can-signals.cpp b/src/can/can-signals.cpp
index 2d2e7eaf..00b6ee07 100644
--- a/src/can/can-signals.cpp
+++ b/src/can/can-signals.cpp
@@ -30,16 +30,21 @@ can_message_definition_t& can_signal_t::get_message()
return message_;
}
-std::string& can_signal_t::get_generic_name()
+const std::string& can_signal_t::get_generic_name() const
{
return generic_name_;
}
-std::string can_signal_t::get_name()
+const std::string can_signal_t::get_name() const
{
return prefix_ + "." + generic_name_;
}
+const std::string& can_signal_t::get_prefix() const
+{
+ return prefix_;
+}
+
uint8_t can_signal_t::get_bit_position() const
{
return bit_position_;
diff --git a/src/can/can-signals.hpp b/src/can/can-signals.hpp
index 10403da4..c1d07eee 100644
--- a/src/can/can-signals.hpp
+++ b/src/can/can-signals.hpp
@@ -110,8 +110,9 @@ private:
public:
can_message_definition_t& get_message();
- std::string& get_generic_name();
- std::string get_name();
+ const std::string& get_generic_name() const;
+ const std::string get_name() const;
+ const std::string& get_prefix() const;
uint8_t get_bit_position() const;
uint8_t get_bit_size() const;
float get_factor() const;