ODIN
|
#include <ldrblock.h>
Public Member Functions | |
LDRblock (const STD_string &title="Parameter List") | |
LDRblock (const LDRblock &block) | |
~LDRblock () | |
LDRblock & | operator= (const LDRblock &block) |
LDRblock & | merge (LDRblock &block, bool onlyUserPars=true) |
LDRblock & | unmerge (LDRblock &block) |
STD_string | printval (const STD_string ¶meterName, bool append_unit=false) const |
bool | parseval (const STD_string ¶meterName, const STD_string &value) |
int | parseblock (const STD_string &source, const LDRserBase &serializer=LDRserJDX()) |
unsigned int | numof_pars () const |
LDRbase * | get_parameter (const STD_string &ldrlabel) |
bool | parameter_exists (const STD_string &ldrlabel) const |
LDRblock & | set_prefix (const STD_string &prefix) |
LDRblock & | set_embedded (bool embedded) |
bool | is_embedded () const |
LDRbase & | operator[] (unsigned int i) |
const LDRbase & | operator[] (unsigned int i) const |
LDRbase & | get_parameter_by_id (int id) |
LDRblock & | create_copy (const LDRblock &src) |
LDRblock & | append_copy (const LDRbase &src) |
LDRblock & | copy_ldr_vals (const LDRblock &src) |
bool | operator== (const LDRblock &rhs) const |
bool | operator< (const LDRblock &rhs) const |
bool | compare (const LDRblock &rhs, const STD_list< STD_string > *exclude=0, double accuracy=0.0) const |
STD_string | print (const LDRserBase &serializer=LDRserJDX()) const |
LDRbase & | set_parmode (parameterMode parameter_mode) |
LDRbase & | set_filemode (fileMode file_mode) |
STD_string | get_parx_code (parxCodeType type) const |
STD_ostream & | print2stream (STD_ostream &os, const LDRserBase &serializer) const |
bool | parsevalstring (const STD_string &, const LDRserBase *ser=0) |
bool | parse (STD_string &parstring, const LDRserBase &serializer) |
STD_string | printvalstring (const LDRserBase *ser=0) const |
LDRbase * | create_copy () const |
STD_string | get_typeInfo (bool parx_equivtype=false) const |
int | load (const STD_string &filename, const LDRserBase &serializer=LDRserJDX()) |
int | write (const STD_string &filename, const LDRserBase &serializer=LDRserJDX()) const |
Public Member Functions inherited from LDRbase | |
virtual double | get_minval () const |
virtual double | get_maxval () const |
bool | has_minmax () const |
const STD_string & | get_description () const |
LDRbase & | set_description (const STD_string &descr) |
virtual svector | get_alternatives () const |
const STD_string & | get_unit () const |
LDRbase & | set_unit (const STD_string &un) |
virtual parameterMode | get_parmode () const |
virtual fileMode | get_filemode () const |
virtual GuiProps | get_gui_props () const |
virtual LDRbase & | set_gui_props (const GuiProps &) |
JcampDxProps | get_jdx_props () const |
LDRbase & | set_jdx_props (const JcampDxProps &jp) |
Public Member Functions inherited from Labeled | |
Labeled (const STD_string &label="unnamed") | |
Labeled & | set_label (const STD_string &label) |
const STD_string & | get_label () const |
Labeled & | operator= (const Labeled &l) |
Public Member Functions inherited from List< I, P, R > | |
List () | |
~List () | |
List & | operator= (const List &l) |
List & | clear () |
List & | append (R item) |
List & | remove (R item) |
unsigned int | size () const |
iter | get_begin () |
iter | get_end () |
constiter | get_const_begin () const |
constiter | get_const_end () const |
Protected Member Functions | |
LDRblock & | append_member (LDRbase &ldr, const STD_string ldrlabel="") |
Friends | |
class | LDRwidget |
Additional Inherited Members | |
Public Types inherited from List< I, P, R > | |
typedef STD_list< P >::iterator | iter |
typedef STD_list< P >::const_iterator | constiter |
This class represents a block of parameters. Parameters can be added or removed from the list of parameters within the block. The whole block may be written to or read from a file.
Definition at line 42 of file ldrblock.h.
LDRblock::LDRblock | ( | const STD_string & | title = "Parameter List" | ) |
Constructs an empty block of parameters with the label 'title'
LDRblock::LDRblock | ( | const LDRblock & | block | ) |
Copy constructor
LDRblock::~LDRblock | ( | ) |
Destructor
Appends a deep copy of src (not a reference). This copy will be deleted automatically upon destruction.
Use this functions to append members of derived classes
bool LDRblock::compare | ( | const LDRblock & | rhs, |
const STD_list< STD_string > * | exclude = 0 , |
||
double | accuracy = 0.0 |
||
) | const |
Equivalent to operator <. In addition, a list of parameters can be given in 'exclude' which are excluded from the comparison. When comparing float or double numbers, parametrs are considered equal if they differe by no more than the given 'accuracy'.
Copy parameter values from 'src' to the equivalent parameters in this block
|
inlinevirtual |
Makes this become a copy of 'src', including its parameters by creating temporary objects. These temporary objects will be deleted automatically upon destruction.
LDRbase* LDRblock::get_parameter | ( | const STD_string & | ldrlabel | ) |
Returns a pointer to parameter 'label', or zero if not found
LDRbase& LDRblock::get_parameter_by_id | ( | int | id | ) |
Returns the first parameter in the block with the given 'id'
|
virtual |
Returns C code that can be used together with the PARX(Bruker) compiler
Reimplemented from LDRbase.
|
inlinevirtual |
Returns a string describing the type of the parameter. If 'parx_equivtype' is 'true', returns the equivalent PARX parameter type
Implements LDRbase.
Definition at line 234 of file ldrblock.h.
|
inline |
Returns whether the block's widget will be displayed in a subwidget or an 'Edit' button that will open a subdialog is generated
Definition at line 147 of file ldrblock.h.
|
virtual |
Loads the parameter(s) from a file using format 'serializer'. In case of calling this function of a single paramter, the file is searched for this parameter and the value is assigned. In case of a parameter block, all parameter values are taken from the file. The return value is the number of parameters which are successfully parsed. If an error occurs, -1 is returned.
Reimplemented from LDRbase.
Merges all parameters found in the specified 'block' into this block
unsigned int LDRblock::numof_pars | ( | ) | const |
Returns the current number of parameters in the block
|
inline |
Comparison operator which
Definition at line 201 of file ldrblock.h.
|
inline |
Compares 'rhs' with 'this' with respect to whether all parameters with the same label mutually exist in the other block and whether these parameters have the same type, label and value.
Definition at line 191 of file ldrblock.h.
LDRbase& LDRblock::operator[] | ( | unsigned int | i | ) |
Returns the i'th parameter in the block
const LDRbase& LDRblock::operator[] | ( | unsigned int | i | ) | const |
Returns the const i'th parameter in the block
bool LDRblock::parameter_exists | ( | const STD_string & | ldrlabel | ) | const |
Returns true if a parameter with the given label already exists in the block
|
virtual |
Parses the parameter using format 'serializer'. For blocks, a re-implemented 'parse' function is called. Returns 'true' if the parameter was parsed successfully.
Reimplemented from LDRbase.
int LDRblock::parseblock | ( | const STD_string & | source, |
const LDRserBase & | serializer = LDRserJDX() |
||
) |
Parse values of this block from the string 'src' using format 'serializer', returns the number of parameters successfully parsed.
bool LDRblock::parseval | ( | const STD_string & | parameterName, |
const STD_string & | value | ||
) |
Set the value of the parameter that has the label 'parameterName' to 'value'. Returns 'true' if sucessful.
|
inlinevirtual |
Parses and assigns the value in the given string, optionally using format 'ser'
Implements LDRbase.
Definition at line 230 of file ldrblock.h.
|
virtual |
This function returns the parameter in ASCII using format 'serializer'
Reimplemented from LDRbase.
|
virtual |
Passes the parameter in ASCII format to the ostream 'os' using format 'serializer'
Reimplemented from LDRbase.
STD_string LDRblock::printval | ( | const STD_string & | parameterName, |
bool | append_unit = false |
||
) | const |
Print the value of the parameter that has the label 'parameterName' as a formated string. If applicable, append the unit of the number in case 'append_unit' is set to 'true'.
|
inlinevirtual |
Returns the value of the parameter as a string, optionally using format 'ser'
Implements LDRbase.
Definition at line 232 of file ldrblock.h.
|
inline |
If embedded is true, the block's widget will be displayed in a subwidget otherwise an 'Edit' button that will open a subdialog is generated
Definition at line 140 of file ldrblock.h.
Sets the fileMode
Reimplemented from LDRbase.
|
virtual |
Sets the parameterMode
Reimplemented from LDRbase.
LDRblock& LDRblock::set_prefix | ( | const STD_string & | prefix | ) |
Prefixes all parameters labels with the given string. If the prefix is already at the beginning of the label, it is not added again.
Removes all parameters found in the specified 'block' from this block
|
virtual |
Writes the parameter(s) to file using format 'serializer'. In case of calling this function of a single paramter, the file will consist of only this parameter. In case of a parameter block, all parameter values are written to the file. If an error occurs, -1 is returned.
Reimplemented from LDRbase.