DataSet Class Reference

A data set. More...

#include <DataSet.h>

Inheritance diagram for DataSet:

MathFunction ExpressionItem

List of all members.

Public Member Functions

 DataSet (string s_category="", string s_name="", string s_default_file="", string s_title="", string s_description="", bool is_local=true)
 DataSet (const DataSet *o)
ExpressionItemcopy () const
void set (const ExpressionItem *item)
int subtype () const
void setCopyright (string s_copyright)
const string & copyright () const
void setDefaultDataFile (string s_file)
const string & defaultDataFile () const
void setDefaultProperty (string property)
const string & defaultProperty () const
virtual int calculate (MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)
bool loadObjects (const char *file_name=NULL, bool is_user_defs=true)
int saveObjects (const char *file_name=NULL, bool save_global=false)
bool objectsLoaded () const
void setObjectsLoaded (bool objects_loaded)
void addProperty (DataProperty *dp)
void delProperty (DataProperty *dp)
void delProperty (DataPropertyIter *it)
DataPropertygetPrimaryKeyProperty ()
DataPropertygetProperty (string property)
DataPropertygetFirstProperty (DataPropertyIter *it)
DataPropertygetNextProperty (DataPropertyIter *it)
const string & getFirstPropertyName (DataPropertyIter *it)
const string & getNextPropertyName (DataPropertyIter *it)
void addObject (DataObject *o)
void delObject (DataObject *o)
void delObject (DataObjectIter *it)
DataObjectgetObject (string object)
DataObjectgetObject (const MathStructure &object)
DataObjectgetFirstObject (DataObjectIter *it)
DataObjectgetNextObject (DataObjectIter *it)
const MathStructuregetObjectProperyStruct (string property, string object)
const string & getObjectProperty (string property, string object)
string getObjectPropertyInputString (string property, string object)
string getObjectPropertyDisplayString (string property, string object)
string printProperties (string object)
string printProperties (DataObject *o)

Protected Attributes

string sfile
string scopyright
bool b_loaded
vector< DataProperty * > properties
vector< DataObject * > objects


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.


Member Function Documentation

int DataSet::subtype (  )  const [virtual]

Returns the subtype of the mathematical function, corresponding to which subsubclass the object belongs to.

Returns:
FunctionSubtype.

Reimplemented from MathFunction.

virtual int DataSet::calculate ( MathStructure mstruct,
const MathStructure vargs,
const EvaluationOptions eo 
) [virtual]

The main function for subclasses to reimplement. Calculates a value from arguments in vargs and puts it in mstruct.

This function expects the number of arguments to be equal to the maximum number of arguments, and checked by the argument definitions.

If the return value is negative, then argument -(return value) has been evaluated in mstruct. If -(return value) is greater than max arguments, then mstruct is a vector of evaluated argument values.

Parameters:
[out] mstruct Structure that is set with the result of the calculation.
vargs Arguments passed to the mathematical function.
eo Evaluation options.
Returns:
1 if the calculation was successful.

Reimplemented from MathFunction.


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

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5