| 7 | |
| 8 | |
| 9 | class VirtualArray : public hx::ObjectPtr<VirtualArray_obj> |
| 10 | { |
| 11 | typedef hx::ObjectPtr<VirtualArray_obj> super; |
| 12 | public: |
| 13 | typedef Dynamic Elem; |
| 14 | |
| 15 | inline VirtualArray() : super(0) { } |
| 16 | inline VirtualArray(VirtualArray_obj *inObj) : super(inObj) { } |
| 17 | inline VirtualArray(const null &inNull) : super(0) { } |
| 18 | inline VirtualArray(const VirtualArray &inOther) : super( inOther.mPtr ) { } |
| 19 | |
| 20 | // Build from foreign array |
| 21 | template<typename SOURCE_> inline VirtualArray( const Array<SOURCE_> &inRHS ); |
| 22 | |
| 23 | |
| 24 | inline VirtualArray( const Dynamic &inRHS ) : super(0) { setDynamic(inRHS); } |
| 25 | inline VirtualArray( const cpp::ArrayBase &inRHS ) : super(0) { setDynamic(inRHS); } |
| 26 | inline VirtualArray(const ::cpp::Variant &inVariant) { setDynamic(inVariant.asObject()); } |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | inline VirtualArray &operator=(const null &inNull) { mPtr = 0; return *this; } |
| 32 | inline VirtualArray &operator=(Ptr inRHS) { mPtr = inRHS; return *this; } |
| 33 | inline VirtualArray &operator=(const VirtualArray &inRHS) { mPtr = inRHS.mPtr; return *this; } |
| 34 | |
| 35 | inline void setDynamic( const Dynamic &inRHS ); |
| 36 | |
| 37 | template<typename T> |
| 38 | inline VirtualArray Add(const T &inVal); |
| 39 | |
| 40 | |
| 41 | inline bool operator==(const Dynamic &value) const { return value==*this; } |
| 42 | template<typename SOURCE_> inline bool operator==( const Array<SOURCE_> &inRHS ); |
| 43 | |
| 44 | inline bool operator!=(Dynamic value) const { return value!=*this; } |
| 45 | template<typename SOURCE_> inline bool operator!=( const Array<SOURCE_> &inRHS ) { return inRHS!=*this; } |
| 46 | |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | |