• 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
container.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 CONTAINER_H
20 #define CONTAINER_H
21 
22 #include <QDomNode>
23 
24 #include "object.h"
25 #include "operator.h"
26 #include "analitzaexport.h"
27 
28 namespace Analitza
29 {
30 
31 class Ci;
32 
44 class ANALITZA_EXPORT Container : public Object
45 {
46 public:
47 
49  enum ContainerType {
50  none=0,
51  math,
52  declare,
53  lambda,
54  bvar,
55  uplimit,
56  downlimit,
57  piece,
58  piecewise,
59  otherwise,
60  domainofapplication
61  };
62 
63  typedef QList<Object*>::const_iterator const_iterator;
64  typedef QList<Object*>::iterator iterator;
65 
67  Container(enum ContainerType c) : Object(container), m_cont_type(c) { }
68 
70  Container(const Container& c);
71 
72  virtual Container* copy() const;
73 
75  virtual ~Container() { qDeleteAll(m_params); }
76 
78  void setContainerType(enum ContainerType c) { m_cont_type = c; }
79 
81  ContainerType containerType() const { Q_ASSERT(m_type==Object::container && m_cont_type!=none); return m_cont_type; }
82 
84  bool operator==(const Container& c) const;
85 
87  static ContainerType toContainerType(const QString& tag);
88 
90  void appendBranch(Object* o);
91 
93  void insertBranch(Container::iterator before, Object* o) { m_params.insert(before, o); }
94 
96  QStringList bvarStrings() const;
97 
99  QList<Ci*> bvarCi() const;
100 
102  Container::iterator begin() { return m_params.begin(); }
103 
105  Container::const_iterator constBegin() const { return m_params.constBegin(); }
106 
108  Container::const_iterator constEnd() const { return m_params.constEnd(); }
109 
111  Container::iterator end() { return m_params.end(); }
112 
114  bool isEmpty() const { return m_params.isEmpty(); }
115 
117  bool isNumber() const;
118 
120  QString tagName() const;
121 
122  virtual QVariant accept(AbstractExpressionVisitor*) const;
123 
124  virtual bool isZero() const;
125 
126  virtual bool matches(const Object* pattern, QMap< QString, const Object* >* found) const;
127 
128  const Container* extractType(Container::ContainerType t) const;
129 
131  int bvarCount() const;
132 
133 // protected:
134  QList<Object*> m_params;
135 private:
136  ContainerType m_cont_type;
137  static char m_typeStr[][20];
138  static QMap<QString, ContainerType> m_nameToType;
139 };
140 
141 }
142 
143 #endif
Analitza::AbstractExpressionVisitor
Definition: abstractexpressionvisitor.h:49
Analitza::Container::containerType
ContainerType containerType() const
Returns the type of the container.
Definition: container.h:81
Analitza::Container::otherwise
Describes a container as a lt;otherwise> tag.
Definition: container.h:59
Analitza::Container::bvar
Describes a container as a lt;bvar> tag.
Definition: container.h:54
Analitza::Container::declare
Describes a container as a lt;declare> tag.
Definition: container.h:52
QMap
Analitza::Object::container
Describes an object as a container.
Definition: object.h:50
QList::const_iterator
Analitza::Container::downlimit
Describes a container as a lt;downlimit> tag.
Definition: container.h:56
Analitza::Container::end
Container::iterator end()
Returns the end iterator on the contained object list.
Definition: container.h:111
Analitza::Container::lambda
Describes a container as a lt;lambda> tag.
Definition: container.h:53
Analitza::Container::math
Describes a container as a lt;math> tag.
Definition: container.h:51
operator.h
QString
QList
QList::iterator
QStringList
Analitza::Container::insertBranch
void insertBranch(Container::iterator before, Object *o)
Adds a o branch right after before of the Container.
Definition: container.h:93
Analitza::Container::begin
Container::iterator begin()
Returns the begin iterator on the contained object list.
Definition: container.h:102
analitzaexport.h
Analitza::Container::setContainerType
void setContainerType(enum ContainerType c)
Sets the container type to c.
Definition: container.h:78
Analitza::Container
Container represents special tags of MathML called containers.
Definition: container.h:44
Analitza::Container::m_params
QList< Object * > m_params
Definition: container.h:134
Analitza::Object
Definition: object.h:38
object.h
ANALITZA_EXPORT
#define ANALITZA_EXPORT
Definition: analitzaexport.h:31
Analitza::Container::constEnd
Container::const_iterator constEnd() const
Returns the end iterator on the contained object list.
Definition: container.h:108
Analitza::Container::~Container
virtual ~Container()
Destructor.
Definition: container.h:75
Analitza::Container::uplimit
Describes a container as a lt;uplimit> tag.
Definition: container.h:55
Analitza::Container::ContainerType
ContainerType
Is used to describe Container objects in reference to the MathML standard.
Definition: container.h:49
Analitza::Container::Container
Container(enum ContainerType c)
Construtor.
Definition: container.h:67
Analitza::Container::isEmpty
bool isEmpty() const
Returns whether it is an empty container.
Definition: container.h:114
Analitza::Container::piecewise
Describes a container as a lt;piecewise> tag.
Definition: container.h:58
Analitza::Container::constBegin
Container::const_iterator constBegin() const
Returns the begin iterator on the contained object list.
Definition: container.h:105
Analitza::Container::piece
Describes a container as a lt;piece> tag.
Definition: container.h:57
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