libadc-cxx 1.0.0
Structured logging for scientific computing
Loading...
Searching...
No Matches
Public Member Functions | List of all members
adc::factory Class Reference

provides publishers and builders of application metadata. More...

#include <factory.hpp>

Public Member Functions

std::shared_ptr< publisher_apiget_publisher (const std::string &name)
 
std::shared_ptr< publisher_apiget_publisher (const std::string &name, const std::map< std::string, std::string > &opts)
 
const std::set< std::string > & get_publisher_names ()
 
std::shared_ptr< multi_publisher_apiget_multi_publisher ()
 
std::shared_ptr< multi_publisher_apiget_multi_publisher (std::vector< std::string > &plugin_list)
 
std::shared_ptr< builder_apiget_builder ()
 

Detailed Description

provides publishers and builders of application metadata.

This class provides builders of abstracted metadata objects and publishers. Generally an application will create and configure one publisher (or a multipublisher) and as many builder objects as needed. In most cases, a new builder object is used for each published event.

Definition at line 37 of file factory.hpp.

Member Function Documentation

◆ get_publisher() [1/2]

std::shared_ptr< publisher_api > adc::factory::get_publisher ( const std::string &  name)
Returns
a publisher instance
Parameters
nameone of the elements found with get_publisher_names().

Definition at line 142 of file factory.ipp.

◆ get_publisher() [2/2]

std::shared_ptr< publisher_api > adc::factory::get_publisher ( const std::string &  name,
const std::map< std::string, std::string > &  opts 
)
Returns
a publisher instance, or an empty pointer if the name is unavailable.
Parameters
nameone of the elements found with get_publisher_names().
optsa map of option names and their values; plugins will silently ignore unused options.

Definition at line 199 of file factory.ipp.

◆ get_publisher_names()

const std::set< std::string > & adc::factory::get_publisher_names ( )
Returns
the names of publishers available. The "none", "stdout", "file", "multifile", "syslog", and "script" publishers are always available in Linux environments.

Definition at line 258 of file factory.ipp.

◆ get_multi_publisher() [1/2]

std::shared_ptr< multi_publisher_api > adc::factory::get_multi_publisher ( )
Returns
a multipublisher instance for populating.

multi_publisher provides a convenient way to publish on multiple publishers without duplicate calls to a publish() function.

Definition at line 103 of file factory.ipp.

◆ get_multi_publisher() [2/2]

std::shared_ptr< multi_publisher_api > adc::factory::get_multi_publisher ( std::vector< std::string > &  plugin_list)
Returns
a multipublisher instance pre-populated from environment settings.

This function creates a multi_publisher pre-configured with the publisher plugins named in the input vector. If the input vector is empty, publishers named in the environment variable ADC_MULTI_PUBLISHER_NAMES are created. Plugin names in the environment variable are colon-separated. In both cases, the publishers are configured using their defaults and plugin-specific environment variables.

Definition at line 109 of file factory.ipp.

◆ get_builder()

std::shared_ptr< builder_api > adc::factory::get_builder ( )
Returns
an empty json builder object

Definition at line 264 of file factory.ipp.


The documentation for this class was generated from the following files: