From 461257746dd65bf1ba7360b8066a52eea8ee8d0a Mon Sep 17 00:00:00 2001 From: Anil Tuncel Date: Tue, 17 Oct 2023 16:31:14 +0200 Subject: [PATCH] move getMapData implementations to cfeature.cpp --- efel/cppcore/cfeature.cpp | 17 +++++++++++++++++ efel/cppcore/cfeature.h | 22 ++++------------------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/efel/cppcore/cfeature.cpp b/efel/cppcore/cfeature.cpp index 288777cc..5c449861 100644 --- a/efel/cppcore/cfeature.cpp +++ b/efel/cppcore/cfeature.cpp @@ -57,6 +57,23 @@ cFeature::cFeature(const string& strDepFile, const string& outdir) logger << "Using dependency file: " << strDepFile << endl; } +template +const vector cFeature::getMapData(const string& strName, const map>& mapData) { + auto mapItr = mapData.find(strName); + if (mapItr == mapData.end()) { + return vector{}; // Return an empty vector without modifying the map + } + return mapItr->second; +} + +const vector cFeature::getmapIntData(string strName) { + return getMapData(strName, mapIntData); +} + +const vector cFeature::getmapDoubleData(string strName) { + return getMapData(strName, mapDoubleData); +} + int cFeature::setVersion(string strDepFile) { FptrTable.clear(); /* diff --git a/efel/cppcore/cfeature.h b/efel/cppcore/cfeature.h index 39d1ce0c..2bffbfdb 100644 --- a/efel/cppcore/cfeature.h +++ b/efel/cppcore/cfeature.h @@ -44,27 +44,13 @@ class cFeature { public: std::map > fptrlookup; - - template - const vector getMapData(const string& strName, const map>& mapData) { - auto mapItr = mapData.find(strName); - if (mapItr == mapData.end()) { - return vector{}; // Return an empty vector without modifying the map - } - return mapItr->second; - } - - const vector getmapIntData(string strName) { - return getMapData(strName, mapIntData); - } - - const vector getmapDoubleData(string strName) { - return getMapData(strName, mapDoubleData); - } - eFELLogger logger; cFeature(const string& depFile, const string& outdir); + template + const vector getMapData(const string& strName, const map>& mapData); + const vector getmapIntData(string strName); + const vector getmapDoubleData(string strName); int getmapfptrVec(string strName, vector& vFptr); int calc_features(const string& name); template