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

DataSet Class Reference

#include <DataSet.h>

Inheritance diagram for DataSet:

MathFunction ExpressionItem

List of all members.

Detailed Description

A data set.

This is a simple database class for storage of many grouped values, when ordinary variables is not practical.

A data set consists of properties and objects, with values for the properties. Qalculate! includes for example a "Planets" data set with properties such as name, mass, speed and density, and an object for each planet in solar system.

A data set is also mathemtical function, dataset(object, property), which retrieves values for objects and properties. Data sets can be saved and loaded from a XML file.

Definition at line 197 of file DataSet.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)
void addObject (DataObject *o)
void addProperty (DataProperty *dp)
void appendDefaultValues (MathStructure &vargs)
int args (const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)
int args () const
virtual MathStructure calculate (MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options)
virtual MathStructure calculate (const string &eq, const EvaluationOptions &eo=default_evaluation_options)
int calculate (MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)
virtual const string & category () const
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
void clearArgumentDefinitions ()
virtual void clearNames ()
virtual void clearNonReferenceNames ()
string condition () const
ExpressionItemcopy () const
const string & copyright () const
virtual size_t countNames () const
 DataSet (const DataSet *o)
 DataSet (string s_category="", string s_name="", string s_default_file="", string s_title="", string s_description="", bool is_local=true)
const string & defaultDataFile () const
const string & defaultProperty () const
void delObject (DataObjectIter *it)
void delObject (DataObject *o)
void delProperty (DataPropertyIter *it)
void delProperty (DataProperty *dp)
virtual const string & description () const
virtual bool destroy ()
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
ArgumentgetArgumentDefinition (size_t index)
const string & getDefaultValue (size_t arg_) const
DataObjectgetFirstObject (DataObjectIter *it)
DataPropertygetFirstProperty (DataPropertyIter *it)
const string & getFirstPropertyName (DataPropertyIter *it)
virtual const ExpressionNamegetName (size_t index) const
DataObjectgetNextObject (DataObjectIter *it)
DataPropertygetNextProperty (DataPropertyIter *it)
const string & getNextPropertyName (DataPropertyIter *it)
DataObjectgetObject (const MathStructure &object)
DataObjectgetObject (string object)
const string & getObjectProperty (string property, string object)
string getObjectPropertyDisplayString (string property, string object)
string getObjectPropertyInputString (string property, string object)
const MathStructuregetObjectProperyStruct (string property, string object)
DataPropertygetPrimaryKeyProperty ()
DataPropertygetProperty (string property)
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 isHidden () const
virtual bool isLocal () const
bool isRegistered () const
size_t lastArgumentDefinitionIndex () const
bool loadObjects (const char *file_name=NULL, bool is_user_defs=true)
int maxargs () const
int minargs () const
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
bool objectsLoaded () const
virtual int parse (MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options)
virtual MathStructure parse (const string &eq, const ParseOptions &po=default_parse_options)
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
string printCondition ()
string printProperties (DataObject *o)
string printProperties (string object)
MathStructure produceArgumentsVector (const MathStructure &vargs, int begin=-1, int end=-1)
MathStructure produceVector (const MathStructure &vargs, int begin=-1, int end=-1)
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 (const MathStructure &) const
virtual bool representsComplex (const MathStructure &, bool=false) const
virtual bool representsEven (const MathStructure &, bool=false) const
virtual bool representsInteger (const MathStructure &, bool=false) const
virtual bool representsNegative (const MathStructure &, bool=false) const
virtual bool representsNonMatrix (const MathStructure &) const
virtual bool representsNonNegative (const MathStructure &, bool=false) const
virtual bool representsNonPositive (const MathStructure &, bool=false) const
virtual bool representsNonZero (const MathStructure &, bool=false) const
virtual bool representsNumber (const MathStructure &, bool=false) const
virtual bool representsOdd (const MathStructure &, bool=false) const
virtual bool representsPositive (const MathStructure &, bool=false) const
virtual bool representsRational (const MathStructure &, bool=false) const
virtual bool representsReal (const MathStructure &, bool=false) const
virtual bool representsUndefined (const MathStructure &) const
int saveObjects (const char *file_name=NULL, bool save_global=false)
void set (const ExpressionItem *item)
virtual void setActive (bool is_active)
virtual void setApproximate (bool is_approx=true)
void setArgumentDefinition (size_t index, Argument *argdef)
virtual void setCategory (string cat_)
virtual void setChanged (bool has_changed)
void setCondition (string expression)
void setCopyright (string s_copyright)
void setDefaultDataFile (string s_file)
void setDefaultProperty (string property)
void setDefaultValue (size_t arg_, string value_)
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)
void setObjectsLoaded (bool objects_loaded)
virtual void setPrecision (int prec)
void setRegistered (bool is_registered)
 For internal use.
virtual void setTitle (string title_)
int stringArgs (const string &str, vector< string > &svargs)
int subtype () const
bool testArgumentCount (int itmp)
bool testCondition (const MathStructure &vargs)
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 Member Functions

virtual MathStructure createFunctionMathStructureFromSVArgs (vector< string > &svargs)
virtual MathStructure createFunctionMathStructureFromVArgs (const MathStructure &vargs)
bool testArguments (MathStructure &vargs)

Protected Attributes

int argc
Sgi::hash_map< size_t, Argument * > argdefs
bool b_active
bool b_approx
bool b_builtin
bool b_changed
bool b_destroyed
bool b_hidden
bool b_loaded
bool b_local
bool b_registered
vector< string > default_values
int i_precision
int i_ref
size_t last_argdef_index
int max_argc
vector< ExpressionNamenames
vector< DataObject * > objects
vector< DataProperty * > properties
string scat
string scondition
string scopyright
string sdescr
string sfile
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