libpressio 0.93.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
pressio_configurable Class Referenceabstract

#include <configurable.h>

Inheritance diagram for pressio_configurable:
Inheritance graph
[legend]
Collaboration diagram for pressio_configurable:
Collaboration graph
[legend]

Public Member Functions

virtual const char * prefix () const =0
 
std::string const & get_name () const
 
virtual void set_name (std::string const &new_name)
 
virtual void set_name_impl (std::string const &new_name)
 
virtual struct pressio_options get_configuration () const
 
virtual struct pressio_options get_documentation () const
 
virtual int check_options (struct pressio_options const &)
 
virtual struct pressio_options get_options () const
 
virtual int set_options (struct pressio_options const &options)
 
int cast_options (pressio_options const &early_config, pressio_options const &config)
 
- Public Member Functions inherited from pressio_errorable
const char * error_msg () const
 
int error_code () const
 

Protected Member Functions

template<class StringType >
void set (pressio_options &options, StringType const &key, pressio_option const &value) const
 
template<class StringType >
void set_type (pressio_options &options, StringType const &key, pressio_option_type type) const
 
template<class StringType , class PointerType >
enum pressio_options_key_status get (pressio_options const &options, StringType &&key, PointerType value) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta (pressio_options &options, StringType &&key, std::string const &current_id, Wrapper const &current_value, Args &&... args) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta_docs (pressio_options &options, StringType &&key, std::string const &docstring, Wrapper const &current_value, Args &&... args) const
 
template<class StringType , class Wrapper , class Registry , class... Args>
void set_meta_configuration (pressio_options &options, StringType &&key, Registry const &registry, Wrapper const &current_value) const
 
template<class StringType , class Wrapper , class Registry , class... Args>
void set_meta_many_configuration (pressio_options &options, StringType &&key, Registry const &registry, std::vector< Wrapper > const &current_values) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta_many_docs (pressio_options &options, StringType &&key, std::string const &docstring, std::vector< Wrapper > const &current_values, Args &&... args) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta_many (pressio_options &options, StringType &&key, std::vector< std::string > const &current_ids, std::vector< Wrapper > const &current_values, Args &&... args) const
 
template<class StringType , class Registry , class Wrapper >
pressio_options_key_status get_meta (pressio_options const &options, StringType &&key, Registry const &registry, std::string &current_id, Wrapper &current_value)
 
template<class StringType , class Registry , class Wrapper >
pressio_options_key_status get_meta_many (pressio_options const &options, StringType &&key, Registry const &registry, std::vector< std::string > &current_ids, std::vector< Wrapper > &current_values)
 
template<class T >
void set_names_many (std::string const &name, std::vector< T > &plugins, std::vector< std::string > const &names) const
 
std::string get_metrics_key_name () const
 
- Protected Member Functions inherited from pressio_errorable
int set_error (int code, std::string const &msg)
 
void clear_error ()
 

Static Protected Member Functions

static pressio_thread_safety get_threadsafe (pressio_configurable const &c)
 

Protected Attributes

std::string name
 

Detailed Description

Base interface for configurable objects in libpressio

Member Function Documentation

◆ check_options()

virtual int pressio_configurable::check_options ( struct pressio_options const &  )
virtual

checks for extra arguments set for the configurable object.

See also
pressio_compressor_check_options for semantics this function obeys

Reimplemented in libpressio_io_plugin, and libpressio_compressor_plugin.

◆ get()

template<class StringType , class PointerType >
enum pressio_options_key_status pressio_configurable::get ( pressio_options const &  options,
StringType &&  key,
PointerType  value 
) const
inlineprotected

helper function to get the type of options according to name prefixes if provided

Parameters
[in]optionsthe options structure to set
[in]keythe key to set
[in]valuethe value to get
Returns
if the key was set

◆ get_configuration()

virtual struct pressio_options pressio_configurable::get_configuration ( ) const
virtual

get the compile time configuration of a configurable object

See also
pressio_compressor_get_configuration for the semantics this function should obey

Reimplemented in libpressio_compressor_plugin, and libpressio_io_plugin.

◆ get_documentation()

virtual struct pressio_options pressio_configurable::get_documentation ( ) const
virtual

get the documentation strings for a compressor

