Source: kalamaris/parameter.h
|
|
|
|
/* parameter.h -
This file is part of Kalamaris
Copyright (C) 2000 Antonio Larrosa Jimenez
Kalamaris' homepage : http://www.arrakis.es/~rlarrosa/kalamaris.html
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Send comments and bug fixes to Antonio Larrosa <larrosa@kde.org>
***************************************************************************/
#include "map.h"
#include <qstring.h>
class Parameter
{
QString pName;
// bool isExpr;
Map *tree;
QString *prefDataType;
public:
Parameter(const QString &nam, const QString &def=QString());
Parameter(const QString &nam, Map *def);
Parameter(const Parameter &par);
virtual ~Parameter();
/**
* Sets the data type we want this parameter to be. We can then
* quickly check if this parameter has a correct type using
* @ref checkDatatype
*
* Example:
* setDataType("Constant");
* ...
* if (!checkDataType(vars)) return;
*/
void setDataType(const QString & pref);
int checkDataType(const QDict <Map> & vars) const;
const QString &name(void) const { return pName; };
void setName(const QString & nam);
Map *eval(const QDict <Map> &vars);
Parameter *copy() const;
void printDebug(const QString &tab=QString()) const;
Map *map(void) const { return tree; };
QString string(void) const;
/*
* Assignment operator . It could be thought as the "mimetizeFunction"
* (or "mimetizeParameter") of the Parameter class.
*/
// Parameter &operator =(const Parameter &p);
};
Generated by: antlarr@terminus on Mon Jun 5 03:54:02 2000, using kdoc 2.0a22. |