diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-02 11:33:53 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-02 11:33:53 +0100 |
commit | 52fe0c39457421e075959179ee6b64a20b96f0d9 (patch) | |
tree | e6dd000114d104bf6286d74682feb694b3cb97a3 /include/hiddenpointer.h | |
parent | fa02aa127d2c4261d15123829e44f6d997444abc (diff) |
types are not a C++11 class, introduced FixedValue class that can not change type, and implemented both Object and Array to make use of that type, implemented - but not yet tested - Base::value() method
Diffstat (limited to 'include/hiddenpointer.h')
-rw-r--r-- | include/hiddenpointer.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/hiddenpointer.h b/include/hiddenpointer.h index 93fdc7c..cf6bea0 100644 --- a/include/hiddenpointer.h +++ b/include/hiddenpointer.h @@ -81,6 +81,16 @@ public: } /** + * Move constructor + * @param that + */ + HiddenPointer(HiddenPointer<Type> &&that) : _allocated(that._allocated), _buffer(that._buffer) + { + // the other object is no longer allocated + that._allocated = false; + } + + /** * Destructor */ virtual ~HiddenPointer() @@ -141,6 +151,16 @@ public: return _buffer + sizeof(Type *); } + /** + * Derefence the pointer + * @return Type* + */ + Type *operator->() const + { + // type is stored in front of the buffer + return *((Type **)_buffer); + } + private: /** * Buffer that holds both the pointer and the text - the text starts |