See also
pressio_compressor_get_documentation for the semantics this function should obey

Reimplemented in libpressio_metrics_plugin, libpressio_launch_plugin, pressio_distributed_manager, pressio_subgroup_manager, libpressio_compressor_plugin, and libpressio_io_plugin.

◆ get_meta()

template<class StringType , class Registry , class Wrapper >
pressio_options_key_status pressio_configurable::get_meta ( pressio_options const &  options,
StringType &&  key,
Registry const &  registry,
std::string &  current_id,
Wrapper &  current_value 
)
inlineprotected

helper function to get from a pressio_options structure the values associated with a meta-object

Parameters
[in]optionsthe options to set
[in]keythe meta-key to query
[in]registrythe registry to construct new values from
[in]current_idthe id of the current module
[in]current_valuethe wrapper for the current module

◆ get_meta_many()

template<class StringType , class Registry , class Wrapper >
pressio_options_key_status pressio_configurable::get_meta_many ( pressio_options const &  options,
StringType &&  key,
Registry const &  registry,
std::vector< std::string > &  current_ids,
std::vector< Wrapper > &  current_values 
)
inlineprotected

helper function to get from a pressio_options structure the values associated with multiple meta-objects

Parameters
[in]optionsthe options to set
[in]keythe meta-key to query
[in]registrythe registry to construct new values from
[in]current_idsthe id of the current module
[in]current_valuesthe wrapper for the current module

◆ get_metrics_key_name()

std::string pressio_configurable::get_metrics_key_name ( ) const
inlineprotected
Returns
the string the metrics key name

◆ get_name()

std::string const & pressio_configurable::get_name ( ) const
inline
Returns
the assigned name for the compressor used in options getting/setting

◆ get_options()

virtual struct pressio_options pressio_configurable::get_options ( ) const
virtual

get a set of options available for the configurable object.

The compressor should set a value if they have been set as default The compressor should set a "reset" value if they are required to be set, but don't have a meaningful default

See also
pressio_compressor_get_options for the semantics this function should obey
pressio_options_clear to set a "reset" value
pressio_options_set_integer to set an integer value
pressio_options_set_double to set an double value
pressio_options_set_userptr to set an data value, include an include/ext/<my_plugin>.h to define the structure used
pressio_options_set_string to set a string value

Reimplemented in pressio_distributed_manager, pressio_subgroup_manager, libpressio_compressor_plugin, and libpressio_io_plugin.

◆ get_threadsafe()

static pressio_thread_safety pressio_configurable::get_threadsafe ( pressio_configurable const &  c)
inlinestaticprotected
Returns
that returns the thread_safe configuration parameter

◆ prefix()

virtual const char * pressio_configurable::prefix ( ) const
pure virtual

get the prefix used by this compressor for options

Implemented in pressio_distributed_manager, and pressio_subgroup_manager.

◆ set()

template<class StringType >
void pressio_configurable::set ( pressio_options options,
StringType const &  key,
pressio_option const &  value 
) const
inlineprotected

helper function to set options according to name prefixes if provided

Parameters
[in]optionsthe options structure to set
[in]keythe key to set
[in]valuethe value to set

◆ set_meta()

template<class StringType , class Wrapper , class... Args>
void pressio_configurable::set_meta ( pressio_options options,
StringType &&  key,
std::string const &  current_id,
Wrapper const &  current_value,
Args &&...  args 
) const
inlineprotected

helper function to set on a pressio_options structure the values associated with a meta-object

Parameters
[in]optionsthe options structure to set
[in]keythe key for the name of the child meta-object
[in]current_idname for the current meta-object
[in]current_valuevalue of the current meta-object
[in]argsthe remaining args needed for some meta modules

◆ set_meta_configuration()

template<class StringType , class Wrapper , class Registry , class... Args>
void pressio_configurable::set_meta_configuration ( pressio_options options,
StringType &&  key,
Registry const &  registry,
Wrapper const &  current_value 
) const
inlineprotected

helper function to set docs on a pressio_options structure the configuration associated with a meta-object

Parameters
[in]optionsthe options structure to set
[in]keythe key for the name of the child meta-object
[in]registrydocs for the purpose of the meta object
[in]current_valuevalue of the current meta-object
[in]argsthe remaining args needed for some meta modules

