summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-02 23:28:10 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-02 23:28:10 +0100
commit8f24af4c28e74ef1769aef6ab00c480e09be7453 (patch)
treec73b7de11abbdd8ed2d3f3fa5b63fdd2a1409cb8 /include/base.h
parentf7dcf5d81fa1e43533c786d9443e5222398dc8b9 (diff)
work in progress to support implementing SPL interfaces, disabled the _self variable in Php::Base because by having each object keeping a reference to itself, the refcounter never reached zero and the object was thus never destructed, checking if we can get a new implementation one way or another
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h108
1 files changed, 43 insertions, 65 deletions
diff --git a/include/base.h b/include/base.h
index 7d7be98..46f5678 100644
--- a/include/base.h
+++ b/include/base.h
@@ -22,6 +22,11 @@ protected:
Base() {}
public:
+
+ // @todo should we delete the copy and move operators because we do not
+ // allow the CPP code to make copies of itself?
+
+
/**
* Virtual destructor
*/
@@ -31,122 +36,95 @@ public:
* Convert the object to a Php::Value object (how it is used externally)
* @return Object
*/
- Object &value()
- {
- return _self;
- }
+// Object value();
/**
* Convert the object to a Php::Value object (how it is used externally)
* @return Object
*/
- const Object &value() const
- {
- return _self;
- }
+// Object value() const;
/**
* Get access to a property by name using the [] operator
* @param string
- * @return Value
+ * @return HashMember
*/
- Value operator[](const char *name)
- {
- return _self[name];
- }
+// HashMember<std::string> operator[](const char *name)
+// {
+// return value()[name];
+// }
/**
* Alternative way to access a property using the [] operator
* @param string
- * @return Value
+ * @return HashMember
*/
- Value operator[](const std::string &name)
- {
- return _self[name];
- }
+// HashMember<std::string> operator[](const std::string &name)
+// {
+// return value()[name];
+// }
/**
* Retrieve a property by name
* @param string
- * @return Value
+ * @return HashMember
*/
- Value property(const char *name)
- {
- return _self[name];
- }
+// HashMember<std::string> property(const char *name)
+// {
+// return value()[name];
+// }
/**
* Retrieve a property by name
* @param string
- * @return Value
+ * @return HashMember
*/
- Value property(const std::string &name)
- {
- return _self[name];
- }
+// HashMember<std::string> property(const std::string &name)
+// {
+// return value()[name];
+// }
/**
* Get access to a property by name using the [] operator
* @param string
* @return Value
*/
- Value operator[](const char *name) const
- {
- return _self[name];
- }
+// Value operator[](const char *name) const
+// {
+// return value()[name];
+// }
/**
* Alternative way to access a property using the [] operator
* @param string
* @return Value
*/
- Value operator[](const std::string &name) const
- {
- return _self[name];
- }
+// Value operator[](const std::string &name) const
+// {
+// return value()[name];
+// }
/**
* Retrieve a property by name
* @param string
* @return Value
*/
- Value property(const char *name) const
- {
- return _self[name];
- }
+// Value property(const char *name) const
+// {
+// return value()[name];
+// }
/**
* Retrieve a property by name
* @param string
* @return Value
*/
- Value property(const std::string &name) const
- {
- return _self[name];
- }
+// Value property(const std::string &name) const
+// {
+// return value()[name];
+// }
-protected:
- /**
- * The zend_object
- * @var Value
- */
- Object _self;
-
private:
- /**
- * Private method to assign the zend object
- * @param zend_object
- */
- void assign(Value &&object)
- {
- // copy pointer
- _self = std::move(object);
- }
-
- /**
- * ClassBase has access to private data
- */
- friend class ClassBase;
};