@@ -196,44 +196,44 @@ void registerMemoryCallbacks() {
196196// ! Apply a function \p f to a gatherer held as a value by map entry \p i
197197// ! of an explicit metric category
198198template <model_t ::EMetricCategory CATEGORY, typename ITR, typename F>
199- void apply (ITR i, const F& f) {
199+ void applyFunc (ITR i, const F& f) {
200200 using TDataType = typename SDataType<CATEGORY>::Type;
201201 f (i->first , boost::any_cast<typename SMaybeConst<ITR, TDataType>::Type&>(i->second ));
202202}
203203
204204// ! Apply a function \p f to all the gatherers held in [\p begin, \p end).
205205template <typename ITR, typename F>
206- bool apply (ITR begin, ITR end, const F& f) {
206+ bool applyFunc (ITR begin, ITR end, const F& f) {
207207 for (ITR i = begin; i != end; ++i) {
208208 model_t ::EMetricCategory category = i->first .first ;
209209 try {
210210 switch (category) {
211211 case model_t ::E_Mean:
212- apply <model_t ::E_Mean>(i, f);
212+ applyFunc <model_t ::E_Mean>(i, f);
213213 break ;
214214 case model_t ::E_Median:
215- apply <model_t ::E_Median>(i, f);
215+ applyFunc <model_t ::E_Median>(i, f);
216216 break ;
217217 case model_t ::E_Min:
218- apply <model_t ::E_Min>(i, f);
218+ applyFunc <model_t ::E_Min>(i, f);
219219 break ;
220220 case model_t ::E_Max:
221- apply <model_t ::E_Max>(i, f);
221+ applyFunc <model_t ::E_Max>(i, f);
222222 break ;
223223 case model_t ::E_Variance:
224- apply <model_t ::E_Variance>(i, f);
224+ applyFunc <model_t ::E_Variance>(i, f);
225225 break ;
226226 case model_t ::E_Sum:
227- apply <model_t ::E_Sum>(i, f);
227+ applyFunc <model_t ::E_Sum>(i, f);
228228 break ;
229229 case model_t ::E_MultivariateMean:
230- apply <model_t ::E_MultivariateMean>(i, f);
230+ applyFunc <model_t ::E_MultivariateMean>(i, f);
231231 break ;
232232 case model_t ::E_MultivariateMin:
233- apply <model_t ::E_MultivariateMin>(i, f);
233+ applyFunc <model_t ::E_MultivariateMin>(i, f);
234234 break ;
235235 case model_t ::E_MultivariateMax:
236- apply <model_t ::E_MultivariateMax>(i, f);
236+ applyFunc <model_t ::E_MultivariateMax>(i, f);
237237 break ;
238238 }
239239 } catch (const std::exception& e) {
@@ -247,8 +247,8 @@ bool apply(ITR begin, ITR end, const F& f) {
247247
248248// ! Apply a function \p f to all the gatherers held in \p data.
249249template <typename T, typename F>
250- bool apply (T& data, const F& f) {
251- return apply (data.begin (), data.end (), f);
250+ bool applyFunc (T& data, const F& f) {
251+ return applyFunc (data.begin (), data.end (), f);
252252}
253253
254254// ! Initialize feature data for a specific category
@@ -965,8 +965,9 @@ void CMetricBucketGatherer::acceptPersistInserter(core::CStatePersistInserter& i
965965 inserter.insertLevel (BASE_TAG, std::bind (&CBucketGatherer::baseAcceptPersistInserter,
966966 this , std::placeholders::_1));
967967 inserter.insertValue (VERSION_TAG, CURRENT_VERSION);
968- apply (m_FeatureData, std::bind<void >(CPersistFeatureData (), std::placeholders::_1,
969- std::placeholders::_2, std::ref (inserter)));
968+ applyFunc (m_FeatureData,
969+ std::bind<void >(CPersistFeatureData (), std::placeholders::_1,
970+ std::placeholders::_2, std::ref (inserter)));
970971}
971972
972973bool CMetricBucketGatherer::acceptRestoreTraverser (core::CStateRestoreTraverser& traverser) {
@@ -1270,16 +1271,17 @@ void CMetricBucketGatherer::recyclePeople(const TSizeVec& peopleToRemove) {
12701271 return ;
12711272 }
12721273
1273- apply (m_FeatureData, std::bind<void >(SRemovePeople (), std::placeholders::_1,
1274- std::placeholders::_2, std::cref (peopleToRemove)));
1274+ applyFunc (m_FeatureData,
1275+ std::bind<void >(SRemovePeople (), std::placeholders::_1,
1276+ std::placeholders::_2, std::cref (peopleToRemove)));
12751277
12761278 this ->CBucketGatherer ::recyclePeople (peopleToRemove);
12771279}
12781280
12791281void CMetricBucketGatherer::removePeople (std::size_t lowestPersonToRemove) {
1280- apply (m_FeatureData, std::bind<void >(SRemovePeople (), std::placeholders::_1,
1281- std::placeholders::_2, lowestPersonToRemove,
1282- m_DataGatherer.numberPeople ()));
1282+ applyFunc (m_FeatureData, std::bind<void >(SRemovePeople (), std::placeholders::_1,
1283+ std::placeholders::_2, lowestPersonToRemove,
1284+ m_DataGatherer.numberPeople ()));
12831285
12841286 this ->CBucketGatherer ::removePeople (lowestPersonToRemove);
12851287}
@@ -1290,19 +1292,20 @@ void CMetricBucketGatherer::recycleAttributes(const TSizeVec& attributesToRemove
12901292 }
12911293
12921294 if (m_DataGatherer.isPopulation ()) {
1293- apply (m_FeatureData,
1294- std::bind<void >(SRemoveAttributes (), std::placeholders::_1,
1295- std::placeholders::_2, std::cref (attributesToRemove)));
1295+ applyFunc (m_FeatureData,
1296+ std::bind<void >(SRemoveAttributes (), std::placeholders::_1,
1297+ std::placeholders::_2, std::cref (attributesToRemove)));
12961298 }
12971299
12981300 this ->CBucketGatherer ::recycleAttributes (attributesToRemove);
12991301}
13001302
13011303void CMetricBucketGatherer::removeAttributes (std::size_t lowestAttributeToRemove) {
13021304 if (m_DataGatherer.isPopulation ()) {
1303- apply (m_FeatureData, std::bind<void >(SRemoveAttributes (), std::placeholders::_1,
1304- std::placeholders::_2, lowestAttributeToRemove,
1305- m_DataGatherer.numberAttributes ()));
1305+ applyFunc (m_FeatureData,
1306+ std::bind<void >(SRemoveAttributes (), std::placeholders::_1,
1307+ std::placeholders::_2, lowestAttributeToRemove,
1308+ m_DataGatherer.numberAttributes ()));
13061309 }
13071310
13081311 this ->CBucketGatherer ::removeAttributes (lowestAttributeToRemove);
@@ -1312,8 +1315,9 @@ uint64_t CMetricBucketGatherer::checksum() const {
13121315 uint64_t seed = this ->CBucketGatherer ::checksum ();
13131316 seed = maths::CChecksum::calculate (seed, m_DataGatherer.params ().s_DecayRate );
13141317 TStrCRefStrCRefPrUInt64Map hashes;
1315- apply (m_FeatureData, std::bind<void >(SHash (), std::placeholders::_1, std::placeholders::_2,
1316- std::cref (*this ), std::ref (hashes)));
1318+ applyFunc (m_FeatureData, std::bind<void >(SHash (), std::placeholders::_1,
1319+ std::placeholders::_2,
1320+ std::cref (*this ), std::ref (hashes)));
13171321 LOG_TRACE (<< " seed = " << seed);
13181322 LOG_TRACE (<< " hashes = " << core::CContainerPrinter::print (hashes));
13191323 return maths::CChecksum::calculate (seed, hashes);
@@ -1353,22 +1357,22 @@ bool CMetricBucketGatherer::resetBucket(core_t::TTime bucketStart) {
13531357 if (this ->CBucketGatherer ::resetBucket (bucketStart) == false ) {
13541358 return false ;
13551359 }
1356- apply (m_FeatureData, std::bind<void >(SResetBucket (), std::placeholders::_1,
1357- std::placeholders::_2, bucketStart));
1360+ applyFunc (m_FeatureData, std::bind<void >(SResetBucket (), std::placeholders::_1,
1361+ std::placeholders::_2, bucketStart));
13581362 return true ;
13591363}
13601364
13611365void CMetricBucketGatherer::releaseMemory (core_t ::TTime samplingCutoffTime) {
1362- apply (m_FeatureData, std::bind<void >(SReleaseMemory (), std::placeholders::_1,
1363- std::placeholders::_2, samplingCutoffTime));
1366+ applyFunc (m_FeatureData, std::bind<void >(SReleaseMemory (), std::placeholders::_1,
1367+ std::placeholders::_2, samplingCutoffTime));
13641368}
13651369
13661370void CMetricBucketGatherer::sample (core_t ::TTime time) {
13671371 if (m_DataGatherer.sampleCounts ()) {
1368- apply (m_FeatureData,
1369- std::bind<void >(SDoSample (), std::placeholders::_1,
1370- std::placeholders::_2, time, std::cref (*this ),
1371- std::ref (*m_DataGatherer.sampleCounts ())));
1372+ applyFunc (m_FeatureData,
1373+ std::bind<void >(SDoSample (), std::placeholders::_1,
1374+ std::placeholders::_2, time, std::cref (*this ),
1375+ std::ref (*m_DataGatherer.sampleCounts ())));
13721376 }
13731377}
13741378
@@ -1392,10 +1396,10 @@ void CMetricBucketGatherer::featureData(core_t::TTime time,
13921396 if (begin != m_FeatureData.end ()) {
13931397 auto end = begin;
13941398 ++end;
1395- apply (begin, end,
1396- std::bind<void >(SExtractFeatureData (), std::placeholders::_1,
1397- std::placeholders::_2, std::cref (*this ), feature,
1398- time, bucketLength, std::ref (result)));
1399+ applyFunc (begin, end,
1400+ std::bind<void >(SExtractFeatureData (), std::placeholders::_1,
1401+ std::placeholders::_2, std::cref (*this ), feature,
1402+ time, bucketLength, std::ref (result)));
13991403 } else {
14001404 LOG_ERROR (<< " No data for category " << model_t::print (category));
14011405 }
@@ -1436,9 +1440,9 @@ void CMetricBucketGatherer::addValue(std::size_t pid,
14361440 }
14371441
14381442 stat.s_Influences = &influences;
1439- apply (m_FeatureData, std::bind<void >(SAddValue (), std::placeholders::_1,
1440- std::placeholders::_2, pid, cid,
1441- std::cref (*this ), std::ref (stat)));
1443+ applyFunc (m_FeatureData, std::bind<void >(SAddValue (), std::placeholders::_1,
1444+ std::placeholders::_2, pid, cid,
1445+ std::cref (*this ), std::ref (stat)));
14421446}
14431447
14441448void CMetricBucketGatherer::startNewBucket (core_t ::TTime time, bool skipUpdates) {
@@ -1480,8 +1484,8 @@ void CMetricBucketGatherer::startNewBucket(core_t::TTime time, bool skipUpdates)
14801484 m_DataGatherer.sampleCounts ()->refresh (m_DataGatherer);
14811485 }
14821486 }
1483- apply (m_FeatureData, std::bind<void >(SStartNewBucket (), std::placeholders::_1,
1484- std::placeholders::_2, time));
1487+ applyFunc (m_FeatureData, std::bind<void >(SStartNewBucket (), std::placeholders::_1,
1488+ std::placeholders::_2, time));
14851489}
14861490
14871491void CMetricBucketGatherer::initializeFieldNamesPart1 (const std::string& personFieldName,
0 commit comments