Browse Source

Add Iterator Interface

Kolja Strohm 3 months ago
parent
commit
544348198d
19 changed files with 233 additions and 193 deletions
  1. 33 63
      Array.h
  2. 8 8
      Bildschirm.cpp
  3. 1 1
      Bildschirm.h
  4. 21 21
      DX12PixelShader.h
  5. 18 18
      DX12VertexShader.h
  6. 1 0
      Framework.vcxproj
  7. 3 0
      Framework.vcxproj.filters
  8. 59 0
      Iterator.h
  9. 11 10
      JSON.cpp
  10. 7 6
      JSON.h
  11. 1 1
      Model3D.cpp
  12. 2 3
      Model3D.h
  13. 2 1
      Model3DCollection.h
  14. 21 21
      UIPixelShader.h
  15. 15 15
      UIVertexShader.h
  16. 1 1
      Welt2D.cpp
  17. 1 1
      Welt2D.h
  18. 13 13
      XML.cpp
  19. 15 10
      XML.h

+ 33 - 63
Array.h

@@ -5,6 +5,7 @@
 #include <stdexcept>
 
 #include "Errors.h"
+#include "Iterator.h"
 #include "ReferenceCounter.h"
 #include "Text.h"
 
@@ -82,15 +83,15 @@ namespace Framework
 #else
     };
 #endif
