FemtoScan Online SDK Documentation
extends FSAllocator as public
Performs variables approximation, evaluation, validation, dependencies validation.
- Source:
- ../fmutl/SPMVarList.h:63
- Author:
- ATC
- Version:
- 1.0
destructor ~SPMVarList | ? ^
> |
Standart destructor.
- Source:
- ../fmutl/SPMVarList.h:99
- Code:
-
constructor SPMVarList | ? ^
< > |
Default constructor.
- Source:
- ../fmutl/SPMVarList.h:94
- Code:
-
constructor SPMVarList | ? ^
< > |
automatically generated
- Source:
- ../fmutl/SPMVarList.h
- Code:
public SPMVarList ( | const SPMVarList & ) |
method AddFireVariableChangeHandler | ? ^
< > |
Add variable "fire change" handler.
Handler will be added to the internal list, so it will be called whenever
any variable changes it's value.
- Source:
- ../fmutl/SPMVarList.h:163
- Param:
phndlr
| pointer to the object to be called
|
- See Also:
- SPMVarListHandler
- Code:
-
method AddUpdateVariableHandler | ? ^
< > |
Add variable interface handler.
Handler will be added to the internal list, so it will be called whenever
any variable need to update it's display.
- Source:
- ../fmutl/SPMVarList.h:129
- Param:
phndlr
| pointer to the object to be called
|
- See Also:
- SPMVarListInterface
- Code:
-
method approximate_strval | ? ^
< > |
Approximate variable's value according to it's display formula.
- Source:
- ../fmutl/SPMVarList.h:364
- Params:
strval
| the value to which we should approximate. String will be scanned
by strtod and strtol functions, and the best result will be taken for approximation.
|
var
| copy of one of the list's variables, or variable itself. On return it's
value would be updated so that
evaluate_var will return the value
closest to the initial strval.
|
- Returns:
- double result of approximation.
- See Also:
- approximate_val
- Code:
public FMUTL_API double approximate_strval ( | const char * strval , |
| SPMVar & var ) const |
method approximate_val | ? ^
< > |
Approximate variable's value according to it's display formula.
- Source:
- ../fmutl/SPMVarList.h:352
- Params:
val
| the value to which we should approximate. On return it would be set
to the nearest possible value.
|
var
| copy of one of the list's variables, or variable itself. On return it's
value would be updated so that
evaluate_var will return the value
closest to the initial val.
|
- Code:
public FMUTL_API void approximate_val ( | double & val , |
| SPMVar & var ) const |
method call_interface | ? ^
< > |
Call variable's interface function (if any).
After interface was called, variable will be set to the new value,
returned by the interface function. Interface is called by substituting the 'interface'
word with 'call_function' word and calling
fmutl::eval_expression function.
The result returned is used as argument for
SPMVar::from_string function
for the var.
- Source:
- ../fmutl/SPMVarList.h:342
- Param:
var
| copy of one of the list's variables, or variable itself.
|
- See Also:
- eval_expression
- Code:
-
method ChangeVariable | ? ^
< > |
Change variable.
Change list variable. If new value differs from current value,
variable will be validated, then it's display
and dependencies shall be automaticaly updated. After that, variable change
event will be fired.
- Source:
- ../fmutl/SPMVarList.h:147
- See Also:
- AddUpdateVariableHandler, AddFireVariableChangeHandler
- Code:
-
Empty variable list.
- Source:
- ../fmutl/SPMVarList.h:278
- Code:
-
method evaluate_var | ? ^
< > |
Evaluate variable's value according to it's display formula.
- Source:
- ../fmutl/SPMVarList.h:330
- Param:
var
| copy of one of the list's variables, or variable itself.
|
- Returns:
- evaluated value.
- Code:
-
method FireVariableChange | ? ^
< > |
Notify user that variable's value have changed.
Iterates through variable's "fire change" handlers.
- Source:
- ../fmutl/SPMVarList.h:177
- See Also:
- AddFireVariableChangeHandler
- Code:
public FMUTL_API void FireVariableChange ( | int iVar ) |
method fire_variable_change | ? ^
< > |
Notify user that variable's value have changed.
This function searches for variable with given id, and
if found, calls
FireVariableChange .
- Source:
- ../fmutl/SPMVarList.h:410
- Param:
id
| id of changed variable.
|
- See Also:
- FireVariableChange
- Code:
public FMUTL_API void fire_variable_change ( | const char * id ) |
method get_display_type | ? ^
< > |
Get type of variable.
- Source:
- ../fmutl/SPMVarList.h:272
- Param:
i
| variable's ordinal number.
|
- Returns:
- one of
SPMVarType values.
- Code:
-
Get number of variables in the list.
- Source:
- ../fmutl/SPMVarList.h:191
- Returns:
- number of variables in the list.
- Code:
-
Get reference to the variable.
- Source:
- ../fmutl/SPMVarList.h:200
- Param:
i
| variable's ordinal number. Should be from 0
to
get_size - 1. If i is equal to -1, reference to the null
variable returned.
|
- Returns:
- reference to the variable.
- Code:
-
Get reference to the variable.
- Source:
- ../fmutl/SPMVarList.h:208
- Param:
id
| variable's id. If no variable with such id exists, reference to the null
variable returned.
|
- Returns:
- reference to the variable.
- Code:
-
method get_variables | ? ^
< > |
Get variable list.
- Source:
- ../fmutl/SPMVarList.h:303
- Params:
variables
| variables array.
|
size
| number of variables in the array.
|
- Returns:
- if variables !=0 and size!=0, number of actually copied variables.
Otherwise, the required size of variables array returned (same as
by
get_size .
- Code:
-
Get variable ordinal number.
- Source:
- ../fmutl/SPMVarList.h:214
- See Also:
- get_var
- Code:
public FMUTL_API size_t get_var_i ( | const char * id ) const |
method has_interface | ? ^
< > |
Check if variable has user-defined interface function.
Variable has an interface if it's display string begins with 'interface' word.
- Source:
- ../fmutl/SPMVarList.h:249
- Param:
i
| variable's ordinal number.
|
- Returns:
- true if variable is a filter.
- See Also:
- call_interface
- Code:
public FMUTL_API bool has_interface ( | size_t i ) const |
Check if variable is a filter.
Variable is a filter if it has spmvtEnum type, and at least one
variable in the list has enum string value as a part of it's id.
Checks for string inclusion are performed with
contains_word function.
- Source:
- ../fmutl/SPMVarList.h:240
- Param:
i
| variable's ordinal number.
|
- Returns:
- true if variable is a filter.
- See Also:
- SPMVarType, SPMVar::enum_filter
- Code:
public FMUTL_API bool is_filter ( | size_t i ) const |
method is_filtered_out | ? ^
< > |
Check if variable is filtered out.
Variable can be filtered out if:
- There is a filter variable, which has
one of it's enum string values as a part of this variable's id.
- That variable's current value is not a part of this variable's id.
Checks for string inclusion are performed with
contains_word function.
- Source:
- ../fmutl/SPMVarList.h:265
- Param:
i
| variable's ordinal number.
|
- Returns:
- true if variable is filtered out.
- See Also:
- is_filter, SPMVar::enum_filter
- Code:
public FMUTL_API bool is_filtered_out ( | size_t i ) const |
Load list from array of string pairs.
- Source:
- ../fmutl/SPMVarList.h:120
- Code:
-
automatically generated
- Source:
- ../fmutl/SPMVarList.h
- Code:
public SPMVarList & operator = ( | const SPMVarList & ) |
Get variable by it's id.
This operator allows quickly obtain reference to variable.
- Source:
- ../fmutl/SPMVarList.h:401
- Param:
- Returns:
- reference to found variable. If no such variable exists, null variable returned.
- Code:
public FMUTL_API const SPMVar & operator [] ( | const std::string & key ) const |
struct opt_list_item | ? ^
< > |
Structure used in #LoadOptions function
- Source:
- ../fmutl/SPMVarList.h:104
- Code:
- public struct opt_list_item
method RemoveFireVariableChangeHandler | ? ^
< > |
Remove variable "fire change" handler.
Remove handler from the the internal list.
- Source:
- ../fmutl/SPMVarList.h:170
- See Also:
- AddFireVariableChangeHandler
- Code:
-
method RemoveUpdateVariableHandler | ? ^
< > |
Remove variable interface handler.
Remove handler from the the internal list.
- Source:
- ../fmutl/SPMVarList.h:136
- See Also:
- AddUpdateVariableHandler
- Code:
-
method reset_timestamps | ? ^
< > |
Reset timestamps.
Reset all timestamps to 0.
- Source:
- ../fmutl/SPMVarList.h:183
- Code:
-
Change variable.
- Source:
- ../fmutl/SPMVarList.h:220
- Param:
var
| new value for variable
|
- Code:
-
Change variable.
- Source:
- ../fmutl/SPMVarList.h:227
- Params:
id
| variable's id.
|
val
| new value for variable. @link SPMVar::from_string @endlink will be called with this parameter.
|
- Code:
public FMUTL_API void set_var ( | const char * id , |
| const char * val ) |
method set_variables | ? ^
< > |
Set variables list.
Variable's options will be scanned for display string and validate string.
All remaining data will be assigned back to the options. If user wants
to implement more functionality, he should override this function and call
original version in the beginning of the new one.
Display and validation strings are extracted with
next_token function, and should be delimited with commas (',').
- Source:
- ../fmutl/SPMVarList.h:293
- Params:
variables
| variables array.
|
size
| number of variables in the array.
|
- See Also:
- SPMVar::get_options, SPMVar::set_options
- Code:
public FMUTL_API virtual void set_variables ( | const SPMVar * variables , |
| size_t size ) |
Substitute variables.
All variables designated by delimiter will be substituted by their values from the list.
I.e., if delimiter is '#', all strings of form # will be replaced by that variable's
double value as returned by
SPMVar::operator double .
- Source:
- ../fmutl/SPMVarList.h:393
- Params:
s
| string to process.
|
vardelim
| variable delimiter.
|
self
| variable for self-substitution (marked by two consequtive delimiters)
|
- Code:
public FMUTL_API void subst_vars ( | std::string & s , |
| char vardelim , |
| const SPMVar * self ) const |
method UpdateVariable | ? ^
< > |
Update variable's display.
Iterates through variable's update handlers.
- Source:
- ../fmutl/SPMVarList.h:154
- See Also:
- AddUpdateVariableHandler
- Code:
public FMUTL_API void UpdateVariable ( | int iVar ) |
method update_display_dependencies | ? ^
< > |
Update display-dependent variables.
Function scans through the list of variables who's display formula is dependent
on this variable and updates them by
calling
UpdateVariable function.
- Source:
- ../fmutl/SPMVarList.h:312
- Param:
id
| identificator of updated variable.
|
- Code:
public FMUTL_API void update_display_dependencies ( | const char * id ) |
method update_validation_dependencies | ? ^
< > |
Update validation-dependent variables.
Function scans through the list of of variables who's validation formula is dependent
on this variable and updates them by
calling
UpdateVariable and
FireVariableChange functions,
if needed.
- Source:
- ../fmutl/SPMVarList.h:322
- Param:
id
| identificator of updated variable.
|
- Code:
public FMUTL_API void update_validation_dependencies ( | const char * id ) |
method update_variable | ? ^
< > |
Update variable's display.
This function searches for variable with given id, and
if found, calls
UpdateVariable .
- Source:
- ../fmutl/SPMVarList.h:419
- Param:
id
| id of changed variable.
|
- See Also:
- UpdateVariable
- Code:
public FMUTL_API void update_variable ( | const char * id ) |
method validate_var | ? ^
< > |
Validate variable's value.
- Source:
- ../fmutl/SPMVarList.h:373
- Param:
var
| variable to validate. This should be a copy of the one of the lists's
variables, or variable itself. If variable's value was changed as the result of validation,
then dependent variables will be updated.
|
- Returns:
- true if variable's value has been chaged.
- Code:
-
method validate_var_no_dep | ? ^
< > |
Validate variable's value.
- Source:
- ../fmutl/SPMVarList.h:382
- Param:
var
| variable to validate. This should be a copy of the one of the lists's
variables, or variable itself. No dependent variables will be updated, neither no any handlers
will be called.
|
- Returns:
- true if variable's value has been chaged.
- Code:
-
(C) Advanced Technologies Center, 2002-2006
For support contact us at fsdev@nanoscopy.net