gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
onelab::number Class Reference

#include <onelab.h>

Inheritance diagram for onelab::number:
Collaboration diagram for onelab::number:

Public Member Functions

 number (const std::string &name="", double value=0., const std::string &label="", const std::string &help="")
 
 number (const std::string &name, const std::vector< double > &values, const std::string &label="", const std::string &help="")
 
void setValue (double value)
 
void setValues (const std::vector< double > &values)
 
void setMin (double min)
 
void setMax (double max)
 
void setStep (double step)
 
void setIndex (int index)
 
void setChoices (const std::vector< double > &choices)
 
void setChoiceLabels (const std::vector< std::string > &labels)
 
void setValueLabels (const std::map< double, std::string > &valueLabels)
 
void setValueLabel (double value, const std::string &label)
 
std::string getType () const
 
double getValue () const
 
std::string getValueAsString () const
 
const std::vector< double > & getValues () const
 
int getNumValues () const
 
double getMin () const
 
double getMax () const
 
double getStep () const
 
int getIndex () const
 
const std::vector< double > & getChoices () const
 
const std::map< double, std::string > & getValueLabels () const
 
std::string getValueLabel (double value) const
 
void update (const number &p)
 
std::string toChar () const
 
std::string::size_type fromChar (const std::string &msg)
 
std::string toJSON () const
 
bool fromJSON (const std::string &json)
 
bool fromJSON (const picojson::value::object &par)
 
- Public Member Functions inherited from onelab::parameter
 parameter (const std::string &name="", const std::string &label="", const std::string &help="")
 
virtual ~parameter ()
 
void setName (const std::string &name)
 
void setLabel (const std::string &label)
 
void setHelp (const std::string &help)
 
void setChanged (int changed, const std::string &client="")
 
void setChangedValue (int value)
 
void setNeverChanged (bool never)
 
void setVisible (bool visible)
 
void setReadOnly (bool readOnly)
 
void setAttribute (const std::string &key, const std::string &value)
 
void setAttributes (const std::map< std::string, std::string > &attributes)
 
void setClients (const std::map< std::string, int > &clients)
 
void addClient (const std::string &client, int changed)
 
void addClients (const std::map< std::string, int > &clients)
 
bool hasClient (const std::string &client)
 
int getNumClients ()
 
const std::string & getName () const
 
const std::string & getLabel () const
 
const std::string & getHelp () const
 
std::string getPath () const
 
std::string getShortName () const
 
int getChanged (const std::string &client="") const
 
int getChangedValue () const
 
bool getNeverChanged () const
 
bool getVisible () const
 
bool getReadOnly () const
 
std::string getAttribute (const std::string &key) const
 
const std::map< std::string, std::string > & getAttributes () const
 
const std::map< std::string, int > & getClients () const
 
std::string sanitize (const std::string &in) const
 
std::string sanitizeJSON (const std::string &in) const
 

Private Attributes

std::vector< double > _values
 
std::vector< double > _choices
 
double _min
 
double _max
 
double _step
 
int _index
 
std::map< double, std::string > _valueLabels
 

Additional Inherited Members

- Static Public Member Functions inherited from onelab::parameter
static char charSep ()
 
static double maxNumber ()
 
static std::string version ()
 
static int defaultChangedValue ()
 
static std::string getNextToken (const std::string &msg, std::string::size_type &first, char separator=charSep())
 
static std::vector< std::string > split (const std::string &msg, char separator=charSep())
 
static std::string trim (const std::string &str, const std::string &whitespace=" \t\n")
 
static void getInfoFromChar (const std::string &msg, std::string &version, std::string &type, std::string &name)
 
static bool fromFile (std::vector< std::string > &msg, FILE *fp)
 
static bool toFile (const std::vector< std::string > &msg, FILE *fp, const std::string &creator)
 
- Protected Attributes inherited from onelab::parameter
std::map< std::string, std::string > _attributes
 

Detailed Description

Definition at line 432 of file onelab.h.

Constructor & Destructor Documentation

◆ number() [1/2]

onelab::number::number ( const std::string &  name = "",
double  value = 0.,
const std::string &  label = "",
const std::string &  help = "" 
)
inline

Definition at line 442 of file onelab.h.

◆ number() [2/2]

onelab::number::number ( const std::string &  name,
const std::vector< double > &  values,
const std::string &  label = "",
const std::string &  help = "" 
)
inline

Definition at line 448 of file onelab.h.

Member Function Documentation

◆ fromChar()

std::string::size_type onelab::number::fromChar ( const std::string &  msg)
inlinevirtual

Reimplemented from onelab::parameter.

Definition at line 553 of file onelab.h.

Referenced by onelab::parameterSpace::fromChar(), and onelab::client::fromChar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromJSON() [1/2]

bool onelab::number::fromJSON ( const picojson::value::object par)
inlinevirtual

Reimplemented from onelab::parameter.

Definition at line 623 of file onelab.h.

Here is the call graph for this function:

◆ fromJSON() [2/2]

bool onelab::number::fromJSON ( const std::string &  json)
inline

Definition at line 605 of file onelab.h.

Referenced by onelab::parameterSpace::fromJSON().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getChoices()

const std::vector<double>& onelab::number::getChoices ( ) const
inline

Definition at line 498 of file onelab.h.

Referenced by onelab::localClient::setAndAppendChoices(), and update().

