LILAC
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Private Attributes | List of all members
variable Class Reference

stores a real number that is varied during the simulation More...

#include <variable.h>

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

Public Member Functions

virtual void print () const
virtual void _retrieve (retrieve_wrapper &&inval, item *caller)
virtual void add_ref (double &in, std::shared_ptr< item > inval)
virtual void add_ref (double &in, item *inval)
virtual void copy (double *inval)
virtual void parse (const std::string &inval)
virtual std::string type () const
virtual void inc ()
 cover funtion for variable
void inc (double i)
void set (double v)

Public Attributes

double low_bound
double high_bound
double inc_size

Private Attributes

std::map< item *, std::set
< double * > > 
modifiers
std::map< std::weak_ptr< item >
, std::set< double * >
, std::owner_less
< std::weak_ptr< item > > > 
safe_mods

Additional Inherited Members

- Static Public Member Functions inherited from item
static std::shared_ptr< itemcreate (std::string name, engineimp *rval)
- Protected Attributes inherited from native_tmpl< T, act_name >
value

Detailed Description

stores a real number that is varied during the simulation

This class stores a real number that is allowed to vary during the simulation It stores all of the values that are linked to it and updates them upon the change A method of setting a variable that does not involve linking the memory is also implemented This function does not re-implement type, as for the purposes of dependencies it is a real If one must check for being an instance of variable, the check dynamic_cast operator must be used

currently, all values are set to ge between 0 and 2*pi. Again, this is just to satisfy the CNLS situation and have a function search. The engine uses the real parser and sets the initial value to zero As the engine framework is further built, the incrementing/decrementing interface will be generalized to be useful for general pruposes, not simply plain toroidal searches

See Also
real

Definition at line 35 of file variable.h.

Member Function Documentation

void variable::_retrieve ( retrieve_wrapper &&  inval,
item caller 
)
virtual

This function assigns the real value stored to the value pointed at by inval. It also keeps track of the pointer and updates it whenever the variable has changed. Passing a null pointer will result in the variable not receiving updates

Reimplemented from native_tmpl< T, act_name >.

Definition at line 34 of file variable.cpp.

Here is the call graph for this function:

void variable::add_ref ( double &  in,
std::shared_ptr< item inval 
)
virtual

Definition at line 42 of file variable.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void variable::add_ref ( double &  in,
item inval 
)
virtual

Definition at line 57 of file variable.cpp.

Here is the call graph for this function:

void variable::copy ( double *  inval)
virtual

This function copies the value without linking it to the actual variable

Parameters
invalThe pointer to the double that is updated

Definition at line 146 of file variable.cpp.

void variable::inc ( )
virtual

cover funtion for variable

Definition at line 138 of file variable.cpp.

void variable::inc ( double  i)

Definition at line 134 of file variable.cpp.

void variable::parse ( const std::string inval)
virtual

Reimplemented from native_tmpl< T, act_name >.

Definition at line 150 of file variable.cpp.

void variable::print ( ) const
virtual

This function prints the value of the current variable

Reimplemented from item.

Definition at line 24 of file variable.cpp.

Here is the call graph for this function:

void variable::set ( double  p)

This function increments the variable, and updates the relevant classes

Definition at line 86 of file variable.cpp.

Here is the call graph for this function:

std::string variable::type ( ) const
virtual

Reimplemented from native_tmpl< T, act_name >.

Definition at line 157 of file variable.cpp.

Member Data Documentation

double variable::high_bound

Definition at line 45 of file variable.h.

double variable::inc_size

Definition at line 45 of file variable.h.

double variable::low_bound

Definition at line 45 of file variable.h.

std::map<item*, std::set<double*> > variable::modifiers
private

Definition at line 37 of file variable.h.

std::map<std::weak_ptr<item>, std::set<double*>, std::owner_less<std::weak_ptr<item> > > variable::safe_mods
private

Definition at line 42 of file variable.h.


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