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

Publisher plugin interface. More...

#include <publisher.hpp>

Inheritance diagram for adc::publisher_api:
Inheritance graph
[legend]

Public Member Functions

virtual ~publisher_api ()
 
virtual std::string_view name () const =0
 
virtual std::string_view version () const =0
 
virtual int publish (std::shared_ptr< builder_api > b)=0
 Publish the content of the builder.
 
virtual int config (const std::map< std::string, std::string > &m)=0
 Configure the plugin with the options given.
 
virtual int config (const std::map< std::string, std::string > &m, std::string_view env_prefix)=0
 Configure the plugin with the options given and the corresponding environment variables.
 
virtual const std::map< const std::string, const std::string > & get_option_defaults ()=0
 Look up the settable options and their defaults.
 
virtual int initialize ()=0
 Ready the plugin to publish following the configuration options set or defaulted.
 
virtual void finalize ()=0
 Stop publishing and release any resources held for managing publication.
 
virtual void pause ()=0
 Pause publishing until a call to resume. Duplicate calls are allowed.
 
virtual void resume ()=0
 Resume publishing Duplicate calls are allowed.
 

Detailed Description

Publisher plugin interface.

Life-cycle of a plugin:

A publisher object should not be assumed thread-safe. In particular, there may be conflicts among config/initialize/publish/finalize calls across multiple threads. Publishers which are thread-safe will document that fact individually.

Definition at line 43 of file publisher.hpp.

Constructor & Destructor Documentation

◆ ~publisher_api()

virtual adc::publisher_api::~publisher_api ( )
inlinevirtual

Definition at line 46 of file publisher.hpp.

Member Function Documentation

◆ name()

virtual std::string_view adc::publisher_api::name ( ) const
pure virtual

◆ version()

virtual std::string_view adc::publisher_api::version ( ) const
pure virtual

◆ publish()

virtual int adc::publisher_api::publish ( std::shared_ptr< builder_api b)
pure virtual

◆ config() [1/2]

virtual int adc::publisher_api::config ( const std::map< std::string, std::string > &  m)
pure virtual

Configure the plugin with the options given.

Parameters
ma map with keys documented in the plugin-specific header.

For plugin QQQ, Environment variables ADC_QQQ_PLUGIN_* will override the source code default for any key not defined in m. Here QQQ is the uppercase version of the plugin name.

Implemented in adc::none_plugin, adc::stdout_plugin, adc::curl_plugin, adc::file_plugin, adc::ldms_message_publish_plugin, adc::ldmsd_stream_publish_plugin, adc::libadiak_json_plugin, adc::libadiak_many_plugin, adc::libcurl_plugin, adc::libldms_msg_publish_plugin, adc::multifile_plugin, adc::script_plugin, and adc::syslog_plugin.

◆ config() [2/2]

virtual int adc::publisher_api::config ( const std::map< std::string, std::string > &  m,
std::string_view  env_prefix 
)
pure virtual

Configure the plugin with the options given and the corresponding environment variables.

Parameters
ma map with keys documented in the plugin-specific header.
env_prefixis prepended to the expected keys for the plugin and values found with getenv that match are used, overriding elements of m. Typically, env_prefix will be PPP_ADC_QQQ_PLUGIN_ if application PPP wants to override the defaults of plugin QQQ. Here QQQ is the uppercase version of the plugin name.

Implemented in adc::none_plugin, adc::stdout_plugin, adc::libadiak_json_plugin, adc::libadiak_many_plugin, adc::libcurl_plugin, adc::multifile_plugin, adc::script_plugin, adc::syslog_plugin, adc::curl_plugin, adc::file_plugin, adc::ldms_message_publish_plugin, and adc::ldmsd_stream_publish_plugin.

◆ get_option_defaults()

virtual const std::map< const std::string, const std::string > & adc::publisher_api::get_option_defaults ( )
pure virtual

◆ initialize()

virtual int adc::publisher_api::initialize ( )
pure virtual

◆ finalize()

virtual void adc::publisher_api::finalize ( )
pure virtual

◆ pause()

virtual void adc::publisher_api::pause ( )
pure virtual

◆ resume()

virtual void adc::publisher_api::resume ( )
pure virtual

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