diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-13 23:54:54 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-13 23:54:54 +0100 |
commit | 681d1e6aa735568a492140d2307a89063e7aadb9 (patch) | |
tree | 98fa482ee64203b1ef75fb0e7c687d57f1abe20f /include/class.h | |
parent | 684f81e8bcbadc3d522e6557161275deaad4fd3b (diff) |
__clone() method is now called directly after a clone operation (and when no custom __clone is registered)
Diffstat (limited to 'include/class.h')
-rw-r--r-- | include/class.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/include/class.h b/include/class.h index 9fa14a7..f8e3365 100644 --- a/include/class.h +++ b/include/class.h @@ -235,6 +235,32 @@ private: } /** + * Call the __clone method + * @param base + */ + virtual void callClone(Base *base) const + { + // cast to the user object + T *object = (T *)base; + + // call the method on the base object + return object->__clone(); + } + + /** + * Call the __destruct method + * @param base + */ + virtual void callDestruct(Base *base) const + { + // cast to the user object + T *object = (T *)base; + + // call the method on the base object + return object->__destruct(); + } + + /** * Call a method * @param base Object to call on * @param name Name of the method @@ -247,7 +273,7 @@ private: T *object = (T *)base; // call the method on the base object - return base->__call(name, params); + return object->__call(name, params); } /** |