summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-02 11:33:53 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-02 11:33:53 +0100
commit52fe0c39457421e075959179ee6b64a20b96f0d9 (patch)
treee6dd000114d104bf6286d74682feb694b3cb97a3 /include/base.h
parentfa02aa127d2c4261d15123829e44f6d997444abc (diff)
types are not a C++11 class, introduced FixedValue class that can not change type, and implemented both Object and Array to make use of that type, implemented - but not yet tested - Base::value() method
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h48
1 files changed, 16 insertions, 32 deletions
diff --git a/include/base.h b/include/base.h
index df4076b..93ee66e 100644
--- a/include/base.h
+++ b/include/base.h
@@ -15,59 +15,43 @@ namespace Php {
*/
class Base
{
-public:
+protected:
/**
* Constructor
*/
Base() {}
+public:
/**
* Virtual destructor
*/
virtual ~Base() {}
/**
- * The pseudo constructor that is called from PHP after the object is constructed
- * @param parameters
+ * Convert the object to a Php::Value object (how it is used externally)
+ * @return Value
*/
- virtual void __construct(const Parameters &parameters)
- {
- // call all other possible implementations
- __construct();
- }
+ Value value() const;
/**
- * The pseudo constructor that is called from PHP after the object is constructed
- */
- virtual void __construct() {}
-
- /**
- * The pseudo destructor that is called from PHP right before the object is destructed
- */
- virtual void __destruct() {}
-
- /**
* Get access to a property by name
* @param string
- * @return Property
+ * @return Value
*/
-// Property operator[](const char *name);
-
+ Value operator[](const char *name) const
+ {
+ return value()[name];
+ }
+
/**
* Alternative way to access a property
* @param string
- * @return Property
+ * @return Value
*/
-// Property operator[](const std::string &name);
-
-protected:
- /**
- * All properties of the object
- * @var Properties
- */
-// Properties _properties;
-
-private:
+ Value operator[](const std::string &name) const
+ {
+ return value()[name];
+ }
};