HAL  v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
hal::PluginParameter Class Reference

#include <hal_core/plugin_system/plugin_parameter.h>

Collaboration diagram for hal::PluginParameter:
Collaboration graph

Public Types

enum  ParameterType {
  Absent , Boolean , Color , ComboBox ,
  Dictionary , ExistingDir , ExistingFile , Float ,
  Gate , Integer , Label , Module ,
  NewFile , PushButton , String , TabName
}
 

Public Member Functions

 PluginParameter (ParameterType tp=Absent, const std::string &tag=std::string(), const std::string &lbl=std::string(), const std::string &val=std::string())
 
std::string get_tagname () const
 
std::string get_label () const
 
std::string get_value () const
 
ParameterType get_type () const
 
void set_value (const std::string &v)
 
void set_tagname (const std::string &tg)
 

Detailed Description

A single configurable parameter of a plugin, described by its type, tag name, label, and current value. The GUI uses these descriptions to render input widgets for a plugin without knowing anything about the plugin itself.

Definition at line 36 of file plugin_parameter.h.

Member Enumeration Documentation

◆ ParameterType

The kind of value that a parameter holds, which also determines how it is presented to the user.

Enumerator
Absent 

No parameter, used as the default of an unset parameter.

Boolean 

A boolean value.

Color 

A color.

ComboBox 

One value picked from a list of alternatives.

Dictionary 

A collection of key-value pairs.

ExistingDir 

The path to a directory that already exists.

ExistingFile 

The path to a file that already exists.

Float 

A floating point number.

Gate 

A gate of the netlist.

Integer 

An integer number.

Label 

A read-only text that is displayed to the user but cannot be edited.

Module 

A module of the netlist.

NewFile 

The path to a file that is yet to be created.

PushButton 

A button that triggers an action instead of holding a value.

String 

An arbitrary text.

TabName 

No value of its own, it starts a new tab that groups the parameters that follow.

Definition at line 42 of file plugin_parameter.h.

Constructor & Destructor Documentation

◆ PluginParameter()

hal::PluginParameter::PluginParameter ( ParameterType  tp = Absent,
const std::string &  tag = std::string(),
const std::string &  lbl = std::string(),
const std::string &  val = std::string() 
)
inline

Construct a new plugin parameter.

Parameters
[in]tp- The type of the parameter. Defaults to PluginParameter::Absent.
[in]tag- The tag name by which the plugin identifies the parameter. Defaults to an empty string.
[in]lbl- The label that is shown to the user. Defaults to an empty string.
[in]val- The initial value. Defaults to an empty string.

Definition at line 77 of file plugin_parameter.h.

Member Function Documentation

◆ get_label()

std::string hal::PluginParameter::get_label ( ) const
inline

Get the label that is shown to the user.

Returns
The label.

Definition at line 92 of file plugin_parameter.h.

Referenced by hal::PYBIND11_PLUGIN().

◆ get_tagname()

std::string hal::PluginParameter::get_tagname ( ) const
inline

Get the tag name by which the plugin identifies the parameter.

Returns
The tag name.

Definition at line 85 of file plugin_parameter.h.

Referenced by hal::PYBIND11_PLUGIN().

◆ get_type()

ParameterType hal::PluginParameter::get_type ( ) const
inline

◆ get_value()

std::string hal::PluginParameter::get_value ( ) const
inline

Get the value of the parameter. The value is always stored as a string, no matter which type the parameter has.

Returns
The value.

Definition at line 100 of file plugin_parameter.h.

Referenced by hal::PluginParameterFileDialog::PluginParameterFileDialog(), hal::PluginParameterNodeDialog::PluginParameterNodeDialog(), and hal::PYBIND11_PLUGIN().

◆ set_tagname()

void hal::PluginParameter::set_tagname ( const std::string &  tg)
inline

Set the tag name by which the plugin identifies the parameter.

Parameters
[in]tg- The new tag name.

Definition at line 122 of file plugin_parameter.h.

Referenced by hal::PYBIND11_PLUGIN().

◆ set_value()

void hal::PluginParameter::set_value ( const std::string &  v)
inline

Set the value of the parameter. The value is always stored as a string, no matter which type the parameter has.

Parameters
[in]v- The new value.

Definition at line 115 of file plugin_parameter.h.

Referenced by hal::PYBIND11_PLUGIN().


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