Class base_collector
Defined in File base_collector.hpp
Inheritance Relationships
Base Type
public rcppsw::er::client< base_collector >
(Template Class client)
Derived Types
public rcppsw::ds::metrics::grid2D_metrics_collector
(Class grid2D_metrics_collector)public rcppsw::ds::metrics::grid3D_metrics_collector
(Class grid3D_metrics_collector)
Class Documentation
-
class base_collector : public rcppsw::er::client<base_collector>
Base class that uses the template design pattern to provide hooks for derived classes so that the process of writing out metrics is centralized in one place (here).
Metrics are written out in .csv format at whatever frequency derived classes choose.
Subclassed by rcppsw::ds::metrics::grid2D_metrics_collector, rcppsw::ds::metrics::grid3D_metrics_collector
Public Functions
-
explicit base_collector(std::unique_ptr<base_sink> sink)
- Parameters:
sinks – The sinks for the metrics that determines how they will be written to the filesystem.
-
virtual ~base_collector(void) = default
-
virtual void collect(const rcppsw::metrics::base_metrics &metrics) = 0
Collect metrics from an object which implements the necessary interface (must be checked with a dynamic cast in the function itself).
-
virtual const rmetrics::base_data *data(void) const = 0
Get a handle to the gathered data.
-
void finalize(void)
See also
-
write_status flush(const rtypes::timestep &t)
See also
-
template<typename ...Args>
inline auto Func(Args&&... args) const -> decltype(std::declval<decltype(Member)>().Func(args...))
-
template<typename ...Args>
inline auto Func(Args&&... args) const -> decltype(std::declval<decltype(Member)>().Func(args...))
-
void initialize(void)
Initialize metrics collection.
Should be called only on collection start.
-
void interval_reset(const rtypes::timestep &t)
Reset metrics at the end of an interval.
Can be called every timestep (and probably should be for consistency as behavior of derived classes possibly changes), and metrics will only be reset after the specified number of timesteps in the interval has elapsed.
Protected Functions
-
inline virtual void reset_after_interval(void)
Reset some metrics (possibly).
Can be called at the end of every interval. By default it does nothing.
-
explicit base_collector(std::unique_ptr<base_sink> sink)