Logo Search packages:      
Sourcecode: libqalculate version File versions  Download package

KnownVariable Class Reference

#include <Variable.h>

Inheritance diagram for KnownVariable:

Variable ExpressionItem DynamicVariable

List of all members.


Detailed Description

A variable with a known value.

Known variables have an associated value. The value can be a simple number or a full mathematical expression. The known variable class is used both for variable values and constants.

The value can be provided as an expression in the form of a text string or as a mathematical value in the form of an object of the MathStructure class. The text string is parsed when needed, which saves time when loading many variable definitions which might not be used, at least not immediately.

Definition at line 229 of file Variable.h.


Public Member Functions

virtual void addName (string sname, size_t index=0, bool force=true)
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
virtual const string & category () const
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
virtual void clearNames ()
virtual void clearNonReferenceNames ()
virtual ExpressionItemcopy () const
virtual size_t countNames () const
virtual const string & description () const
virtual bool destroy ()
virtual string expression () const
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const MathStructureget ()
virtual const ExpressionNamegetName (size_t index) const
virtual ExpressionItemgetReferencer (size_t index=1) const
virtual bool hasChanged () const
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
virtual size_t hasNameCaseSensitive (const string &sname) const
virtual bool isActive () const
virtual bool isApproximate () const
virtual bool isBuiltin () const
virtual bool isExpression () const
virtual bool isHidden () const
bool isKnown () const
virtual bool isLocal () const
bool isRegistered () const
 KnownVariable (const KnownVariable *variable)
 KnownVariable ()
 KnownVariable (string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 KnownVariable (string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual int precision () const
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual void ref (ExpressionItem *o)
virtual void ref ()
virtual int refcount () const
virtual const string & referenceName () const
virtual void removeName (size_t index)
virtual bool representsBoolean ()
virtual bool representsComplex (bool=false)
virtual bool representsEven (bool=false)
virtual bool representsInteger (bool=false)
virtual bool representsNegative (bool=false)
virtual bool representsNonMatrix ()
virtual bool representsNonNegative (bool=false)
virtual bool representsNonPositive (bool=false)
virtual bool representsNonZero (bool=false)
virtual bool representsNumber (bool=false)
virtual bool representsOdd (bool=false)
virtual bool representsPositive (bool=false)
virtual bool representsRational (bool=false)
virtual bool representsReal (bool=false)
virtual bool representsUndefined (bool=false, bool=false, bool=false)
virtual void set (string expression_)
virtual void set (const MathStructure &o)
virtual void set (const ExpressionItem *item)
virtual void setActive (bool is_active)
virtual void setApproximate (bool is_approx=true)
virtual void setCategory (string cat_)
virtual void setChanged (bool has_changed)
virtual void setDescription (string descr_)
virtual void setHidden (bool is_hidden)
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
virtual void setName (string sname, size_t index, bool force=true)
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
virtual void setPrecision (int prec)
void setRegistered (bool is_registered)
 For internal use.
virtual void setTitle (string title_)
int subtype () const
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual int type () const
virtual void unref (ExpressionItem *o)
virtual void unref ()

Protected Attributes

bool b_active
bool b_approx
bool b_builtin
bool b_changed
bool b_destroyed
bool b_expression
bool b_hidden
bool b_local
bool b_registered
int calculated_precision
int i_precision
int i_ref
MathStructuremstruct
vector< ExpressionNamenames
string scat
string sdescr
string sexpression
string stitle
vector< ExpressionItem * > v_refs

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

Generated by  Doxygen 1.6.0   Back to index