diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-09-25 14:59:58 -0700 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-09-25 14:59:58 -0700 |
commit | ffdaa0590d33ea89d116f6c56df2474cc0675ec9 (patch) | |
tree | 6b0d71337879892b43a4af90e6757d53ecc77853 /include/base.h | |
parent | 753402a84b40ff4dc9697dea1d2d4aa037ea7624 (diff) |
{auto} PHP objects can now be implemented in C++. Constructors and destructors get called at the appropriate time, but not yet any of the other methods
Diffstat (limited to 'include/base.h')
-rw-r--r-- | include/base.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/base.h b/include/base.h index eceb114..797aff6 100644 --- a/include/base.h +++ b/include/base.h @@ -17,6 +17,11 @@ class Base { public: /** + * Virtual destructor + */ + virtual ~Base() {} + + /** * The pseudo constructor that is called from PHP after the object is constructed * @param environment * @param parameters @@ -46,6 +51,20 @@ public: */ virtual void __construct() {} + /** + * The pseudo destructor that is called from PHP right before the object is destructed + * @param environment + */ + virtual void __destruct(Environment &environment) + { + // call the other implementation + __destruct(); + } + + /** + * The pseudo destructor that is called from PHP right before the object is destructed + */ + virtual void __destruct() {} }; |