summaryrefslogtreecommitdiffstats
path: root/libdimensionxx/dimensionxx/object.hpp
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-07-11 16:54:58 +0000
committerTavian Barnes <tavianator@gmail.com>2009-07-11 16:54:58 +0000
commit249203127d1ae989785978024ef0ad25bc994384 (patch)
treedf20ef109ae5435b0fa6ccd6219fa03ab2ef1a86 /libdimensionxx/dimensionxx/object.hpp
parentca84516fa80cfca35da7df71ea04423780028212 (diff)
downloaddimension-249203127d1ae989785978024ef0ad25bc994384.tar.xz
Allow Array's of non-POD types through specialized Array_Element class.
Diffstat (limited to 'libdimensionxx/dimensionxx/object.hpp')
-rw-r--r--libdimensionxx/dimensionxx/object.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/libdimensionxx/dimensionxx/object.hpp b/libdimensionxx/dimensionxx/object.hpp
index 8283c9c..30dadf8 100644
--- a/libdimensionxx/dimensionxx/object.hpp
+++ b/libdimensionxx/dimensionxx/object.hpp
@@ -78,6 +78,25 @@ namespace Dimension
virtual Array<double> intersections(const Line& l) = 0;
virtual bool inside(const Vector& point) = 0;
};
+
+ // Array_Element specialization
+ template <>
+ class Array_Element<Object>
+ : public Polymorphic_Array_Element<Object, dmnsn_object*>
+ {
+ public:
+ typedef dmnsn_object* C_Type;
+
+ Array_Element() { }
+ Array_Element(Object& object)
+ : Polymorphic_Array_Element<Object, dmnsn_object*>(object) { }
+ Array_Element(C_Type c)
+ : Polymorphic_Array_Element<Object, dmnsn_object*>(c) { }
+ // Array_Element(const Array_Element& ae);
+ // ~Array_Element();
+
+ // Array_Element& operator=(const Array_Element& ae);
+ };
}
#endif /* DIMENSIONXX_OBJECT_HPP */