diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-14 18:49:04 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-14 18:49:04 +0100 |
commit | c1da0ac7cca49e0b96dbb359ee48000cb04df15b (patch) | |
tree | c6041007cfa28ea80e5dc5df2f1944faf714ab32 /src/RemoteControl.h | |
parent | d6d8d67b1c921d8fca7257291c15c07bdea8d14a (diff) | |
download | dabmux-c1da0ac7cca49e0b96dbb359ee48000cb04df15b.tar.gz dabmux-c1da0ac7cca49e0b96dbb359ee48000cb04df15b.tar.bz2 dabmux-c1da0ac7cca49e0b96dbb359ee48000cb04df15b.zip |
improve RC constness
Diffstat (limited to 'src/RemoteControl.h')
-rw-r--r-- | src/RemoteControl.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/RemoteControl.h b/src/RemoteControl.h index a39af09..e76ba68 100644 --- a/src/RemoteControl.h +++ b/src/RemoteControl.h @@ -84,7 +84,7 @@ class RemoteControllable { * It might be used in the commands the user has to type, so keep * it short */ - virtual std::string get_rc_name() { return m_name; } + virtual std::string get_rc_name() const { return m_name; } /* Tell the controllable to enrol at the given controller */ virtual void enrol_at(BaseRemoteController& controller) { @@ -92,9 +92,9 @@ class RemoteControllable { } /* Return a list of possible parameters that can be set */ - virtual list<string> get_supported_parameters() { + virtual list<string> get_supported_parameters() const { list<string> parameterlist; - for (list< vector<string> >::iterator it = m_parameters.begin(); + for (list< vector<string> >::const_iterator it = m_parameters.begin(); it != m_parameters.end(); ++it) { parameterlist.push_back((*it)[0]); } @@ -102,15 +102,17 @@ class RemoteControllable { } /* Return a mapping of the descriptions of all parameters */ - virtual std::list< std::vector<std::string> > get_parameter_descriptions() { + virtual std::list< std::vector<std::string> > + get_parameter_descriptions() const { return m_parameters; } /* Base function to set parameters. */ - virtual void set_parameter(string parameter, string value) = 0; + virtual void set_parameter(const string& parameter, + const string& value) = 0; /* Getting a parameter always returns a string. */ - virtual string get_parameter(string parameter) = 0; + virtual const string get_parameter(const string& parameter) const = 0; protected: std::string m_name; |