diff options
author | Jens Lorenz <jlorenz@de.adit-jv.com> | 2017-03-14 08:57:55 +0100 |
---|---|---|
committer | Jens Lorenz <jlorenz@de.adit-jv.com> | 2017-04-11 21:35:42 +0200 |
commit | b3075389aa61c019fdb5d904abab84532f178250 (patch) | |
tree | 106743918481ff3f88a34b33ea7d33e3cdcb8336 /AudioManagerCore/src/CAmDatabaseHandlerMap.cpp | |
parent | 71eab93f9cd67b2e0343700552adf988c420f174 (diff) | |
download | audiomanager-b3075389aa61c019fdb5d904abab84532f178250.tar.gz |
AMCore: Fix parameter names of increaseID & getNextConnectionID
The functions are used in a generic way which should be covered by the parameter names.
Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
Diffstat (limited to 'AudioManagerCore/src/CAmDatabaseHandlerMap.cpp')
-rw-r--r-- | AudioManagerCore/src/CAmDatabaseHandlerMap.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp b/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp index 83419b9..d398a1e 100644 --- a/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp +++ b/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp @@ -384,17 +384,17 @@ void CAmDatabaseHandlerMap::AmCrossfader::getDescription (std::string & outStrin outString = fmt.str(); } -bool CAmDatabaseHandlerMap::AmMappedData::increaseID(int16_t & resultID, AmIdentifier & sourceID, +bool CAmDatabaseHandlerMap::AmMappedData::increaseID(int16_t & resultID, AmIdentifier & elementID, int16_t const desiredStaticID = 0) { - if( desiredStaticID > 0 && desiredStaticID < sourceID.mMin ) + if( desiredStaticID > 0 && desiredStaticID < elementID.mMin ) { resultID = desiredStaticID; return true; } - else if( sourceID.mCurrentValue < sourceID.mMax ) //The last used value is 'limit' - 1. e.g. SHRT_MAX - 1, SHRT_MAX is reserved. + else if( elementID.mCurrentValue < elementID.mMax ) //The last used value is 'limit' - 1. e.g. SHRT_MAX - 1, SHRT_MAX is reserved. { - resultID = sourceID.mCurrentValue++; + resultID = elementID.mCurrentValue++; return true; } else @@ -402,31 +402,31 @@ bool CAmDatabaseHandlerMap::AmMappedData::increaseID(int16_t & resultID, AmIdent resultID = -1; return false; } - } +} -template <typename TMapKey,class TMapObject> bool CAmDatabaseHandlerMap::AmMappedData::getNextConnectionID(int16_t & resultID, AmIdentifier & sourceID, +template <typename TMapKey,class TMapObject> bool CAmDatabaseHandlerMap::AmMappedData::getNextConnectionID(int16_t & resultID, AmIdentifier & connID, const std::unordered_map<TMapKey, TMapObject> & map) { TMapKey nextID; - int16_t const lastID = sourceID.mCurrentValue; - if( sourceID.mCurrentValue < sourceID.mMax ) - nextID = sourceID.mCurrentValue++; + int16_t const lastID = connID.mCurrentValue; + if( connID.mCurrentValue < connID.mMax ) + nextID = connID.mCurrentValue++; else - nextID = sourceID.mCurrentValue = sourceID.mMin; + nextID = connID.mCurrentValue = connID.mMin; bool notFreeIDs = false; while( existsObjectWithKeyInMap(nextID, map) ) { - if( sourceID.mCurrentValue < sourceID.mMax ) - nextID = sourceID.mCurrentValue++; + if( connID.mCurrentValue < connID.mMax ) + nextID = connID.mCurrentValue++; else { - sourceID.mCurrentValue = sourceID.mMin; - nextID = sourceID.mCurrentValue++; + connID.mCurrentValue = connID.mMin; + nextID = connID.mCurrentValue; } - if( sourceID.mCurrentValue == lastID ) + if( connID.mCurrentValue == lastID ) { notFreeIDs = true; break; |