Commit f321b65a authored by Tristan Matthews's avatar Tristan Matthews

* #6132: add constness, remove redundant "inline" keywords

parent c163a9f0
......@@ -44,7 +44,7 @@ class Codec : public virtual MimeParameters
{
public:
Codec() {};
virtual inline ~Codec() {}
virtual ~Codec() {}
/**
* @return The bitrate for which this codec is configured // TODO deal with VBR case.
......
......@@ -37,7 +37,7 @@
private: \
uint8 payload; \
public: \
inline virtual ~MimeParameters##subtype() {}; \
virtual ~MimeParameters##subtype() {}; \
std::string getMimeType() const { \
return std::string( mime ); \
} \
......
......@@ -163,7 +163,7 @@ class AlsaLayer : public AudioLayer
* Get the noise suppressor state
* @return true if noise suppressor activated
*/
virtual bool getNoiseSuppressState (void) {
virtual bool getNoiseSuppressState (void) const {
return AudioLayer::_noisesuppressstate;
}
......
......@@ -167,7 +167,7 @@ class AudioLayer
* Read accessor to the error state
* @return int The error code
*/
int getErrorMessage() {
int getErrorMessage() const {
return _errorMessage;
}
......@@ -176,7 +176,7 @@ class AudioLayer
* @return int The index of the card used for capture
* 0 for the first available card on the system, 1 ...
*/
int getIndexIn() {
int getIndexIn() const {
return _indexIn;
}
......@@ -185,7 +185,7 @@ class AudioLayer
* @return int The index of the card used for playback
* 0 for the first available card on the system, 1 ...
*/
int getIndexOut() {
int getIndexOut() const {
return _indexOut;
}
......@@ -194,7 +194,7 @@ class AudioLayer
* @return int The index of the card used for ringtone
* 0 for the first available card on the system, 1 ...
*/
int getIndexRing() {
int getIndexRing() const {
return _indexRing;
}
......@@ -203,7 +203,7 @@ class AudioLayer
* @return unsigned int The sample rate
* default: 44100 HZ
*/
unsigned int getSampleRate() {
unsigned int getSampleRate() const {
return _audioSampleRate;
}
......@@ -212,7 +212,7 @@ class AudioLayer
* @return unsigned int The frame size
* default: 20 ms
*/
unsigned int getFrameSize() {
unsigned int getFrameSize() const {
return _frameSize;
}
......@@ -221,7 +221,7 @@ class AudioLayer
* @return unsigned int The layer type
*
*/
int getLayerType (void) {
int getLayerType (void) const {
return _layerType;
}
......@@ -233,7 +233,7 @@ class AudioLayer
*
* @return MainBuffer* a pointer to the MainBuffer instance
*/
MainBuffer* getMainBuffer (void) {
MainBuffer* getMainBuffer (void) const {
return _mainBuffer;
}
......@@ -253,7 +253,7 @@ class AudioLayer
/**
* Set the audio recorder
*/
inline void setRecorderInstance (Recordable* rec) {
void setRecorderInstance (Recordable* rec) {
_recorder = NULL;
_recorder = rec;
}
......@@ -261,7 +261,7 @@ class AudioLayer
/**
* Get the audio recorder
*/
inline Recordable* getRecorderInstance (void) {
Recordable* getRecorderInstance (void) const {
return _recorder;
}
......@@ -269,7 +269,7 @@ class AudioLayer
* Get the noise suppressor state
* @return true if noise suppressor activated
*/
virtual bool getNoiseSuppressState (void) = 0;
virtual bool getNoiseSuppressState (void) const = 0;
/**
* Set the noise suppressor state
......@@ -280,7 +280,7 @@ class AudioLayer
/**
* Get the mutex lock for the entire audio layer
*/
inline ost::Mutex* getMutexLock (void) {
ost::Mutex* getMutexLock (void) {
return &_mutex;
}
......
......@@ -129,7 +129,7 @@ class AudioRtpFactory
* @return The internal audio rtp thread of the type specified in the configuration
* file. initAudioRtpSession must have been called prior to that.
*/
inline void * getAudioRtpSession (void) {
void * getAudioRtpSession (void) const {
return _rtpSession;
}
......@@ -142,14 +142,14 @@ class AudioRtpFactory
* Zrtp = 1
* Sdes = 2
*/
inline RtpMethod getAudioRtpType (void) {
RtpMethod getAudioRtpType (void) const {
return _rtpSessionType;
}
/**
* @param Set internal audio rtp session type (Symmetric, Zrtp, Sdes)
*/
inline void setAudioRtpType (RtpMethod type) {
void setAudioRtpType (RtpMethod type) {
_rtpSessionType = type;
}
......
......@@ -141,23 +141,23 @@ class AudioRtpRecordHandler
void updateRtpMedia (AudioCodec *audioCodec);
AudioCodec *getAudioCodec (void) {
AudioCodec *getAudioCodec (void) const {
return _audioRtpRecord._audioCodec;
}
int getCodecPayloadType (void) {
int getCodecPayloadType (void) const {
return _audioRtpRecord._codecPayloadType;
}
int getCodecSampleRate (void) {
int getCodecSampleRate (void) const {
return _audioRtpRecord._codecSampleRate;
}
int getCodecFrameSize (void) {
int getCodecFrameSize (void) const {
return _audioRtpRecord._codecFrameSize;
}
int getHasDynamicPayload (void) {
int getHasDynamicPayload (void) const {
return _audioRtpRecord._hasDynamicPayloadType;
}
......@@ -165,7 +165,7 @@ class AudioRtpRecordHandler
return &_audioRtpRecord._eventQueue;
}
int getEventQueueSize (void) {
int getEventQueueSize (void) const {
return _audioRtpRecord._eventQueue.size();
}
......@@ -173,19 +173,19 @@ class AudioRtpRecordHandler
return _audioRtpRecord._micData;
}
SFLDataFormat *getMicDataConverted (void) {
SFLDataFormat *getMicDataConverted (void) const {
return _audioRtpRecord._micDataConverted;
}
unsigned char *getMicDataEncoded (void) {
unsigned char *getMicDataEncoded (void) const {
return _audioRtpRecord._micDataEncoded;
}
inline float computeCodecFrameSize (int codecSamplePerFrame, int codecClockRate) {
float computeCodecFrameSize (int codecSamplePerFrame, int codecClockRate) const {
return ( (float) codecSamplePerFrame * 1000.0) / (float) codecClockRate;
}
int computeNbByteAudioLayer (int mainBufferSamplingRate, float codecFrameSize) {
int computeNbByteAudioLayer (int mainBufferSamplingRate, float codecFrameSize) const {
return (int) ( ( (float) mainBufferSamplingRate * codecFrameSize * sizeof (SFLDataFormat)) / 1000.0);
}
......@@ -220,7 +220,7 @@ class AudioRtpRecordHandler
_audioRtpRecord._dtmfPayloadType = payloadType;
}
unsigned int getDtmfPayloadType(void) {
unsigned int getDtmfPayloadType(void) const {
return _audioRtpRecord._dtmfPayloadType;
}
......
......@@ -207,7 +207,7 @@ class PulseLayer : public AudioLayer
* Get the noise suppressor state
* @return true if noise suppressor activated
*/
bool getNoiseSuppressState (void) {
bool getNoiseSuppressState (void) const {
return AudioLayer::_noisesuppressstate;
}
......
......@@ -99,7 +99,7 @@ class Call: public Recordable
* Return a reference on the conference id
* @return call id
*/
CallID& getConfId() {
const CallID& getConfId() const {
return _confID;
}
......@@ -107,7 +107,7 @@ class Call: public Recordable
_confID = id;
}
inline CallType getCallType (void) {
CallType getCallType (void) const {
return _type;
}
......@@ -125,7 +125,7 @@ class Call: public Recordable
* not protected by mutex (when created)
* @return std::string The peer number
*/
const std::string& getPeerNumber() {
const std::string& getPeerNumber() const {
return _peerNumber;
}
......@@ -143,7 +143,7 @@ class Call: public Recordable
* not protected by mutex (when created)
* @return std::string The peer name
*/
const std::string& getPeerName() {
const std::string& getPeerName() const {
return _peerName;
}
......@@ -161,7 +161,7 @@ class Call: public Recordable
* not protected by mutex (when created)
* @return std::string The peer name
*/
const std::string& getDisplayName() {
const std::string& getDisplayName() const {
return _displayName;
}
......@@ -204,7 +204,7 @@ class Call: public Recordable
_callConfig = callConfig;
}
Call::CallConfiguration getCallConfiguration (void) {
Call::CallConfiguration getCallConfiguration (void) const {
return _callConfig;
}
......@@ -250,7 +250,7 @@ class Call: public Recordable
* Return the audio port seen by the remote side.
* @return unsigned int The external audio port
*/
unsigned int getLocalExternAudioPort() {
unsigned int getLocalExternAudioPort() const {
return _localExternalAudioPort;
}
......@@ -270,7 +270,7 @@ class Call: public Recordable
return getPeerName();
}
std::string getFileName (void) {
std::string getFileName (void) const {
return _peerNumber;
}
......
......@@ -71,7 +71,7 @@ class HistoryItem
*/
~HistoryItem ();
inline std::string get_timestamp () {
std::string get_timestamp () const {
return _timestamp_start;
}
......
......@@ -90,18 +90,18 @@ class HistoryManager
/**
*@return bool True if the history file has been successfully read
*/
inline bool is_loaded (void) {
bool is_loaded (void) const {
return _history_loaded;
}
inline void set_history_path (std::string filename) {
void set_history_path (const std::string &filename) {
_history_path = filename;
}
/*
*@return int The number of items found in the history file
*/
inline int get_history_size (void) {
int get_history_size (void) const {
return _history_items.size ();
}
......@@ -110,7 +110,7 @@ class HistoryManager
int set_serialized_history (std::map <std::string, std::string> history, int limit);
private:
inline int get_unix_timestamp_equivalent (int days) {
int get_unix_timestamp_equivalent (int days) const {
return days * DAY_UNIX_TIMESTAMP;
}
......
......@@ -946,7 +946,7 @@ class ManagerImpl
*/
bool setConfig (const std::string& section, const std::string& name, int value);
inline std::string mapStateNumberToString (RegistrationState state) {
std::string mapStateNumberToString (RegistrationState state) const {
std::string stringRepresentation;
if (state > NumberOfState) {
......
......@@ -44,12 +44,12 @@ class NumberCleaner
std::string clean (std::string to_clean);
inline void set_phone_number_prefix (std::string prefix) {
void set_phone_number_prefix (std::string prefix) {
_debug ("Number: Set phone number prefix %s", _prefix.c_str());
_prefix = prefix;
}
inline std::string get_phone_number_prefix (void) {
std::string get_phone_number_prefix (void) const {
return _prefix;
}
......
......@@ -71,7 +71,7 @@ class LibraryManagerException : public std::runtime_error
LibraryManagerException (const std::string &libraryName, const std::string &details, Reason reason);
~LibraryManagerException (void) throw() {}
inline Reason getReason (void) {
Reason getReason (void) const {
return _reason;
}
......
......@@ -51,7 +51,7 @@ class Plugin
virtual ~Plugin() {}
inline std::string getPluginName (void) {
std::string getPluginName (void) const {
return _name;
}
......
......@@ -46,7 +46,7 @@ public:
std::pair<std::string, std::string>(name, value) {
}
;
inline ~SdpParameter() {
~SdpParameter() {
}
;
std::string getName() const {
......
......@@ -121,7 +121,7 @@ class Pattern
*
* @return The currently set pattern
*/
inline std::string getPattern (void) {
std::string getPattern (void) const {
return _pattern;
}
......
......@@ -109,25 +109,25 @@ class CryptoAttribute
mkiLength (mkiLength) {};
inline std::string getTag() {
std::string getTag() const {
return tag;
};
inline std::string getCryptoSuite() {
std::string getCryptoSuite() const {
return cryptoSuite;
};
inline std::string getSrtpKeyMethod() {
std::string getSrtpKeyMethod() const {
return srtpKeyMethod;
};
inline std::string getSrtpKeyInfo() {
std::string getSrtpKeyInfo() const {
return srtpKeyInfo;
};
inline std::string getLifetime() {
std::string getLifetime() const {
return lifetime;
};
inline std::string getMkiValue() {
std::string getMkiValue() const {
return mkiValue;
};
inline std::string getMkiLength() {
std::string getMkiLength() const {
return mkiLength;
};
......@@ -163,49 +163,49 @@ class SdesNegotiator
/**
* Return crypto suite after negotiation
*/
std::string getCryptoSuite (void) {
std::string getCryptoSuite (void) const {
return _cryptoSuite;
}
/**
* Return key method after negotiation (most likely inline:)
*/
std::string getKeyMethod (void) {
std::string getKeyMethod (void) const {
return _srtpKeyMethod;
}
/**
* Return crypto suite after negotiation
*/
std::string getKeyInfo (void) {
std::string getKeyInfo (void) const {
return _srtpKeyInfo;
}
/**
* Return key lifetime after negotiation
*/
std::string getLifeTime (void) {
std::string getLifeTime (void) const {
return _lifetime;
}
/**
* Return mki value after negotiation
*/
std::string getMkiValue (void) {
std::string getMkiValue (void) const {
return _mkiValue;
}
/**
* Return mki length after negotiation
*/
std::string getMkiLength (void) {
std::string getMkiLength (void) const {
return _mkiLength;
}
/**
* Authentication tag lenth
*/
std::string getAuthTagLength (void) {
std::string getAuthTagLength (void) const {
return _authTagLength;
}
......
......@@ -97,7 +97,7 @@ class Sdp
/**
* Accessor for the internal memory pool
*/
inline pj_pool_t *getMemoryPool (void) {
pj_pool_t *getMemoryPool (void) const {
return memPool;
}
......@@ -319,7 +319,7 @@ class Sdp
* Set the SRTP master_key
* @param mk The Master Key of a srtp session.
*/
inline void setLocalSdpCrypto (const std::vector<std::string> lc) {
void setLocalSdpCrypto (const std::vector<std::string> lc) {
srtpCrypto = lc;
}
......@@ -329,7 +329,7 @@ class Sdp
* have to set the correct zrtp-hash value in the corresponding media section.
* @param hash The hello hash of a rtp session. (Only audio at the moment)
*/
inline void setZrtpHash (const std::string& hash) {
void setZrtpHash (const std::string& hash) {
zrtpHelloHash = hash;
}
......
......@@ -69,7 +69,7 @@ class SIPCall : public Call
* Call Identifier
* @return int SIP call id
*/
int getCid () {
int getCid () const {
return _cid;
}
......@@ -85,7 +85,7 @@ class SIPCall : public Call
* Domain identifier
* @return int SIP domain id
*/
int getDid() {
int getDid() const {
return _did;
}
......@@ -101,7 +101,7 @@ class SIPCall : public Call
* Transaction identifier
* @return int SIP transaction id
*/
int getTid () {
int getTid () const {
return _tid;
}
......@@ -156,7 +156,7 @@ class SIPCall : public Call
/**
* Returns a pointer to the AudioRtp object
*/
inline sfl::AudioRtpFactory * getAudioRtp (void) {
sfl::AudioRtpFactory * getAudioRtp (void) {
return _audiortp;
}
......
......@@ -235,7 +235,7 @@ class VoIPLink
/**
* @return AccountID parent Account's ID
*/
inline AccountID& getAccountID (void) {
AccountID& getAccountID (void) {
return _accountID;
}
......@@ -244,7 +244,7 @@ class VoIPLink
/**
* @param accountID The account identifier
*/
inline void setAccountID (const AccountID& accountID) {
void setAccountID (const AccountID& accountID) {
_accountID = accountID;
}
......
......@@ -85,7 +85,7 @@ class DelayDetectionTest : public CppUnit::TestCase {
void setUp();
inline void tearDown();
void tearDown();
void testCrossCorrelation();
......
......@@ -92,7 +92,7 @@ class HistoryTest : public CppUnit::TestCase {
* Code factoring - Common resources can be released here.
* This method is called by unitcpp after each test
*/
inline void tearDown ();
void tearDown ();
private:
HistoryManager *history;
......
......@@ -76,7 +76,7 @@ class InstantMessagingTest : public CppUnit::TestCase {
* Code factoring - Common resources can be released here.
* This method is called by unitcpp after each test
*/
inline void tearDown ();
void tearDown ();
void testSaveSingleMessage ();
......
......@@ -104,7 +104,7 @@ class MainBufferTest : public CppUnit::TestCase {
* Code factoring - Common resources can be released here.
* This method is called by unitcpp after each test
*/
inline void tearDown();
void tearDown();
void testRingBufferCreation();
......
......@@ -97,7 +97,7 @@ class NumberCleanerTest : public CppUnit::TestCase {
* Code factoring - Common resources can be released here.
* This method is called by unitcpp after each test
*/
inline void tearDown ();