Skip to content

Commit d735b52

Browse files
committed
added remove methods for operations
1 parent fb636d9 commit d735b52

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/Flux/flxLogger.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,18 @@ class flxLogger : public flxActionType<flxLogger>
230230
va_add(a1, args...);
231231
}
232232

233+
// small set of removes - for operations
234+
235+
template <typename... Args> void remove(flxOperation &a1, Args &&...args)
236+
{
237+
va_remove(a1, args...);
238+
}
239+
240+
template <typename... Args> void remove(flxOperation *a1, Args &&...args)
241+
{
242+
va_remove(a1, args...);
243+
}
244+
233245
//------------------------------------------------------------
234246
// for metrics
235247
void setEnableLogRate(bool enable);
@@ -385,6 +397,21 @@ class flxLogger : public flxActionType<flxLogger>
385397
va_add(args...);
386398
}
387399

400+
// removes
401+
void va_remove()
402+
{
403+
}
404+
405+
template <typename T, typename... Args> void va_remove(T *a1, Args &&...args)
406+
{
407+
_remove(a1);
408+
va_remove(args...);
409+
}
410+
template <typename T, typename... Args> void va_remove(T &a1, Args &&...args)
411+
{
412+
_remove(a1);
413+
va_remove(args...);
414+
}
388415
//----------------------------------------------------------------------------
389416
// Internal Adds for final object placement add output writers to the logger.
390417
void _add(flxOutputFormat &writer)
@@ -450,4 +477,16 @@ class flxLogger : public flxActionType<flxLogger>
450477
_add(prop);
451478
}
452479
}
480+
481+
// removes
482+
483+
void _remove(flxOperation &op)
484+
{
485+
_remove(&op);
486+
}
487+
void _remove(flxOperation *op)
488+
{
489+
if (op != nullptr)
490+
_opsToLog.remove(op);
491+
}
453492
};

0 commit comments

Comments
 (0)