40 const std::string vers;
41 const std::vector<std::string> tags;
44 std::string separator;
46 inline static const char *adc_libadiak_many_plugin_separator_default =
"/";
47 const std::map< const string, const string > plugin_config_defaults =
49 {
"SEPARATOR", adc_libadiak_many_plugin_separator_default}
51 inline static const char *plugin_prefix =
"ADC_ADIAK_MANY_PLUGIN_";
53 void write_adiak(std::string_view sv,
const field& f)
63 void walk_builder(std::string
name, std::shared_ptr<builder_api> b)
66 std::vector<std::string> fnames = b->get_field_names();
67 for (
auto& n : fnames) {
68 field f = b->get_value(n);
69 std::string prefix =
name +
"/" + n;
70 write_adiak(prefix, f);
73 std::vector<std::string> names = b->get_section_names();
74 for (
auto& n : names) {
75 std::string prefix =
name +
"/" + n;
76 walk_builder(prefix, b->get_section(n));
80 int config(std::string sep)
87 const string get(
const std::map< string, string >& m,
90 auto it = m.find(fieldname);
94 string en =
string(env_prefix) += fieldname;
95 char *ec = getenv(en.c_str());
97 return plugin_config_defaults.at(fieldname);
105 std::cout <<
"Constructing libadiak_many_plugin" << std::endl;
106 separator = adc_libadiak_many_plugin_separator_default;
114 walk_builder(
"adc", b);
118 int config(
const std::map< std::string, std::string >& m) {
119 string prog = get(m,
"SEPARATOR", plugin_prefix);
123 int config(
const std::map< std::string, std::string >& m, std::string_view env_prefix) {
124 string prog = get(m,
"SEPARATOR", env_prefix);
129 return plugin_config_defaults;
147 std::string_view
name()
const {
148 return "libadiak_many";
156 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)