◆ set_meta_docs()

template<class StringType , class Wrapper , class... Args>
void pressio_configurable::set_meta_docs ( pressio_options options,
StringType &&  key,
std::string const &  docstring,
Wrapper const &  current_value,
Args &&...  args 
) const
inlineprotected

helper function to set docs on a pressio_options structure the values associated with a meta-object

Parameters
[in]optionsthe options structure to set
[in]keythe key for the name of the child meta-object
[in]docstringdocs for the purpose of the meta object
[in]current_valuevalue of the current meta-object
[in]argsthe remaining args needed for some meta modules

◆ set_meta_many()

template<class StringType , class Wrapper , class... Args>
void pressio_configurable::set_meta_many ( pressio_options options,
StringType &&  key,
std::vector< std::string > const &  current_ids,
std::vector< Wrapper > const &  current_values,
Args &&...  args 
) const
inlineprotected

helper function to set on a pressio_options structure the values associated with a collection of meta-objects

Parameters
[in]optionsthe options structure to set
[in]keythe key for the name of the child meta-object
[in]current_idsname for the current meta-object
[in]current_valuesvalue of the current meta-object
[in]argsthe remaining args needed for some meta modules

◆ set_meta_many_configuration()

template<class StringType , class Wrapper , class Registry , class... Args>
void pressio_configurable::set_meta_many_configuration ( pressio_options options,
StringType &&  key,
Registry const &  registry,
std::vector< Wrapper > const &  current_values 
) const
inlineprotected

helper function to set on a pressio_options structure the configuration associated with a collection of meta-objects

Parameters
[in]optionsthe options structure to set
[in]keythe key for the name of the child meta-object
[in]docstringdocs for the purpose of this collection of meta objects
[in]current_valuesvalue of the current meta-object
[in]argsthe remaining args needed for some meta modules

◆ set_meta_many_docs()

template<class StringType , class Wrapper , class... Args>
void pressio_configurable::set_meta_many_docs ( pressio_options options,
StringType &&  key,
std::string const &  docstring,
std::vector< Wrapper > const &  current_values,
Args &&...  args 
) const
inlineprotected

helper function to set on a pressio_options structure the docs associated with a collection of meta-objects

Parameters
[in]optionsthe options structure to set
[in]keythe key for the name of the child meta-object
[in]docstringdocs for the purpose of this collection of meta objects
[in]current_valuesvalue of the current meta-object
[in]argsthe remaining args needed for some meta modules

◆ set_name()

virtual void pressio_configurable::set_name ( std::string const &  new_name)
inlinevirtual

sets the assigned name for the compressor used in options getting/setting

Parameters
[in]new_namethe name to be used

Reimplemented in libpressio_io_plugin, libpressio_compressor_plugin, and libpressio_metrics_plugin.

◆ set_name_impl()

virtual void pressio_configurable::set_name_impl ( std::string const &  new_name)
inlinevirtual

Meta-compressors need to know when names are changed so they can update their children

Parameters
[in]new_namethe name to be used

◆ set_names_many()

template<class T >
void pressio_configurable::set_names_many ( std::string const &  name,
std::vector< T > &  plugins,
std::vector< std::string > const &  names 
) const
inlineprotected

Apply names to a set of plugins

Parameters
[in]namethe new name to apply to the plugins
[in]pluginsthe list of plugins to rename
[in]namesthe names to apply to the plugins, if empty, the prefix() will be used

◆ set_options()

virtual int pressio_configurable::set_options ( struct pressio_options const &  options)
virtual

sets a set of options for the configurable object

Parameters
[in]optionsto set for configuration of the configurable object
See also
pressio_compressor_set_options for the semantics this function should obey

Reimplemented in pressio_subgroup_manager, pressio_distributed_manager, libpressio_compressor_plugin, and libpressio_io_plugin.

◆ set_type()

template<class StringType >
void pressio_configurable::set_type ( pressio_options options,
StringType const &  key,
pressio_option_type  type 
) const
inlineprotected

helper function to set the type of options according to name prefixes if provided

Parameters
[in]optionsthe options structure to set
[in]keythe key to set
[in]typethe type to set

Member Data Documentation

◆ name

std::string pressio_configurable::name
protected

the name of the configurable used in nested hierarchies


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