Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Curioni <maxime.curioni@gmail.com>2008-07-23 14:19:08 +0400
committerMaxime Curioni <maxime.curioni@gmail.com>2008-07-23 14:19:08 +0400
commitd1b82d1f15a04a7c2383f0689ceede94971f4b81 (patch)
tree0c94a3a7fb5c23d144395a75567715a224996c8a /source/blender/freestyle/intern/system/Iterator.h
parenta9789d90ae7c4408684490844ee9edf37ae84f65 (diff)
soc-2008-mxcurioni: added Iterator class, base class for all iterators in Freestyle (on the C++ side). Created the equivalent in Python BPy_Iterator with the simple interface:
- getExactTypeName() - increment() - decrement() - isBegin() - isEnd() Contrary to previously stated, I am reverting back to implementing iterators in the (Python) API, for different reasons: - it will make testing quicker to achieve, as I won't have to recode a big chunk of the original Python files - it will be a base for API refactoring - it won't prevent the use a list-based approach later (it is simple to get it from the Iterator)
Diffstat (limited to 'source/blender/freestyle/intern/system/Iterator.h')
-rw-r--r--source/blender/freestyle/intern/system/Iterator.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/system/Iterator.h b/source/blender/freestyle/intern/system/Iterator.h
new file mode 100644
index 00000000000..10862d7c8da
--- /dev/null
+++ b/source/blender/freestyle/intern/system/Iterator.h
@@ -0,0 +1,38 @@
+#ifndef ITERATOR_H
+#define ITERATOR_H
+
+#include <iostream>
+#include <string>
+using namespace std;
+
+class Iterator
+{
+public:
+
+ virtual ~Iterator() {}
+
+ virtual string getExactTypeName() const {
+ return "Iterator";
+ }
+
+ virtual void increment() {
+ cerr << "Warning: method increment() not implemented" << endl;
+ }
+
+ virtual void decrement() {
+ cerr << "Warning: method decrement() not implemented" << endl;
+ }
+
+ virtual bool isBegin() const {
+ cerr << "Warning: method isBegin() not implemented" << endl;
+ return false;
+ }
+
+ virtual bool isEnd() const {
+ cerr << "Warning: method isEnd() not implemented" << endl;
+ return false;
+ }
+
+};
+
+#endif // ITERATOR_H \ No newline at end of file