summaryrefslogtreecommitdiff
path: root/include/member.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-10-14 02:46:52 -0700
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-10-14 02:46:52 -0700
commit53272534a76a9d8cbee4ee887e1f360c4a99728b (patch)
tree54206aca1cfa1461ba365b05e5848f2843be91b9 /include/member.h
parent777eb276f635c949ccdcf9613ad55d42190cb387 (diff)
The initial class properties can now only be scalar values, just like in PHP
Diffstat (limited to 'include/member.h')
-rw-r--r--include/member.h93
1 files changed, 87 insertions, 6 deletions
diff --git a/include/member.h b/include/member.h
index 4a9a754..5043ead 100644
--- a/include/member.h
+++ b/include/member.h
@@ -18,6 +18,11 @@ struct _zend_class_entry;
namespace Php {
/**
+ * Forward declarations
+ */
+class MemberInfo;
+
+/**
* Class definition
*/
class Member
@@ -27,15 +32,90 @@ public:
* Constructor
* @param name Name of the member
* @param pub Is this a public property (otherwise it is protected)
+ */
+ Member(const char *name, bool pub);
+
+ /**
+ * Constructor
+ * @param name Name of the member
+ * @param pub Is this a public property (otherwise it is protected)
+ * @param value The value to add
+ */
+ Member(const char *name, bool pub, std::nullptr_t value);
+
+ /**
+ * Constructor
+ * @param name Name of the member
+ * @param pub Is this a public property (otherwise it is protected)
+ * @param value The value to add
+ */
+ Member(const char *name, bool pub, int value);
+
+ /**
+ * Constructor
+ * @param name Name of the member
+ * @param pub Is this a public property (otherwise it is protected)
+ * @param value The value to add
+ */
+ Member(const char *name, bool pub, long value);
+
+ /**
+ * Constructor
+ * @param name Name of the member
+ * @param pub Is this a public property (otherwise it is protected)
+ * @param value The value to add
+ */
+ Member(const char *name, bool pub, bool value);
+
+ /**
+ * Constructor
+ * @param name Name of the member
+ * @param pub Is this a public property (otherwise it is protected)
* @param value The value to add
*/
- Member(const char *name, bool pub, const Value &value) :
- _name(name), _public(pub), _value(value) {}
+ Member(const char *name, bool pub, char value);
+
+ /**
+ * Constructor
+ * @param name Name of the member
+ * @param pub Is this a public property (otherwise it is protected)
+ * @param value The value to add
+ */
+ Member(const char *name, bool pub, const std::string &value);
+
+ /**
+ * Constructor
+ * @param name Name of the member
+ * @param pub Is this a public property (otherwise it is protected)
+ * @param value The value to add
+ * @param size String length
+ */
+ Member(const char *name, bool pub, const char *value, int size = -1);
+
+ /**
+ * Constructor
+ * @param name Name of the member
+ * @param pub Is this a public property (otherwise it is protected)
+ * @param value The value to add
+ */
+ Member(const char *name, bool pub, double value);
+
+ /**
+ * Copy constructor
+ * @param member The member to copy
+ */
+ Member(const Member &member);
+
+ /**
+ * Move constructor
+ * @param member The member to move
+ */
+ Member(Member &&member);
/**
* Destructor
*/
- virtual ~Member() {}
+ virtual ~Member();
/**
* Internal method to declare the property
@@ -58,10 +138,11 @@ private:
bool _public;
/**
- * The default value
- * @var Value
+ * The implementation for the member
+ * @var MemberInfo
*/
- Value _value;
+ MemberInfo *_info;
+
};