summaryrefslogtreecommitdiff
path: root/include/function.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/function.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/function.h')
-rw-r--r--include/function.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/include/function.h b/include/function.h
index e6693d7..cc8ad02 100644
--- a/include/function.h
+++ b/include/function.h
@@ -1,24 +1,24 @@
/**
* Function.h
- *
- * Small extension to the Value class that allows a value to be
- * constructed with a std::function.
- *
+ *
+ * Small extension to the Value class that allows a value to be
+ * constructed with a std::function.
+ *
* If you want to assign a std::function to a value, the following
* piece of code won't work:
- *
+ *
* Php::Value value([]() { .... });
- *
+ *
* Because the passed in function would match with many of the possible
- * Value constructors. For that reason we have created a small and
+ * Value constructors. For that reason we have created a small and
* simple Function class that can be used instead:
- *
+ *
* Php::Function valu([]() { .... });
- *
+ *
* A Php::Function is an extended Php::Value object, so can be used
* in place of Php::Values all the time. The only difference is that
* it has a different constructor
- *
+ *
* @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
* @copyright 2015 Copernica BV
*/
@@ -27,11 +27,11 @@
* Set up namespace
*/
namespace Php {
-
+
/**
* Class definition
*/
-class Function : public Value
+class PHPCPP_EXPORT Function : public Value
{
public:
/**
@@ -42,22 +42,22 @@ public:
/**
* Constructor to wrap a function that does not accept parameters
- *
+ *
* Old C++ compilers do not see a difference between std::function
* objects based on the function signature, so these old compilers
* do not see this method.
- *
+ *
* @param function The C++ function to be wrapped
*/
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__
Function(const std::function<Value()> &function) : Function([function](Parameters &params) -> Value {
-
+
// call original function, forget about the parameters
return function();
-
+
}) {}
#endif
-
+
/**
* Destructor
*/
@@ -77,4 +77,3 @@ private:
* End namespace
*/
}
-