• 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
apply.h
Go to the documentation of this file.
1 /*************************************************************************************
2  * Copyright (C) 2007-2010 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 APPLY_H
20 #define APPLY_H
21 #include "object.h"
22 #include "analitzaexport.h"
23 #include "operator.h"
24 
25 namespace Analitza
26 {
27 class Operator;
28 class Ci;
29 
41 class ANALITZA_EXPORT Apply : public Object
42 {
43  public:
44  Apply();
45  virtual ~Apply();
46 
47  typedef QVector<Object*>::const_iterator const_iterator;
48  typedef QVector<Object*>::iterator iterator;
49 
50  virtual Apply* copy() const;
51  virtual bool matches(const Analitza::Object* exp, QMap< QString, const Analitza::Object* >* found) const;
52  virtual QVariant accept(AbstractExpressionVisitor* exp) const;
53  const Operator& firstOperator() const { return m_op; }
54  int countValues() const { return m_params.size(); }
55 
56  void prependBranch(Object* o);
57  void appendBranch(Object* o);
58 
60  void addBVar(Analitza::Ci* bvar);
61 
63  bool hasBVars() const { return !m_bvars.isEmpty(); }
64 
66  QStringList bvarStrings() const;
67  Object* ulimit() const { return m_ulimit; }
68  Object* dlimit() const { return m_dlimit; }
69  Object* domain() const { return m_domain; }
70 
71  Object*& ulimit() { return m_ulimit; }
72  Object*& dlimit() { return m_dlimit; }
73  Object*& domain() { return m_domain; }
74 
76  iterator firstValue() { return m_params.begin(); }
77  iterator begin() { return m_params.begin(); }
78  iterator end() { return m_params.end(); }
79  const_iterator firstValue() const { return m_params.constBegin(); }
80  const_iterator constBegin() const { return m_params.constBegin(); }
81  const_iterator constEnd() const { return m_params.constEnd(); }
82  QVector<Ci*> bvarCi() const { return m_bvars; }
83  bool isUnary() const { return m_params.size()==1; }
84  bool isEmpty() const { return m_params.isEmpty(); }
85  bool operator==(const Apply& a) const;
86 
88  void insertBranch(Apply::iterator before, Object* o) { m_params.insert(before, o); }
89  QVector<Object*> values() const { return m_params; }
90  Object* at(int p) const;
91 
93  bool hasBoundings() const;
94 
95  QVector<Object*> m_params;
96  private:
97  Apply(const Apply& );
98  bool addBranch(Object* o);
99 
100  Object* m_ulimit, *m_dlimit, *m_domain;
101  QVector<Ci*> m_bvars;
102  Operator m_op;
103 };
104 
105 }
106 #endif // APPLY_H
Analitza::AbstractExpressionVisitor
Definition: abstractexpressionvisitor.h:49
Analitza::Apply::constBegin
const_iterator constBegin() const
Definition: apply.h:80
Analitza::Apply::firstOperator
const Operator & firstOperator() const
Definition: apply.h:53
Analitza::Apply::dlimit
Object * dlimit() const
Definition: apply.h:68
QMap< QString, const Analitza::Object * >
Analitza::Apply::hasBVars
bool hasBVars() const
Returns whether that apply has any bvar.
Definition: apply.h:63
Analitza::Apply::m_params
QVector< Object * > m_params
Definition: apply.h:95
Analitza::Apply::end
iterator end()
Definition: apply.h:78
Analitza::Operator
Is the operator representation in the trees.
Definition: operator.h:36
Analitza::Apply::isEmpty
bool isEmpty() const
Definition: apply.h:84
Analitza::Ci
A variable object, name refers to MathML standard.
Definition: variable.h:34
Analitza::Apply::dlimit
Object *& dlimit()
Definition: apply.h:72
Analitza::Apply::ulimit
Object *& ulimit()
Definition: apply.h:71
Analitza::Apply::constEnd
const_iterator constEnd() const
Definition: apply.h:81
operator.h
Analitza::Apply::domain
Object *& domain()
Definition: apply.h:73
Analitza::Apply::firstValue
iterator firstValue()
Definition: apply.h:76
Analitza::Apply::begin
iterator begin()
Definition: apply.h:77
Analitza::Apply::ulimit
Object * ulimit() const
Definition: apply.h:67
QStringList
Analitza::Apply::domain
Object * domain() const
Definition: apply.h:69
Analitza::Apply::countValues
int countValues() const
Definition: apply.h:54
analitzaexport.h
Analitza::Object
Definition: object.h:38
object.h
QVector
ANALITZA_EXPORT
#define ANALITZA_EXPORT
Definition: analitzaexport.h:31
Analitza::Apply::isUnary
bool isUnary() const
Definition: apply.h:83
Analitza::Apply::firstValue
const_iterator firstValue() const
Definition: apply.h:79
Analitza::Apply::values
QVector< Object * > values() const
Definition: apply.h:89
Analitza::Apply::bvarCi
QVector< Ci * > bvarCi() const
Definition: apply.h:82
Analitza::Apply::insertBranch
void insertBranch(Apply::iterator before, Object *o)
Adds a o branch right after before of the Container.
Definition: apply.h:88
Analitza::Apply
This class is the one that will correspond to MathML apply tags.
Definition: apply.h:41
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