summaryrefslogtreecommitdiff
path: root/include/classbase.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-13 09:50:10 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-13 09:50:10 +0100
commit9df186180f25313d2182ef7a0bb807875888892c (patch)
tree723d667aef52ef4e57ea252bb780145f651490aa /include/classbase.h
parent01fa31d24d6669ee30ccb897a0a7f438bcbe59f0 (diff)
added serializable class (but not yet implemented it)
Diffstat (limited to 'include/classbase.h')
-rw-r--r--include/classbase.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/classbase.h b/include/classbase.h
index 814feaf..cc69a91 100644
--- a/include/classbase.h
+++ b/include/classbase.h
@@ -20,6 +20,8 @@
struct _zend_object_value;
struct _zend_object_handlers;
struct _zend_class_entry;
+struct _zend_serialize_data;
+struct _zend_unserialize_data;
union _zend_function;
/**
@@ -132,6 +134,12 @@ public:
virtual bool traversable() const = 0;
/**
+ * Is this a serializable class?
+ * @return bool
+ */
+ virtual bool serializable() const = 0;
+
+ /**
* Initialize the class, given its name
*
* The module functions are registered on module startup, but classes are
@@ -426,6 +434,18 @@ private:
static int compare(struct _zval_struct *object1, struct _zval_struct *object2);
/**
+ * Methods that are called to serialize/unserialize an object
+ * @param object The object to be serialized
+ * @param entry The class entry to which the object belongs
+ * @param buffer Buffer in which to store the data
+ * @param buf_len Size of the bufffer
+ * @param data Structure describing the serialize/unserialize data
+ * @return int
+ */
+ static int serialize(struct _zval_struct *object, unsigned char **buffer, zend_uint *buf_len, struct _zend_serialize_data *data);
+ static int unserialize(struct _zval_struct **object, struct _zend_class_entry *entry, const unsigned char *buffer, zend_uint buf_len, struct _zend_unserialize_data *data);
+
+ /**
* Name of the class
* @var string
*/