[#BloombergLP-balm-Metric_MacroImp-getCollector-01]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/Metric_MacroImp.adoc[Metric&lowbar;MacroImp]::getCollector
:relfileprefix: ../../../
:mrdocs:

`getCollector` overloads

== Synopses

Declared in `&lt;balm&lowbar;metric&period;h&gt;`

Load the specified `collector` with the address of the default collector (from the default metrics manager) for the specified `metric` identified by the specified `category` and `name`, and register the specified `holder` for `category`&period; Note that `&ast;collector` must be assigned _before_ registering `holder` to ensure that the macros always have a valid `collector` when `holder&hyphen;&gt;enabled()` is `true`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
xref:BloombergLP/balm/Metric_MacroImp/getCollector-07.adoc[getCollector](
    xref:BloombergLP/balm/Collector.adoc[Collector]** collector,
    xref:BloombergLP/balm/CategoryHolder.adoc[CategoryHolder]* holder,
    char const* category,
    char const* metric);
----

[.small]#xref:BloombergLP/balm/Metric_MacroImp/getCollector-07.adoc[_» more&period;&period;&period;_]#

Load the specified `collector` with the address of the default collector (from the default metrics manager) for the specified `metric` identified by the specified `category` and `name`, register the specified `holder` for `category`, and set the identified metric&apos;s preferred publication type to the specified `preferredPublicationType`&period; Note that `&ast;collector` must be assigned before `holder` to ensure that the macros always have a valid `collector` when `holder&hyphen;&gt;enabled()` is `true`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
xref:BloombergLP/balm/Metric_MacroImp/getCollector-00.adoc[getCollector](
    xref:BloombergLP/balm/Collector.adoc[Collector]** collector,
    xref:BloombergLP/balm/CategoryHolder.adoc[CategoryHolder]* holder,
    char const* category,
    char const* metric,
    xref:BloombergLP/balm/PublicationType/Value.adoc[PublicationType::Value] preferredPublicationType);
----

[.small]#xref:BloombergLP/balm/Metric_MacroImp/getCollector-00.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