-
-    template<class TYP> class Iterator
+    template<class TYP> class ArrayIterator
+        : public Iterator<TYP, ArrayIterator<TYP>>
     {
     private:
         ArrayEintrag<TYP>* current;
         std::function<ArrayEintrag<TYP>*(ArrayEintrag<TYP>* removed)> onRemove;
 
     public:
-        Iterator(ArrayEintrag<TYP>* start,
+        ArrayIterator(ArrayEintrag<TYP>* start,
             std::function<ArrayEintrag<TYP>*(ArrayEintrag<TYP>* removed)>
                 onRemove)
         {
@@ -102,25 +103,25 @@ namespace Framework
             }
         }
 
-        Iterator(const Iterator& it)
+        ArrayIterator(const ArrayIterator& it)
         {
             onRemove = it.onRemove;
             current = it.current;
         }
 
-        ~Iterator()
+        virtual ~ArrayIterator()
         {
             current = 0;
         }
 
-        Iterator<TYP>& operator=(Iterator<TYP> r)
+        ArrayIterator<TYP>& operator=(ArrayIterator<TYP> r)
         {
             onRemove = r.onRemove;
             current = r.current;
             return *this;
         }
 
-        bool hasNext()
+        bool hasNext() override
         {
             ArrayEintrag<TYP>* next = current->next;
             while (next && !next->set)
@@ -130,12 +131,7 @@ namespace Framework
             return next != 0;
         }
 
-        TYP operator*()
-        {
-            return current->var;
-        }
-
-        Iterator<TYP> next()
+        ArrayIterator<TYP> next() override
         {
             if (!current)
             {
@@ -145,28 +141,15 @@ namespace Framework
                 err += __LINE__;
                 throw std::out_of_range(err);
             }
-            return Iterator(current->next, onRemove);
+            return ArrayIterator(current->next, onRemove);
         }
 
-        operator bool()
+        operator bool() override
         {
             return current != 0;
         }
 
-        operator TYP()
-        {
-            if (!current || !current->set)
-            {
-                Text err = "Index out of Range Exception File: ";
-                err += __FILE__;
-                err += " Line: ";
-                err += __LINE__;
-                throw std::out_of_range(err);
-            }
-            return current->var;
-        }
-
-        Iterator<TYP>& operator++() //! prefix
+        ArrayIterator<TYP>& operator++() override //! prefix
         {
             do
             {
@@ -175,9 +158,9 @@ namespace Framework
             return *this;
         }
 
-        Iterator<TYP> operator++(int) //! postfix
+        ArrayIterator<TYP> operator++(int) override //! postfix
         {
-            Iterator<TYP> temp(*this);
+            ArrayIterator<TYP> temp(*this);
             do
             {
                 if (current) current = current->next;
@@ -185,20 +168,7 @@ namespace Framework
             return temp;
         }
 
-        TYP operator->()
-        {
-            if (!current || !current->set)
-            {
-                Text err = "Index out of Range Exception File: ";
-                err += __FILE__;
-                err += " Line: ";
-                err += __LINE__;
-                throw std::out_of_range(err);
-            }
-            return current->var;
-        }
-
-        TYP val()
+        TYP val() override
         {
             if (!current || !current->set)
             {
@@ -211,7 +181,7 @@ namespace Framework
             return current->var;
         }
 
-        void set(TYP val)
+        void set(TYP val) override
         {
             if (current)
             {
@@ -228,12 +198,12 @@ namespace Framework
             }
         }
 
-        bool operator!=(Iterator<TYP>& r)
+        bool operator!=(ArrayIterator<TYP>& r)
         {
             return current != r.current;
         }
 
-        void remove()
+        void remove() override
         {
             current = onRemove(current);
         }
@@ -451,14 +421,14 @@ namespace Framework
 
         //! Gibt einen Iterator zurück.
         //! Mit ++ kann durch die Liste iteriert werden
-        Iterator<TYP> begin() const
+        ArrayIterator<TYP> begin() const
         {
-            return Iterator<TYP>(entries, onRemove);
+            return ArrayIterator<TYP>(entries, onRemove);
         }
 
-        Iterator<TYP> end() const
+        ArrayIterator<TYP> end() const
         {
-            return Iterator<TYP>(0, onRemove);
+            return ArrayIterator<TYP>(0, onRemove);
         }
 
         //! Gibt zurück, wie viele Elemente in der Liste sind
@@ -679,7 +649,7 @@ namespace Framework
             if (i == p) return;
             if (i < 0 || p < 0 || i >= count || p >= count)
                 throwOutOfRange(__FILE__, __LINE__, i, count);
-            TYP *t = get(i);
+            TYP* t = get(i);
             remove(i);
             add(t, p);
         }
@@ -749,14 +719,14 @@ namespace Framework
 
         //! Gibt einen Iterator zurück.
         //! Mit ++ kann durch die Liste iteriert werden
-        Iterator<TYP*> begin() const
+        ArrayIterator<TYP*> begin() const
         {
-            return Iterator<TYP*>(entries, onRemove);
+            return ArrayIterator<TYP*>(entries, onRemove);
         }
 
-        Iterator<TYP*> end() const
+        ArrayIterator<TYP*> end() const
         {
-            return Iterator<TYP*>(0, onRemove);
+            return ArrayIterator<TYP*>(0, onRemove);
         }
 
         //! Gibt zurück, wie viele Elemente in der Liste sind
@@ -807,17 +777,17 @@ namespace Framework
             return i >= 0 && i < count;
         }
 
-        //! returns the index of the first element that matches zT or -1 if not found
+        //! returns the index of the first element that matches zT or -1 if not
+        //! found
         int indexOf(TYP* zT) const
         {
             int i = 0;
             for (TYP* t : *this)
             {
-				if (t == zT)
-					return i;
-				++i;
-			}
-			return -1;
+                if (t == zT) return i;
+                ++i;
+            }
+            return -1;
         }
 
         bool anyMatch(std::function<bool(const TYP* zElement)> predicate) const

+ 8 - 8
Bildschirm.cpp

@@ -186,7 +186,7 @@ void Bildschirm::tick(double tickval)
     }
     if (!renderOnTop)
     {
-        for (Iterator<ToolTip*> i = tips->begin(); i; i++)
+        for (ArrayIterator<ToolTip*> i = tips->begin(); i; i++)
         {
             i->tick(tickval);
             if (i->getReferenceCount() == 1) i.remove();
@@ -197,7 +197,7 @@ void Bildschirm::tick(double tickval)
     else if (onTop)
     {
         rend |= onTop->tick(tickval);
-        for (Iterator<ToolTip*> i = tips->begin(); i; i++)
+        for (ArrayIterator<ToolTip*> i = tips->begin(); i; i++)
         {
             i->tick(tickval);
             if (i->getReferenceCount() == 1) i.remove();
@@ -237,7 +237,7 @@ void Bildschirm::doMausEreignis(MausEreignis& me) // sendet maus Ereignis
     lock();
     if (!renderOnTop)
     {
-        for (Iterator<ToolTip*> i = tips->begin(); i; i++)
+        for (ArrayIterator<ToolTip*> i = tips->begin(); i; i++)
         {
             i->doPublicMausEreignis(me);
             if (i->getReferenceCount() == 1) i.remove();
@@ -248,7 +248,7 @@ void Bildschirm::doMausEreignis(MausEreignis& me) // sendet maus Ereignis
     else if (onTop)
     {
         onTop->doPublicMausEreignis(me);
-        for (Iterator<ToolTip*> i = tips->begin(); i; i++)
+        for (ArrayIterator<ToolTip*> i = tips->begin(); i; i++)
         {
             i->doPublicMausEreignis(me);
             if (i->getReferenceCount() == 1) i.remove();
@@ -266,7 +266,7 @@ void Bildschirm::doTastaturEreignis(
         for (int i = members->getEintragAnzahl() - 1; i >= 0; i--)
             members->z(i)->doTastaturEreignis(te);
     }
-    for (Iterator<ToolTip*> i = tips->begin(); i; i++)
+    for (ArrayIterator<ToolTip*> i = tips->begin(); i; i++)
     {
         i->doTastaturEreignis(te);
         if (i->getReferenceCount() == 1) i.remove();
@@ -293,7 +293,7 @@ Bild* Bildschirm::zRenderBild() const
     return api->zUIRenderBild();
 }
 
-Iterator<Zeichnung*>
+ArrayIterator<Zeichnung*>
 Bildschirm::getMembers() const // gibt die Zeichnunge zurück
 {
     return members->begin();
@@ -434,7 +434,7 @@ void Bildschirm2D::render() // Zeichnet das Bild
                     ui->alphaRegion(
                         0, 0, ui->getBreite(), ui->getHeight(), deckFarbe);
             }
-            for (Iterator<ToolTip*> i = tips->begin(); i; i++)
+            for (ArrayIterator<ToolTip*> i = tips->begin(); i; i++)
             {
                 i->render(*ui);
                 if (i->getReferenceCount() == 1) i.remove();
@@ -626,7 +626,7 @@ void Bildschirm3D::render() // Zeichnet das Bild
                     ui->alphaRegion(
                         0, 0, ui->getBreite(), ui->getHeight(), deckFarbe);
             }
-            for (Iterator<ToolTip*> i = tips->begin(); i; i++)
+            for (ArrayIterator<ToolTip*> i = tips->begin(); i; i++)
             {
                 i->render(*ui);
                 if (i->getReferenceCount() == 1) i.remove();

+ 1 - 1
Bildschirm.h

@@ -194,7 +194,7 @@ namespace Framework
         DLLEXPORT virtual Bild* zRenderBild() const;
         //! Gibt ein Array von 2D GUI Zeichnungen zurück, die sich im Bild
         //! befinden
-        DLLEXPORT virtual Iterator<Zeichnung*> getMembers() const;
+        DLLEXPORT virtual ArrayIterator<Zeichnung*> getMembers() const;
         //! Gibt die Farbe im A8R8G8B8 Format zurück, mit der das Bild vor dem
         //! Zeichnen befüllt wird
         DLLEXPORT virtual int getFillFarbe() const;

+ 21 - 21
DX12PixelShader.h

@@ -92,10 +92,10 @@ ret
 
 const BYTE DX12PixelShaderBytes[] =
 {
-     68,  88,  66,  67,  84, 183, 
-     45,  34, 237,  19,  96, 231, 
-     54, 248, 106,  42,  77, 181, 
-     83,  15,   1,   0,   0,   0, 
+     68,  88,  66,  67,  24,  78, 
+     79,   5, 181, 142, 210, 152, 
+    125, 223,  80,   6, 213, 118, 
+    152, 151,   1,   0,   0,   0, 
     184,  91,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
      36,   2,   0,   0, 188,   2, 
@@ -763,11 +763,11 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1, 246,  48,   6, 101, 
-      1,   0,   0,   0, 229, 169, 
-     71, 101, 191,   5,  92,  73, 
-    162, 216, 150,  28, 145,  60, 
-    127,  33,   0,   0,   0,   0, 
+     49,   1, 236, 177, 162, 101, 
+      1,   0,   0,   0,  15, 233, 
+    188, 254, 214, 190, 158,  72, 
+    138, 128,  70, 136,  65, 165, 
+    129,   5,   0,   0,   0,   0, 
       0,   0,   0,   0,   1,   0, 
       0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -938,9 +938,9 @@ const BYTE DX12PixelShaderBytes[] =
       3,   0, 242,  56,   1,   0, 
      43, 236,   3,   0,  28,  19, 
       2,   0,  65,  36,   1,   0, 
-    236, 179,   1,   0, 213, 174, 
+    236, 179,   1,   0, 190, 254, 
       3,   0, 125,  10,   2,   0, 
-    125, 181,   2,   0, 155, 129, 
+    125, 181,   2,   0, 204, 111, 
       2,   0, 193,  33,   3,   0, 
      65, 185,   2,   0, 140, 239, 
       1,   0, 246,  49,   0,   0, 
@@ -1788,8 +1788,8 @@ const BYTE DX12PixelShaderBytes[] =
     117, 114, 101,  50,  68,  32, 
     115, 104,  97, 100,  27, 226, 
      48,   1, 128,   0,   0,   0, 
-    173, 233,  95,  11, 240, 232, 
-    217,   1,   1,   0,   0,   0, 
+    237, 120,  57, 159,  56,  70, 
+    218,   1,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2348,14 +2348,14 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,  23,   0,   1,   0, 
       5,  16,   0,   0,  14,   0, 
      23,  21,   0,  16,   0,   0, 
-      3,   2,  16, 146,   0,   0, 
+      3,   2, 128, 231,   0,   0, 
     242, 241,  10,   0,  24,  21, 
       8,  16,   0,   0,   1,   0, 
       1,   0,  10,   0,  24,  21, 
       9,  16,   0,   0,   1,   0, 
       0,   2,  14,   0,  23,  21, 
       0,   0,   0,   0,  10,   2, 
-     16, 146,   0,   0, 242, 241, 
+    128, 231,   0,   0, 242, 241, 
      10,   0,  24,  21,  11,  16, 
       0,   0,   1,   0,   1,   0, 
      10,   0,  24,  21,  12,  16, 
@@ -3408,11 +3408,11 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1, 246,  48, 
-      6, 101,   1,   0,   0,   0, 
-    229, 169,  71, 101, 191,   5, 
-     92,  73, 162, 216, 150,  28, 
-    145,  60, 127,  33, 128,   0, 
+    148,  46,  49,   1, 236, 177, 
+    162, 101,   1,   0,   0,   0, 
+     15, 233, 188, 254, 214, 190, 
+    158,  72, 138, 128,  70, 136, 
+     65, 165, 129,   5, 128,   0, 
       0,   0,  47,  76, 105, 110, 
     107,  73, 110, 102, 111,   0, 
      47, 110,  97, 109, 101, 115, 
@@ -3512,7 +3512,7 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   2,   0,   9,   0, 
     220,   4,   0,   0,   0,   0, 
       0,   0, 156,   1,   0,   0, 
-      1,   0, 133, 152,   0,   0, 
+      1,   0,  28, 241,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 109,  97, 
     105, 110,   0, 110, 111, 110, 

+ 18 - 18
DX12VertexShader.h

@@ -131,10 +131,10 @@ ret
 
 const BYTE DX12VertexShaderBytes[] =
 {
-     68,  88,  66,  67,  82, 250, 
-     47,  18,  46,  26, 254, 190, 
-     65, 219,  42, 169,  26,  62, 
-      3, 216,   1,   0,   0,   0, 
+     68,  88,  66,  67, 199,  95, 
+     82, 177, 242, 104, 223,  93, 
+    147, 212, 141, 252, 104,  63, 
+     75,  49,   1,   0,   0,   0, 
     144,  78,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     124,   2,   0,   0,  52,   3, 
@@ -923,11 +923,11 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1, 246,  48, 
-      6, 101,   1,   0,   0,   0, 
-    102, 229, 210, 190, 194,  21, 
-    176,  65, 169, 171, 206, 158, 
-     61, 246,  36, 216,   0,   0, 
+    148,  46,  49,   1, 236, 177, 
+    162, 101,   1,   0,   0,   0, 
+     33, 116, 142,  68,  66,  83, 
+    180,  69, 150, 186,  69,   9, 
+    248, 125,  69,  60,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       1,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1103,7 +1103,7 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0, 103, 159,   1,   0, 
     179, 120,   1,   0, 238,  97, 
       2,   0,  90,  28,   0,   0, 
-    149, 154,   0,   0,  53, 174, 
+     25, 234,   0,   0,  53, 174, 
       3,   0, 206,  21,   0,   0, 
     193, 205,   3,   0, 207, 193, 
       1,   0,  62,   3,   3,   0, 
@@ -1607,8 +1607,8 @@ const BYTE DX12VertexShaderBytes[] =
      97, 109, 101, 114,  97,  13, 
      10, 115, 116, 114,  27, 226, 
      48,   1, 128,   0,   0,   0, 
-     36, 216, 117,  11, 240, 232, 
-    217,   1,   1,   0,   0,   0, 
+     92, 204,  77, 159,  56,  70, 
+    218,   1,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2125,7 +2125,7 @@ const BYTE DX12VertexShaderBytes[] =
      24,  21,  12,  16,   0,   0, 
       1,   0,   1,   0,  14,   0, 
      23,  21,  13,  16,   0,   0, 
-     36,   2, 112,  33,   0,   0, 
+     36,   2, 128,  67,   0,   0, 
     242, 241,  10,   0,  24,  21, 
      14,  16,   0,   0,   1,   0, 
       0,   2,  18,   0,  22,  21, 
@@ -3057,10 +3057,10 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    246,  48,   6, 101,   1,   0, 
-      0,   0, 102, 229, 210, 190, 
-    194,  21, 176,  65, 169, 171, 
-    206, 158,  61, 246,  36, 216, 
+    236, 177, 162, 101,   1,   0, 
+      0,   0,  33, 116, 142,  68, 
+     66,  83, 180,  69, 150, 186, 
+     69,   9, 248, 125,  69,  60, 
     129,   0,   0,   0,  47,  76, 
     105, 110, 107,  73, 110, 102, 
     111,   0,  47, 110,  97, 109, 
@@ -3160,7 +3160,7 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   2,   0, 
       9,   0, 156,   5,   0,   0, 
       0,   0,   0,   0, 236,   2, 
-      0,   0,   1,   0,  49,  33, 
+      0,   0,   1,   0,  64,  67, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
     109,  97, 105, 110,   0, 110, 

+ 1 - 0
Framework.vcxproj

@@ -203,6 +203,7 @@ copy "x64\Release\Framework.dll" "..\..\Spiele Platform\SMP\Fertig\x64\framework
     <ClInclude Include="Array.h" />
     <ClInclude Include="AsynchronCall.h" />
     <ClInclude Include="AuswahlBox.h" />
+    <ClInclude Include="Iterator.h" />
     <ClInclude Include="Regex.h" />
     <ClInclude Include="Base64.h" />
     <ClInclude Include="Bild.h" />

+ 3 - 0
Framework.vcxproj.filters

@@ -349,6 +349,9 @@
     <ClInclude Include="Regex.h">
       <Filter>Framework\Regex</Filter>
     </ClInclude>
+    <ClInclude Include="Iterator.h">
+      <Filter>Framework\Data</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Model3DCollection.h">

+ 59 - 0
Iterator.h

@@ -0,0 +1,59 @@
+#pragma once
+
+/**
+ * Iterator interface
+ * \tparam T type of the value that is iterated
+ * \tparam I type of the iterator subclass
+ */
+template<typename T, typename I> class Iterator
+{
+public:
+    virtual ~Iterator()
+    {
+        static_assert(std::is_base_of<Iterator, I>::value,
+            "Type Argument I must be an implementation of Iterator");
+    }
+
+    virtual bool hasNext()
+    {
+        return (bool)next();
+    }
+
+    virtual I next() = 0;
+
+    virtual operator bool() = 0;
+
+    virtual I& operator++() //! prefix
+    {
+        *(I*)this = next();
+        return *(I*)this;
+    }
+
+    virtual I operator++(int) //! postfix
+    {
+        I tmp(*(I*)this);
+        operator++();
+        return tmp;
+    }
+
+    virtual T val() = 0;
+
+    virtual void set(T val) = 0;
+
+    virtual void remove() = 0;
+
+    operator T()
+    {
+        return val();
+    }
+
+    virtual T operator->()
+    {
+        return val();
+    }
+
+    virtual T operator*()
+    {
+        return val();
+    }
+};

+ 11 - 10
JSON.cpp

@@ -232,12 +232,12 @@ bool JSONArray::isValueOfType(int i, JSONType type) const
         && array->z(i)->getType() == type;
 }
 
-Iterator<JSONValue*> JSONArray::begin() const
+ArrayIterator<JSONValue*> JSONArray::begin() const
 {
     return array->begin();
 }
 
-Iterator<JSONValue*> JSONArray::end() const
+ArrayIterator<JSONValue*> JSONArray::end() const
 {
     return array->end();
 }
@@ -376,12 +376,12 @@ JSONValue* JSONObject::zValue(Text field)
     return 0;
 }
 
-Iterator<Text> JSONObject::getFields()
+ArrayIterator<Text> JSONObject::getFields()
 {
     return fields->begin();
 }
 
-Iterator<JSONValue*> JSONObject::getValues()
+ArrayIterator<JSONValue*> JSONObject::getValues()
 {
     return values->begin();
 }
@@ -404,7 +404,7 @@ bool JSONObject::isValueOfType(Text field, JSONType type) const
 Text JSONObject::toString() const
 {
     Text str = "{";
-    Iterator<Text> k = fields->begin();
+    ArrayIterator<Text> k = fields->begin();
     for (auto v = values->begin(); k && v; k++, v++)
     {
         str += "\"";
@@ -1077,18 +1077,19 @@ JSONValue* JSONMissingOneOf::getValidPart(
     {
         if (e->hasAttribute("default"))
         {
-            JSONValue *defaultValue = Parser::getValue(e->getAttributeValue("default"));
+            JSONValue* defaultValue
+                = Parser::getValue(e->getAttributeValue("default"));
             if (defaultValue)
             {
-                JSONValue *valid = JSONValidator(
-                    dynamic_cast<XML::Element*>(e->getThis()))
+                JSONValue* valid
+                    = JSONValidator(dynamic_cast<XML::Element*>(e->getThis()))
                           .getValidParts(
                               defaultValue, removedPartsValidationResults);
                 defaultValue->release();
                 if (valid)
                 {
-					return valid;
-				}
+                    return valid;
+                }
             }
         }
     }

+ 7 - 6
JSON.h

@@ -5,9 +5,9 @@
 #include "Array.h"
 #include "ReferenceCounter.h"
 #include "Text.h"
+#include "Trie.h"
 #include "Writer.h"
 #include "XML.h"
-#include "Trie.h"
 
 namespace Framework
 {
@@ -113,8 +113,8 @@ namespace Framework
 
             //! Gibt einen Iterator zurück.
             //! Mit ++ kann durch die Liste iteriert werden
-            __declspec(dllexport) Iterator<JSONValue*> begin() const;
-            __declspec(dllexport) Iterator<JSONValue*> end() const;
+            __declspec(dllexport) ArrayIterator<JSONValue*> begin() const;
+            __declspec(dllexport) ArrayIterator<JSONValue*> end() const;
 
             template<class T>
             RCArray<T>* toRCArray(std::function<T*(JSONValue&)> map) const
@@ -204,8 +204,8 @@ namespace Framework
             __declspec(dllexport) bool hasValue(Text field);
             __declspec(dllexport) JSONValue* getValue(Text field);
             __declspec(dllexport) JSONValue* zValue(Text field);
-            __declspec(dllexport) Iterator<Text> getFields();
-            __declspec(dllexport) Iterator<JSONValue*> getValues();
+            __declspec(dllexport) ArrayIterator<Text> getFields();
+            __declspec(dllexport) ArrayIterator<JSONValue*> getValues();
             __declspec(dllexport) int getFieldCount() const;
             __declspec(dllexport) bool isValueOfType(
                 Text field, JSONType type) const;
@@ -255,7 +255,8 @@ namespace Framework
                     = 0;
                 virtual Text getPath() const = 0;
                 virtual void addBasePath(Text basePath) = 0;
-                virtual bool isDifferent(const JSONValidationResult* zResult) const
+                virtual bool isDifferent(
+                    const JSONValidationResult* zResult) const
                     = 0;
             };
 

+ 1 - 1
Model3D.cpp

@@ -571,7 +571,7 @@ Polygon3D* Model3DData::getPolygon(int index) const
 }
 
 // Gibt einen Iterator zurück, mit dem sich die Polygons auflisten lassen
-Iterator<Polygon3D*> Model3DData::getPolygons() const
+ArrayIterator<Polygon3D*> Model3DData::getPolygons() const
 {
     return polygons->begin();
 }

+ 2 - 3
Model3D.h

@@ -80,7 +80,6 @@ namespace Framework
         float getRadius() const;
     };
 
-
     //! Repräsentiert alle Knochen eines Models, mit denen es Annimiert werden
     //! kann
     class Skeleton : public virtual ReferenceCounter
@@ -125,7 +124,7 @@ namespace Framework
         //! \return the next id for a bone ther can be only MAX_KNOCHEN_ANZ
         //! bones in a sceleton. if the sceleton is full -1 is returned
         DLLEXPORT int getNextBoneId() const;
-        
+
         friend M3Datei;
     };
 
@@ -237,7 +236,7 @@ namespace Framework
         DLLEXPORT Polygon3D* getPolygon(int index) const;
         //! Gibt einen Iterator zurück, mit dem sich die Polygons auflisten
         //! lassen
-        DLLEXPORT Iterator<Polygon3D*> getPolygons() const;
+        DLLEXPORT ArrayIterator<Polygon3D*> getPolygons() const;
         //! Gibt den radius einer Kugel zurück, die das gesammte Model
         //! umschließt
         DLLEXPORT float getRadius() const;

+ 2 - 1
Model3DCollection.h

@@ -12,7 +12,8 @@ namespace Framework
     public:
         DLLEXPORT Model3DCollection();
         virtual void forAll(std::function<void(Model3D*)> f) = 0;
-        DLLEXPORT virtual bool tick(std::function<void(Model3D*)> f, double time);
+        DLLEXPORT virtual bool tick(
+            std::function<void(Model3D*)> f, double time);
         DLLEXPORT virtual void render(std::function<void(Model3D*)> f);
     };
 } // namespace Framework

+ 21 - 21
UIPixelShader.h

@@ -352,10 +352,10 @@ ret
 
 const BYTE UIPixelShader[] =
 {
-     68,  88,  66,  67,  35, 224, 
-    171, 170,  24,  28,  70, 161, 
-    126, 203, 125,  17,  65, 113, 
-    164,  61,   1,   0,   0,   0, 
+     68,  88,  66,  67,  29, 192, 
+    143, 105, 255,  38, 255, 249, 
+    155,  77,   3, 137, 188, 103, 
+     84, 219,   1,   0,   0,   0, 
      12, 134,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     140,   6,   0,   0,  28,   7, 
@@ -1805,11 +1805,11 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1, 246,  48,   6, 101, 
-      1,   0,   0,   0, 186,  68, 
-    194,  98,  45, 234, 239,  76, 
-    143, 243, 253,  50,  51, 187, 
-     97, 209,   0,   0,   0,   0, 
+     49,   1, 236, 177, 162, 101, 
+      1,   0,   0,   0,  70,  95, 
+     43, 225, 243, 247, 211,  77, 
+    147,  88, 197,  94, 126, 216, 
+     65, 132,   0,   0,   0,   0, 
       0,   0,   0,   0,   1,   0, 
       0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1980,9 +1980,9 @@ const BYTE UIPixelShader[] =
       3,   0, 242,  56,   1,   0, 
      43, 236,   3,   0,  28,  19, 
       2,   0,  65,  36,   1,   0, 
-    236, 179,   1,   0, 213, 174, 
+    236, 179,   1,   0, 190, 254, 
       3,   0, 125,  10,   2,   0, 
-    125, 181,   2,   0, 155, 129, 
+    125, 181,   2,   0, 204, 111, 
       2,   0, 193,  33,   3,   0, 
      65, 185,   2,   0,   9, 241, 
       2,   0, 146, 230,   3,   0, 
@@ -3000,8 +3000,8 @@ const BYTE UIPixelShader[] =
      84, 101, 120, 116, 117, 114, 
     101,  50,  68,  32, 115, 104, 
      97, 100,  27, 226,  48,   1, 
-    128,   0,   0,   0,  65, 195, 
-    133,  11, 240, 232, 217,   1, 
+    128,   0,   0,   0, 156, 225, 
+     93, 159,  56,  70, 218,   1, 
       1,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -4243,14 +4243,14 @@ const BYTE UIPixelShader[] =
       6,  16,   0,   0,  23,   0, 
       1,   0,   5,  16,   0,   0, 
      14,   0,  23,  21,   0,  16, 
-      0,   0,   3,   2,  16, 146, 
+      0,   0,   3,   2, 128, 231, 
       0,   0, 242, 241,  10,   0, 
      24,  21,   8,  16,   0,   0, 
       1,   0,   1,   0,  10,   0, 
      24,  21,   9,  16,   0,   0, 
       1,   0,   0,   2,  14,   0, 
      23,  21,   0,   0,   0,   0, 
-     10,   2,  16, 146,   0,   0, 
+     10,   2, 128, 231,   0,   0, 
     242, 241,  10,   0,  24,  21, 
      11,  16,   0,   0,   1,   0, 
       1,   0,  10,   0,  24,  21, 
@@ -5474,11 +5474,11 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1, 246,  48, 
-      6, 101,   1,   0,   0,   0, 
-    186,  68, 194,  98,  45, 234, 
-    239,  76, 143, 243, 253,  50, 
-     51, 187,  97, 209, 128,   0, 
+    148,  46,  49,   1, 236, 177, 
+    162, 101,   1,   0,   0,   0, 
+     70,  95,  43, 225, 243, 247, 
+    211,  77, 147,  88, 197,  94, 
+    126, 216,  65, 132, 128,   0, 
       0,   0,  47,  76, 105, 110, 
     107,  73, 110, 102, 111,   0, 
      47, 110,  97, 109, 101, 115, 
@@ -5578,7 +5578,7 @@ const BYTE UIPixelShader[] =
       0,   0,   2,   0,   9,   0, 
     204,   8,   0,   0,   0,   0, 
       0,   0, 164,  14,   0,   0, 
-      1,   0, 234, 205,   0,   0, 
+      1,   0,  60, 176,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,  84, 101, 
     120, 116, 117, 114, 101,  80, 

+ 15 - 15
UIVertexShader.h

@@ -121,10 +121,10 @@ ret
 
 const BYTE UIVertexShader[] =
 {
-     68,  88,  66,  67, 212,  78, 
-     20, 171, 170,   7, 103, 117, 
-    208, 222,  93, 186, 198, 209, 
-    129,   1,   1,   0,   0,   0, 
+     68,  88,  66,  67, 230,  91, 
+    185,  90,  85, 126, 145,  17, 
+     56,  74,  76, 226, 195,  73, 
+     36,  75,   1,   0,   0,   0, 
     204,  77,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
      20,   2,   0,   0, 204,   2, 
@@ -881,10 +881,10 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    246,  48,   6, 101,   1,   0, 
-      0,   0, 247, 139,  69, 221, 
-     29,  34, 124,  67, 159,  84, 
-     40, 234, 210, 161, 225,  96, 
+    236, 177, 162, 101,   1,   0, 
+      0,   0, 232,  31,  77,  65, 
+    129, 217,  37,  67, 154, 180, 
+    102,  80,  66,  28, 238, 172, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   1,   0,   0,   0, 
       1,   0,   0,   0,   0,   0, 
@@ -1564,8 +1564,8 @@ const BYTE UIVertexShader[] =
      13,  10,  47,  47,  32,  84, 
      89,  80,  69,  68,  69,  70, 
      27, 226,  48,   1, 128,   0, 
-      0,   0,  29,   3, 160,  11, 
-    240, 232, 217,   1,   1,   0, 
+      0,   0,   0, 184, 118, 159, 
+     56,  70, 218,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2929,10 +2929,10 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    246,  48,   6, 101,   1,   0, 
-      0,   0, 247, 139,  69, 221, 
-     29,  34, 124,  67, 159,  84, 
-     40, 234, 210, 161, 225,  96, 
+    236, 177, 162, 101,   1,   0, 
+      0,   0, 232,  31,  77,  65, 
+    129, 217,  37,  67, 154, 180, 
+    102,  80,  66,  28, 238, 172, 
     129,   0,   0,   0,  47,  76, 
     105, 110, 107,  73, 110, 102, 
     111,   0,  47, 110,  97, 109, 
@@ -3032,7 +3032,7 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   2,   0, 
       9,   0, 104,   5,   0,   0, 
       0,   0,   0,   0, 236,   2, 
-      0,   0,   1,   0, 144, 238, 
+      0,   0,   1,   0, 253, 254, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
      84, 101, 120, 116, 117, 114, 

+ 1 - 1
Welt2D.cpp

@@ -491,7 +491,7 @@ const WeltInfo& Welt2D::getWorldInfo() const
     return info;
 }
 
-Iterator<Object2D*> Welt2D::getMembers()
+ArrayIterator<Object2D*> Welt2D::getMembers()
 {
     return objects->begin();
 }

+ 1 - 1
Welt2D.h

@@ -203,6 +203,6 @@ namespace Framework
         DLLEXPORT void render(
             Mat3<float>& kamMat, Punkt size, Bild& zRObj, const char* kamName);
         DLLEXPORT const WeltInfo& getWorldInfo() const;
-        DLLEXPORT Iterator<Object2D*> getMembers();
+        DLLEXPORT ArrayIterator<Object2D*> getMembers();
     };
 } // namespace Framework

+ 13 - 13
XML.cpp

@@ -385,7 +385,7 @@ Element* Element::zParent() const
 }
 
 // gibt einen iterator zurück mit dem durch alle childs iteriert werden kann
-Iterator<Element*> Element::getChilds() const
+ArrayIterator<Element*> Element::getChilds() const
 {
     return children->begin();
 }
@@ -488,14 +488,14 @@ Text Element::getAttributeValue(Text attribut) const
 
 // gibt einen iterator zurück mit dem durch alle Attribut Namen iteriert werden
 // kann
-Iterator<Text*> Element::getAttributeNames() const
+ArrayIterator<Text*> Element::getAttributeNames() const
 {
     return attributes->begin();
 }
 
 // gibt einen iterator zurück mit dem durch alle Attribut Werte iteriert werden
 // kann
-Iterator<Text*> Element::getAttributeValues() const
+ArrayIterator<Text*> Element::getAttributeValues() const
 {
     return attributeValues->begin();
 }
@@ -579,12 +579,12 @@ Editor::~Editor()
     elements->release();
 }
 
-Maybe<RCPointer<Element>>
-Framework::XML::Editor::getFirstElement() const
+Maybe<RCPointer<Element>> Framework::XML::Editor::getFirstElement() const
 {
     if (this->elements->getEintragAnzahl() > 0)
     {
-        return Maybe<RCPointer<Element>>::of(RCPointer<Element>::of(this->elements->get(0)));
+        return Maybe<RCPointer<Element>>::of(
+            RCPointer<Element>::of(this->elements->get(0)));
     }
     return Maybe<RCPointer<Element>>::empty();
 }
@@ -666,13 +666,13 @@ void Editor::setText(Text text)
 }
 
 // Gibt ein Iterator durch alle Elemente zurück
-Iterator<Element*> Editor::begin()
+ArrayIterator<Element*> Editor::begin()
 {
     return elements->begin();
 }
 
 //! Gibt das ende des iterators zurück
-Iterator<Element*> Editor::end()
+ArrayIterator<Element*> Editor::end()
 {
     return elements->end();
 }
@@ -843,9 +843,9 @@ DLLEXPORT Editor& Framework::XML::Editor::operator=(const Editor& e)
 {
     if (this != &e)
     {
-		this->elements->leeren();
-		for (auto i : *e.elements)
-			this->elements->add(dynamic_cast<XML::Element*>(i->getThis()));
-	}
-	return *this;
+        this->elements->leeren();
+        for (auto i : *e.elements)
+            this->elements->add(dynamic_cast<XML::Element*>(i->getThis()));
+    }
+    return *this;
 }

+ 15 - 10
XML.h

@@ -3,9 +3,9 @@
 #include <functional>
 
 #include "Array.h"
-#include "ReferenceCounter.h"
 #include "Maybe.h"
 #include "RCPointer.h"
+#include "ReferenceCounter.h"
 
 namespace Framework
 {
@@ -72,10 +72,12 @@ namespace Framework
             //! gibt die Anzahl der Childs zurück
             DLLEXPORT int getChildCount() const;
             /// <summary>
-            /// returns the index of the zChild in the list of children or -1 if zChild is not a child of this element
+            /// returns the index of the zChild in the list of children or -1 if
+            /// zChild is not a child of this element
             /// </summary>
             /// <param name="zChild">the child element to search for</param>
-            /// <returns>the index of zChild in the list of children or -1 if zChild is not a child of this element</returns>
+            /// <returns>the index of zChild in the list of children or -1 if
+            /// zChild is not a child of this element</returns>
             DLLEXPORT int getChildIndex(Element* zChild) const;
             //! gibt das i-te child zurück
             DLLEXPORT Element* getChild(int i) const;
@@ -87,7 +89,7 @@ namespace Framework
             DLLEXPORT Element* zParent() const;
             //! gibt einen iterator zurück mit dem durch alle childs iteriert
             //! werden kann
-            DLLEXPORT Iterator<Element*> getChilds() const;
+            DLLEXPORT ArrayIterator<Element*> getChilds() const;
             //! gibt einen Editor für dieses Element zurück
             DLLEXPORT Editor select();
             //! gibt einen selector zurück der alle childs beinhaltet
@@ -116,10 +118,10 @@ namespace Framework
             DLLEXPORT Text getAttributeValue(Text attribut) const;
             //! gibt einen iterator zurück mit dem durch alle Attribut Namen
             //! iteriert werden kann
-            DLLEXPORT Iterator<Text*> getAttributeNames() const;
+            DLLEXPORT ArrayIterator<Text*> getAttributeNames() const;
             //! gibt einen iterator zurück mit dem durch alle Attribut Werte
             //! iteriert werden kann
-            DLLEXPORT Iterator<Text*> getAttributeValues() const;
+            DLLEXPORT ArrayIterator<Text*> getAttributeValues() const;
             //! gibt den Namen des Elementes zurück zurück
             DLLEXPORT Text getName() const;
             //! erzeugt einen XML Text der dieses Element und alle childs
@@ -146,7 +148,8 @@ namespace Framework
             /// <summary>
             /// returns the first element in the list
             /// </summary>
-            /// <returns> the first element of a list or an empty object if no elements are present</returns>
+            /// <returns> the first element of a list or an empty object if no
+            /// elements are present</returns>
             DLLEXPORT Maybe<RCPointer<Element>> getFirstElement() const;
             //! ändert ein attribut oder fügt eines hinzu (auf allen elementen
             //! in der Liste) \param attribut Der Name des Attributes \param
@@ -176,10 +179,12 @@ namespace Framework
             //! allen elementen in der Liste) \param text dert Text
             DLLEXPORT void setText(Text text);
             //! Gibt ein Iterator durch alle Elemente zurück
-            DLLEXPORT Iterator<Element*> begin();
+            DLLEXPORT ArrayIterator<Element*> begin();
             //! Gibt das ende des iterators zurück
-            DLLEXPORT Iterator<Element*> end();
-            //! Gibt einen selector zurück der alle elemente beinhaltet die in diesem selector vorkommen und rekursiv alle Kinder der elemente Enthält
+            DLLEXPORT ArrayIterator<Element*> end();
+            //! Gibt einen selector zurück der alle elemente beinhaltet die in
+            //! diesem selector vorkommen und rekursiv alle Kinder der elemente
+            //! Enthält
             DLLEXPORT Editor selectAllElements();
             //! gibt einen selector zurück der alle childs beinhaltet
             DLLEXPORT Editor selectChildren() const;