summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-02 23:21:16 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-02 23:21:16 +0200
commit2e4318b5ecae22b6bc0f04dfc116ff3e4647b1e8 (patch)
treed93a7d146fb0555b45e70780ac69f6df6dedcc3a /src
parenta3bd6dc04d5210ddeffdda5884f51c0e5b37ec27 (diff)
it now is possible to register a class as base class (although not yet working) (request from issue #52)
Diffstat (limited to 'src')
-rw-r--r--src/classbase.cpp6
-rw-r--r--src/classimpl.h11
2 files changed, 17 insertions, 0 deletions
diff --git a/src/classbase.cpp b/src/classbase.cpp
index c753c34..18d81d5 100644
--- a/src/classbase.cpp
+++ b/src/classbase.cpp
@@ -118,6 +118,12 @@ void ClassBase::property(const char *name, const getter_callback_1 &getter, cons
void ClassBase::implements(const ClassBase &interface) { _impl->implements(interface._impl); }
/**
+ * Set the base class
+ * @param base Php::Class object that is the base
+ */
+void ClassBase::extends(const ClassBase &base) { _impl->extends(base._impl); }
+
+/**
* End namespace
*/
}
diff --git a/src/classimpl.h b/src/classimpl.h
index 03dc548..4da4eba 100644
--- a/src/classimpl.h
+++ b/src/classimpl.h
@@ -78,6 +78,12 @@ private:
* @var std::list
*/
std::list<std::shared_ptr<ClassImpl>> _interfaces;
+
+ /**
+ * The parent/base class
+ * @var std::shared_ptr
+ */
+ std::shared_ptr<ClassImpl> _parent;
/**
@@ -407,6 +413,11 @@ public:
*/
void implements(const std::shared_ptr<ClassImpl> &interface) { _interfaces.push_back(interface); }
+ /**
+ * Set the base class
+ * @param base The base class
+ */
+ void extends(const std::shared_ptr<ClassImpl> &base) { _parent = base; }
};