36 const std::string vers;
37 const std::vector<std::string> tags;
40 std::string separator;
42 inline static const char *adc_libadiak_many_plugin_separator_default =
"/";
43 const std::map< const string, const string > plugin_config_defaults =
45 {
"SEPARATOR", adc_libadiak_many_plugin_separator_default}
47 inline static const char *plugin_prefix =
"ADC_ADIAK_MANY_PLUGIN_";
49 void write_adiak(std::string_view sv,
const field& f)
59 void walk_builder(std::string
name, std::shared_ptr<builder_api> b)
62 std::vector<std::string> fnames = b->get_field_names();
63 for (
auto& n : fnames) {
64 field f = b->get_value(n);
65 std::string prefix =
name +
"/" + n;
66 write_adiak(prefix, f);
69 std::vector<std::string> names = b->get_section_names();
70 for (
auto& n : names) {
71 std::string prefix =
name +
"/" + n;
72 walk_builder(prefix, b->get_section(n));
76 int config(std::string sep)
83 const string get(
const std::map< string, string >& m,
86 auto it = m.find(fieldname);
90 string en =
string(env_prefix) += fieldname;
91 char *ec = getenv(en.c_str());
93 return plugin_config_defaults.at(fieldname);
101 std::cout <<
"Constructing libadiak_many_plugin" << std::endl;
102 separator = adc_libadiak_many_plugin_separator_default;
110 walk_builder(
"adc", b);
114 int config(
const std::map< std::string, std::string >& m) {
115 string prog = get(m,
"SEPARATOR", plugin_prefix);
119 int config(
const std::map< std::string, std::string >& m, std::string_view env_prefix) {
120 string prog = get(m,
"SEPARATOR", env_prefix);
125 return plugin_config_defaults;
143 std::string_view
name()
const {
144 return "libadiak_many";
152 std::cout <<
"Destructing libadiak_many_plugin" << std::endl;
Terminal output publisher_api implementation. This plugin sends messages to libadiak synchronously....
const std::map< const std::string, const std::string > & get_option_defaults()
Look up the settable options and their defaults.
void finalize()
Stop publishing and release any resources held for managing publication.
int publish(std::shared_ptr< builder_api > b)
Publish the content of the builder.
std::string_view version() const
void resume()
Resume publishing Duplicate calls are allowed.
int config(const std::map< std::string, std::string > &m, std::string_view env_prefix)
Configure the plugin with the options given and the corresponding environment variables.
int initialize()
Ready the plugin to publish following the configuration options set or defaulted.
int config(const std::map< std::string, std::string > &m)
Configure the plugin with the options given.
void pause()
Pause publishing until a call to resume. Duplicate calls are allowed.
std::string_view name() const
Publisher plugin interface.
scalar_type
field types for scientific data encode/decode with json.
std::string_view string_view
scalar_type adiak_type_to_adc_type(adiak_type_t at)