Here is the caller graph for this function:

◆ getIndex()

int onelab::number::getIndex ( ) const
inline

Definition at line 497 of file onelab.h.

Referenced by update().

Here is the caller graph for this function:

◆ getMax()

double onelab::number::getMax ( ) const
inline

Definition at line 495 of file onelab.h.

Referenced by update().

Here is the caller graph for this function:

◆ getMin()

double onelab::number::getMin ( ) const
inline

Definition at line 494 of file onelab.h.

Referenced by update().

Here is the caller graph for this function:

◆ getNumValues()

int onelab::number::getNumValues ( ) const
inline

Definition at line 493 of file onelab.h.

◆ getStep()

double onelab::number::getStep ( ) const
inline

Definition at line 496 of file onelab.h.

Referenced by update().

Here is the caller graph for this function:

◆ getType()

std::string onelab::number::getType ( ) const
inlinevirtual

Implements onelab::parameter.

Definition at line 480 of file onelab.h.

◆ getValue()

double onelab::number::getValue ( ) const
inline

Definition at line 481 of file onelab.h.

Referenced by getValueAsString().

Here is the caller graph for this function:

◆ getValueAsString()

std::string onelab::number::getValueAsString ( ) const
inline

Definition at line 486 of file onelab.h.

Here is the call graph for this function:

◆ getValueLabel()

std::string onelab::number::getValueLabel ( double  value) const
inline

Definition at line 503 of file onelab.h.

◆ getValueLabels()

const std::map<double, std::string>& onelab::number::getValueLabels ( ) const
inline

Definition at line 499 of file onelab.h.

Referenced by update().

Here is the caller graph for this function:

◆ getValues()

const std::vector<double>& onelab::number::getValues ( ) const
inline

Definition at line 492 of file onelab.h.

Referenced by update().

Here is the caller graph for this function:

◆ setChoiceLabels()

void onelab::number::setChoiceLabels ( const std::vector< std::string > &  labels)
inline

Definition at line 465 of file onelab.h.

◆ setChoices()

void onelab::number::setChoices ( const std::vector< double > &  choices)
inline

Definition at line 464 of file onelab.h.

Referenced by onelab::localClient::setAndAppendChoices(), and update().

Here is the caller graph for this function:

◆ setIndex()

void onelab::number::setIndex ( int  index)
inline

Definition at line 463 of file onelab.h.

Referenced by fromChar(), fromJSON(), and update().

Here is the caller graph for this function:

◆ setMax()

void onelab::number::setMax ( double  max)
inline

Definition at line 461 of file onelab.h.

Referenced by fromChar(), fromJSON(), and update().

Here is the caller graph for this function:

◆ setMin()

void onelab::number::setMin ( double  min)
inline

Definition at line 460 of file onelab.h.

Referenced by fromChar(), fromJSON(), and update().

Here is the caller graph for this function:

◆ setStep()

void onelab::number::setStep ( double  step)
inline

Definition at line 462 of file onelab.h.

Referenced by fromChar(), fromJSON(), and update().

Here is the caller graph for this function:

◆ setValue()

void onelab::number::setValue ( double  value)
inline

Definition at line 454 of file onelab.h.

◆ setValueLabel()

void onelab::number::setValueLabel ( double  value,
const std::string &  label 
)
inline

Definition at line 476 of file onelab.h.

◆ setValueLabels()

void onelab::number::setValueLabels ( const std::map< double, std::string > &  valueLabels)
inline

Definition at line 472 of file onelab.h.

Referenced by update().

Here is the caller graph for this function:

◆ setValues()

void onelab::number::setValues ( const std::vector< double > &  values)
inline

Definition at line 459 of file onelab.h.

Referenced by update().

Here is the caller graph for this function:

◆ toChar()

std::string onelab::number::toChar ( ) const
inlinevirtual

Reimplemented from onelab::parameter.

Definition at line 536 of file onelab.h.

Here is the call graph for this function:

◆ toJSON()

std::string onelab::number::toJSON ( ) const
inlinevirtual

Reimplemented from onelab::parameter.

Definition at line 574 of file onelab.h.

Here is the call graph for this function:

◆ update()

void onelab::number::update ( const number p)
inline

Definition at line 509 of file onelab.h.

Here is the call graph for this function:

Member Data Documentation

◆ _choices

std::vector<double> onelab::number::_choices
private

Definition at line 434 of file onelab.h.

Referenced by fromChar(), fromJSON(), getChoices(), setChoiceLabels(), setChoices(), toChar(), and toJSON().

◆ _index

int onelab::number::_index
private

Definition at line 438 of file onelab.h.

Referenced by getIndex(), setIndex(), toChar(), and toJSON().

◆ _max

double onelab::number::_max
private

Definition at line 435 of file onelab.h.

Referenced by getMax(), setMax(), toChar(), and toJSON().

◆ _min

double onelab::number::_min
private

Definition at line 435 of file onelab.h.

Referenced by getMin(), setMin(), toChar(), and toJSON().

◆ _step

double onelab::number::_step
private

Definition at line 435 of file onelab.h.

Referenced by getStep(), setStep(), toChar(), and toJSON().

◆ _valueLabels

std::map<double, std::string> onelab::number::_valueLabels
private

◆ _values

std::vector<double> onelab::number::_values
private

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