summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authorMartijn Otto <martijn.otto@copernica.com>2015-03-26 16:00:10 +0100
committerMartijn Otto <martijn.otto@copernica.com>2015-03-26 16:00:10 +0100
commit7a928e2b19bddf152fd838469cc50805d4132401 (patch)
tree0a6657f4b94c27556b2f218e407f752018540d3b /include/base.h
parentae4fa5f871d937773e9facde87a32784e715e3ae (diff)
Changed default visibility for symbols in the PHP-CPP library to hidden and explicitly exported all symbols available from the public API. Moved the hiddenpointer to the zend implementation directory as it is not meant to be used publicly and not referenced anywhere from the API anyway
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h85
1 files changed, 42 insertions, 43 deletions
diff --git a/include/base.h b/include/base.h
index 417aef0..1a1643b 100644
--- a/include/base.h
+++ b/include/base.h
@@ -19,7 +19,7 @@ class ObjectImpl;
/**
* Class definition
*/
-class Base
+class PHPCPP_EXPORT Base
{
private:
/**
@@ -27,7 +27,7 @@ private:
* @var ObjectImpl
*/
ObjectImpl *_impl = nullptr;
-
+
protected:
/**
* Constructor
@@ -36,16 +36,16 @@ protected:
/**
* Copy constructor
- *
+ *
* This copy constructor is explicitly defined to make sure that the
* copied object does not already have an implementation in the zend engine.
* Otherwise the copied object has the same object handle as the original
* object.
- *
+ *
* @param base
*/
Base(const Base &base) : _impl(nullptr) {}
-
+
public:
/**
* Virtual destructor
@@ -71,7 +71,7 @@ public:
{
return Value(this)[name];
}
-
+
/**
* Retrieve a property by name
* @param string
@@ -81,7 +81,7 @@ public:
{
return Value(this)[name];
}
-
+
/**
* Retrieve a property by name
* @param string
@@ -111,7 +111,7 @@ public:
{
return Value(this).get(name);
}
-
+
/**
* Retrieve a property by name
* @param string
@@ -121,7 +121,7 @@ public:
{
return Value(this).get(name);
}
-
+
/**
* Retrieve a property by name
* @param string
@@ -131,7 +131,7 @@ public:
{
return Value(this).get(name);
}
-
+
/**
* Overridable method that is called right before an object is destructed
*/
@@ -139,61 +139,61 @@ public:
/**
* Overridable method that is called right after an object is cloned
- *
+ *
* The default implementation does nothing
*/
void __clone() const {}
-
+
/**
* Overridable method that is called to check if a property is set
- *
+ *
* The default implementation does nothing, and the script will fall back
* to accessing the regular object properties
- *
+ *
* @param key
* @return bool
*/
bool __isset(const Php::Value &key) const;
-
+
/**
* Overridable method that is called to set a new property
- *
+ *
* The default implementation does nothing, and the script will fall back
* to accessing the regular object properties
- *
+ *
* @param key
* @param value
*/
void __set(const Php::Value &key, const Php::Value &value) const;
-
+
/**
* Retrieve a property
- *
+ *
* The default implementation does nothing, and the script will fall back
* to accessing the regular object properties
- *
+ *
* @param key
* @return value
*/
Php::Value __get(const Php::Value &key) const;
-
+
/**
* Remove a member
- *
+ *
* The default implementation does nothing, and the script will fall back
* to accessing the regular object properties
- *
+ *
* @param key
*/
void __unset(const Php::Value &key) const;
/**
* Call a method
- *
+ *
* This method is called when a method is called from the PHP script that
* was not explicitly defined. You can use this to catch variable method
* names, or to support all thinkable method names.
- *
+ *
* @param method Name of the method that was called
* @param params The parameters that were passed to the function
* @return Value The return value
@@ -202,65 +202,65 @@ public:
/**
* Call the class as if it was a function
- *
+ *
* This method is called when a an object is used with () operators:
* $object(). You can override this method to make objects callable.
- *
+ *
* @param params The parameters that were passed to the function
* @return Value The return value
*/
Php::Value __invoke(Php::Parameters &params) const;
-
+
/**
* Cast the object to a string
- *
+ *
* This method is called when an object is casted to a string, or when
* it is used in a string context
- *
+ *
* @return Value The object as a string
*/
Php::Value __toString() const;
-
+
/**
* Cast the object to an integer
- *
+ *
* This method is called when an object is casted to an integer, or when
* it is used in an integer context
- *
+ *
* @return int Integer value
*/
Php::Value __toInteger() const;
-
+
/**
* Cast the object to a float
- *
+ *
* This method is called when an object is casted to a float, or when it
* is used in a float context
- *
+ *
* @return double Floating point value
*/
Php::Value __toFloat() const;
-
+
/**
* Cast the object to a boolean
- *
+ *
* This method is called when an object is casted to a bool, or when it
* is used in a boolean context
- *
+ *
* @return bool
*/
Value __toBool() const;
/**
* Compare the object with a different object
- *
+ *
* Check how a different object compares to this object
- *
+ *
* @param that Object to compare with
* @return int
*/
int __compare(const Base &base) const;
-
+
private:
/**
@@ -284,4 +284,3 @@ private:
* End of namespace
*/
}
-