diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-09-25 09:41:17 -0700 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-09-25 09:41:17 -0700 |
commit | 753402a84b40ff4dc9697dea1d2d4aa037ea7624 (patch) | |
tree | 9ff5e95a534265d01ae732a1e39dd3aaf3127803 /include | |
parent | 49ac629257835426c311fb7b92b23a9138a9d77b (diff) |
Constructor gets almost called when object is constructed
Diffstat (limited to 'include')
-rw-r--r-- | include/classinfo.h | 44 | ||||
-rw-r--r-- | include/value.h | 8 |
2 files changed, 40 insertions, 12 deletions
diff --git a/include/classinfo.h b/include/classinfo.h index dfa480c..3941259 100644 --- a/include/classinfo.h +++ b/include/classinfo.h @@ -12,6 +12,11 @@ */ /** + * Forward declarations + */ +struct _zend_class_entry; + +/** * Namespace */ namespace Php { @@ -26,9 +31,34 @@ class _ClassInfo { public: /** + * Constructor + * @param name + */ + _ClassInfo(const char *name) : _name(name), _entry(NULL) {} + + /** + * Destructor + */ + virtual ~_ClassInfo() {} + + /** * Initialize the class */ - virtual void initialize() = 0; + void initialize(); + +private: + /** + * Class name + * @var string + */ + std::string _name; + + /** + * The class entry + * @var zend_class_entry + */ + struct _zend_class_entry *_entry; + }; /** @@ -43,7 +73,7 @@ public: * @param name Name of the class * @param type The class type */ - ClassInfo(const char *name, const Class<T> &type) : _name(name), _type(type) + ClassInfo(const char *name, const Class<T> &type) : _ClassInfo(name), _type(type) { } @@ -52,19 +82,9 @@ public: */ virtual ~ClassInfo() {} - /** - * Initialize the class - */ - virtual void initialize(); private: /** - * Class name - * @var string - */ - std::string _name; - - /** * The class object * @var Class */ diff --git a/include/value.h b/include/value.h index e29b8f2..f47304a 100644 --- a/include/value.h +++ b/include/value.h @@ -500,6 +500,14 @@ protected: }; /** + * Custom output stream operator + * @param stream + * @param value + * @return ostream + */ +std::ostream &operator<<(std::ostream &stream, const Value &value); + +/** * End of namespace */ } |