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

kig

  • sources
  • kde-4.12
  • kdeedu
  • kig
  • misc
object_hierarchy.h
Go to the documentation of this file.
1 // Copyright (C) 2003 Dominique Devriese <devriese@kde.org>
2 
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
7 
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 // 02110-1301, USA.
17 
18 #ifndef KIG_MISC_OBJECT_HIERARCHY_H
19 #define KIG_MISC_OBJECT_HIERARCHY_H
20 
21 #include "../objects/common.h"
22 
23 #include <map>
24 #include <vector>
25 #include <string>
26 
27 class ObjectImpType;
28 class ArgsParser;
29 
30 class ObjectHierarchy
31 {
32 public:
33  class Node;
34 private:
35  std::vector<Node*> mnodes;
36  uint mnumberofargs;
37  uint mnumberofresults;
38  bool msaveinputtags; // if true the UseText and SelectStatement are serialized for saving
39  std::vector<const ObjectImpType*> margrequirements;
40  std::vector<std::string> musetexts;
41  std::vector<std::string> mselectstatements;
42 
43  // these two are really part of the constructor...
44  int visit( const ObjectCalcer* o, std::map<const ObjectCalcer*, int>&,
45  bool needed, bool neededatend = false);
46  int storeObject( const ObjectCalcer*, const std::vector<ObjectCalcer*>& po, std::vector<int>& pl,
47  std::map<const ObjectCalcer*, int>& seenmap );
48 
49  friend bool operator==( const ObjectHierarchy& lhs, const ObjectHierarchy& rhs );
50 
51  void init( const std::vector<ObjectCalcer*>& from, const std::vector<ObjectCalcer*>& to );
52 
59  ObjectHierarchy();
60 
61 public:
62  ObjectHierarchy( const ObjectCalcer* from, const ObjectCalcer* to );
63  ObjectHierarchy( const std::vector<ObjectCalcer*>& from, const ObjectCalcer* to );
64  ObjectHierarchy( const std::vector<ObjectCalcer*>& from, const std::vector<ObjectCalcer*>& to );
65  ObjectHierarchy( const ObjectHierarchy& h );
66  ~ObjectHierarchy();
67 
72  ObjectHierarchy withFixedArgs( const Args& a ) const;
73 
74  std::vector<ObjectImp*> calc( const Args& a, const KigDocument& doc ) const;
75 
79  void serialize( QDomElement& parent, QDomDocument& doc ) const;
85  static ObjectHierarchy* buildSafeObjectHierarchy( const QDomElement& parent, QString& error );
86 // ObjectHierarchy( const QDomElement& parent );
87 
95  std::vector<ObjectCalcer*> buildObjects( const std::vector<ObjectCalcer*>& os, const KigDocument& ) const;
96 
97  ArgsParser argParser() const;
98 
99  uint numberOfArgs() const { return mnumberofargs; }
100  uint numberOfResults() const { return mnumberofresults; }
101 
102  const ObjectImpType* idOfLastResult() const;
103 
104  bool resultDoesNotDependOnGiven() const;
105  bool allGivenObjectsUsed() const;
106 
107  ObjectHierarchy transformFinalObject( const Transformation& t ) const;
108 };
109 
110 bool operator==( const ObjectHierarchy& lhs, const ObjectHierarchy& rhs );
111 
112 #endif
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
ObjectHierarchy::idOfLastResult
const ObjectImpType * idOfLastResult() const
Definition: object_hierarchy.cc:634
ObjectHierarchy::operator==
friend bool operator==(const ObjectHierarchy &lhs, const ObjectHierarchy &rhs)
Definition: object_hierarchy.cc:659
ObjectHierarchy
Definition: object_hierarchy.h:30
ObjectHierarchy::buildSafeObjectHierarchy
static ObjectHierarchy * buildSafeObjectHierarchy(const QDomElement &parent, QString &error)
Deserialize the ObjectHierarchy data from the xml element parent .
Definition: object_hierarchy.cc:482
operator==
bool operator==(const ObjectHierarchy &lhs, const ObjectHierarchy &rhs)
Definition: object_hierarchy.cc:659
ObjectHierarchy::serialize
void serialize(QDomElement &parent, QDomDocument &doc) const
saves the ObjectHierarchy data in children xml tags of parent .
Definition: object_hierarchy.cc:414
ObjectHierarchy::~ObjectHierarchy
~ObjectHierarchy()
Definition: object_hierarchy.cc:342
ObjectHierarchy::calc
std::vector< ObjectImp * > calc(const Args &a, const KigDocument &doc) const
Definition: object_hierarchy.cc:256
ObjectHierarchy::numberOfArgs
uint numberOfArgs() const
Definition: object_hierarchy.h:99
ObjectHierarchy::withFixedArgs
ObjectHierarchy withFixedArgs(const Args &a) const
this creates a new ObjectHierarchy, that takes a.size() less arguments, but uses copies of the Object...
Definition: object_hierarchy.cc:358
ObjectCalcer
An ObjectCalcer is an object that represents an algorithm for calculating an ObjectImp from other Obj...
Definition: object_calcer.h:66
Args
std::vector< const ObjectImp * > Args
Definition: objects/common.h:47
Transformation
Class representing a transformation.
Definition: kigtransform.h:37
ArgsParser
This class is meant to take care of checking the types of the parents to ObjectCalcer's, and to put them in the correct order.
Definition: argsparser.h:106
ObjectHierarchy::numberOfResults
uint numberOfResults() const
Definition: object_hierarchy.h:100
ObjectHierarchy::argParser
ArgsParser argParser() const
Definition: object_hierarchy.cc:598
visit
static bool visit(const ObjectCalcer *o, const std::vector< ObjectCalcer * > &from, std::vector< ObjectCalcer * > &ret)
Definition: calcpaths.cc:193
ObjectHierarchy::buildObjects
std::vector< ObjectCalcer * > buildObjects(const std::vector< ObjectCalcer * > &os, const KigDocument &) const
build a set of objects that interdepend according to this ObjectHierarchy.
Definition: object_hierarchy.cc:613
ObjectHierarchy::allGivenObjectsUsed
bool allGivenObjectsUsed() const
Definition: object_hierarchy.cc:777
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
ObjectHierarchy::resultDoesNotDependOnGiven
bool resultDoesNotDependOnGiven() const
Definition: object_hierarchy.cc:677
ObjectHierarchy::transformFinalObject
ObjectHierarchy transformFinalObject(const Transformation &t) const
Definition: object_hierarchy.cc:645
uint
unsigned int uint
Definition: object_imp.h:87
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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