Add polymorphism support to Ref
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "arena.hpp"
|
||||
#include "reference.hpp"
|
||||
|
||||
namespace metric {
|
||||
|
||||
@@ -255,12 +256,12 @@ struct Collector {
|
||||
/**
|
||||
* @brief Register a collector with the metrics system.
|
||||
*
|
||||
* The system will hold a shared_ptr to the collector and call its collect()
|
||||
* The system will hold a Ref to the collector and call its collect()
|
||||
* method during each metric rendering.
|
||||
*
|
||||
* @param collector A shared_ptr to the collector to be registered.
|
||||
* @param collector A Ref to the collector to be registered.
|
||||
*/
|
||||
void register_collector(std::shared_ptr<Collector> collector);
|
||||
void register_collector(Ref<Collector> collector);
|
||||
|
||||
// Note: Histograms do not support callbacks due to their multi-value nature
|
||||
// (buckets + sum + count). Use static histogram metrics only.
|
||||
|
||||
Reference in New Issue
Block a user