• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

Analitza

  • sources
  • kde-4.14
  • kdeedu
  • analitza
  • analitza
object.h
Go to the documentation of this file.
1 /*************************************************************************************
2  * Copyright (C) 2007 by Aleix Pol <aleixpol@kde.org> *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License *
6  * as published by the Free Software Foundation; either version 2 *
7  * of the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the Free Software *
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
17  *************************************************************************************/
18 
19 #ifndef OBJECT_H
20 #define OBJECT_H
21 
22 #include <QDebug>
23 
24 #include "analitzaexport.h"
25 
26 namespace Analitza
27 {
28 
29 class AbstractExpressionVisitor;
30 
37 //FIXME: Check for public -> protected on some members
38 class ANALITZA_EXPORT Object
39 {
40 public:
42  enum ObjectType {
43  none=0,
44  value,
45  variable,
46  vector,
47  list,
48  apply,
49  oper,
50  container,
51  matrix,
52  matrixrow,
53  custom
54  };
55 
57  virtual ~Object() { /*qDebug() << "Destroying " << this;*/}
58 
60  enum ObjectType type() const { return m_type; }
61 
63  bool isApply() const { return m_type==apply; }
64 
66  bool isContainer() const { return m_type==container; }
67 
69  QString toString() const;
70 
72  virtual QVariant accept(AbstractExpressionVisitor* exp) const = 0;
73 
74  virtual bool isZero() const { return false; }
75 
82  virtual bool matches(const Object* exp, QMap<QString, const Object*>* found) const=0;
83 
85  virtual Object* copy() const =0;
86 
87 protected:
89  Object(enum ObjectType t) : m_type(t) {}
90 
92  const ObjectType m_type;
93 };
94 
95 }
96 #endif
Analitza::Object::m_type
const ObjectType m_type
Specifies the Object type.
Definition: object.h:92
Analitza::AbstractExpressionVisitor
Definition: abstractexpressionvisitor.h:49
Analitza::Object::isContainer
bool isContainer() const
Returns whether it is a container or not.
Definition: object.h:66
Analitza::Object::value
Describes an object as a value.
Definition: object.h:44
Analitza::Object::apply
Describes an object as an application.
Definition: object.h:48
QMap
Analitza::Object::container
Describes an object as a container.
Definition: object.h:50
Analitza::Object::vector
Describes an object as a vector.
Definition: object.h:46
Analitza::Object::Object
Object(enum ObjectType t)
Creates an object with a t type.
Definition: object.h:89
Analitza::Object::ObjectType
ObjectType
ObjectType is used to describe objects.
Definition: object.h:42
Analitza::Object::matrixrow
Describes an object as a matrix row.
Definition: object.h:52
Analitza::Object::isApply
bool isApply() const
Returns whether it is an apply or not.
Definition: object.h:63
QString
Analitza::Object::oper
Describes an object as an operator.
Definition: object.h:49
Analitza::Object::variable
Describes an object as a variable.
Definition: object.h:45
analitzaexport.h
Analitza::Object::~Object
virtual ~Object()
Object destructor.
Definition: object.h:57
Analitza::Object
Definition: object.h:38
ANALITZA_EXPORT
#define ANALITZA_EXPORT
Definition: analitzaexport.h:31
Analitza::Object::list
Describes an object as a list.
Definition: object.h:47
Analitza::Object::matrix
Describes an object as a matrix.
Definition: object.h:51
Analitza::Object::isZero
virtual bool isZero() const
Definition: object.h:74
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:11:37 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Analitza

Skip menu "Analitza"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal