Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / ModelAPI / ModelAPI_Iterator.h
1 // File:        ModelAPI_Iterator.hxx
2 // Created:     1 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef ModelAPI_Iterator_HeaderFile
6 #define ModelAPI_Iterator_HeaderFile
7
8 #include "ModelAPI.h"
9 #include <string>
10 #include <memory>
11
12 class ModelAPI_Feature;
13 class ModelAPI_Document;
14
15 /**\class ModelAPI_Iterator
16  * \ingroup DataModel
17  * \brief Allows to iterate features of the document. Is created by the document
18  * (see method featuresIterator).
19  */
20
21 class MODELAPI_EXPORT ModelAPI_Iterator
22 {
23 public:
24   /// Iterates to the next feature
25   virtual void next() = 0;
26   /// Returns true if the current iteration is valid and next iteration is possible
27   virtual bool more() = 0;
28   /// Returns the currently iterated feature
29   virtual std::shared_ptr<ModelAPI_Feature> current() = 0;
30   /// Returns the kind of the current feature (faster than Current()->getKind())
31   virtual std::string currentKind() = 0;
32   /// Returns the name of the current feature (faster than Current()->getName())
33   virtual std::string currentName() = 0;
34   /// Don't changes the current position of iterator. Not fast: iterates the left items.
35   /// \returns number of left iterations
36   virtual int numIterationsLeft() = 0;
37
38 protected:
39   /// Use plugin manager for features creation: this method is 
40   /// defined here only for SWIG-wrapping
41   ModelAPI_Iterator()
42   {}
43 };
44
45 #endif