summaryrefslogtreecommitdiffstats
path: root/engine/include/collector.hpp
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2019-01-25 01:11:57 +0100
committerNao Pross <naopross@thearcway.org>2019-01-25 01:11:57 +0100
commitbcd14a356cafe58808b4c2a14782ebb194c6abc5 (patch)
tree3bc95288b0a0172bb447ccf218fb59821f22501a /engine/include/collector.hpp
parentDelete bin and test/makefile update .gitignore (diff)
downloadflatland-bcd14a356cafe58808b4c2a14782ebb194c6abc5.tar.gz
flatland-bcd14a356cafe58808b4c2a14782ebb194c6abc5.zip
Rename everything under engine/ to remove `flat' and be `.hpp'
Diffstat (limited to 'engine/include/collector.hpp')
-rw-r--r--engine/include/collector.hpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/engine/include/collector.hpp b/engine/include/collector.hpp
new file mode 100644
index 0000000..5b1e718
--- /dev/null
+++ b/engine/include/collector.hpp
@@ -0,0 +1,45 @@
+#ifndef __FLATCOLLECTOR_H__
+#define __FLATCOLLECTOR_H__
+
+#include "core/object.hpp"
+#include <set>
+
+class FlatCollector : virtual public flat::core::object
+{
+ FlatCollector * parent;
+
+ bool released;
+
+ std::set<FlatCollector*> children;
+
+public:
+
+ FlatCollector(FlatCollector *parent = 0);
+
+ virtual ~FlatCollector();
+
+ /* Ownership functions */
+
+ bool isReleased() const;
+
+ /* Release object from automatic ownership destruction */
+ void release();
+
+ void attach(FlatCollector*);
+ void detach(FlatCollector*);
+
+ void setParent(FlatCollector*);
+ void releaseParent();
+
+ FlatCollector * getParent();
+
+ bool isParentOf(FlatCollector*) const;
+
+ std::set<FlatCollector*>::iterator begin();
+ std::set<FlatCollector*>::iterator end();
+
+ std::set<FlatCollector*>::const_iterator begin() const;
+ std::set<FlatCollector*>::const_iterator end() const;
+};
+
+#endif