summaryrefslogtreecommitdiff
path: root/include/classbase.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/classbase.h')
-rw-r--r--include/classbase.h39
1 files changed, 19 insertions, 20 deletions
diff --git a/include/classbase.h b/include/classbase.h
index 9e53a62..0db0c35 100644
--- a/include/classbase.h
+++ b/include/classbase.h
@@ -6,7 +6,7 @@
* you can not create any instances if this class yourself (and you are not
* supposed to do that either).
*
- * Further more, because this base class is a 'private' base of Class, all
+ * Further more, because this base class is a 'private' base of Class, all
* features of it are normally also inaccessible.
*
* In other words: it is not meant to be directly used by extension writers.
@@ -22,7 +22,7 @@ namespace Php {
/**
* A couple of predefined native callback functions that can be registered.
* These are functions that optional accept a Request and/or Parameters object,
- * and that either return void or a Value object.
+ * and that either return void or a Value object.
*/
typedef void (*native_callback_0)();
typedef void (*native_callback_1)(Parameters &);
@@ -57,7 +57,7 @@ class ClassImpl;
/**
* Class definition
*/
-class ClassBase
+class PHPCPP_EXPORT ClassBase
{
protected:
/**
@@ -66,14 +66,14 @@ protected:
* @param flags Class flags
*/
ClassBase(const char *classname, int flags);
-
+
/**
* Protected constructor
* @param classname Class name
* @param type Class type
*/
ClassBase(const char *classname, ClassType type);
-
+
public:
/**
* Copy constructor
@@ -115,14 +115,14 @@ public:
* @return int
*/
virtual int callCompare(Base *object1, Base *object2) const { return 1; }
-
+
/**
* Call the __clone and __destruct magic methods
* @param base
*/
virtual void callClone(Base *base) const {}
virtual void callDestruct(Base *base) const {}
-
+
/**
* Call the __call(), __invoke() or __callStatic() method
* @param base Object to call on
@@ -133,7 +133,7 @@ public:
virtual Value callCall(Base *base, const char *name, Parameters &params) const { return nullptr; }
virtual Value callInvoke(Base *base, Parameters &params) const { return nullptr; }
virtual Value callCallStatic(const char *name, Parameters &params) const { return nullptr; }
-
+
/**
* Casting functions
* @param base
@@ -143,7 +143,7 @@ public:
virtual Value callToInteger(Base *base) const { return Value(Type::Numeric); }
virtual Value callToFloat(Base *base) const { return Value(Type::Float); }
virtual Value callToBool(Base *base) const { return Value(Type::Bool); }
-
+
/**
* Function to get and set properties
* @param base
@@ -155,7 +155,7 @@ public:
virtual void callSet(Base *base, const Value &name, const Value &value) const {}
virtual void callUnset(Base *base, const Value &name) const {}
virtual bool callIsset(Base *base, const Value &name) const { return false; }
-
+
/**
* Get access to the implementation object
* @return std::shared_ptr
@@ -171,14 +171,14 @@ protected:
/**
* Add a method to the class
- *
+ *
* The method will be accessible as one of the class methods in your PHP
* code. When the method is called, it will automatically be forwarded
* to the C++ implementation. The flags can be Php::Public, Php::Protected
* or Php::Private (using private methods can be useful if you for example
* want to make the __construct() function private). The access-modified
* flag can be bitwise combined with the flag Php::Final or Php::Abstract).
- *
+ *
* @param name Name of the method
* @param method The actual method
* @param flags Optional flags
@@ -195,11 +195,11 @@ protected:
/**
* Add a static method to the class
- *
+ *
* Because a C++ static method is just a regular function, that happens to
* have access to the private variables of the class at compile time, you
* can register any function that matches one of the function signatures
- *
+ *
* @param name Name of the method
* @param method The actual method
* @param flags Optional flags
@@ -212,7 +212,7 @@ protected:
/**
* Add an abstract method to the class
- *
+ *
* @param name Name of the method
* @param flags Optional flags (like public or protected)
* @param args Description of the supported arguments
@@ -221,13 +221,13 @@ protected:
/**
* Add a property to the class
- *
+ *
* Every instance of this class will have this property. The property
* can be Php::Public, Php::Protected or Php::Private (altough setting
* private properties is odd as the implementation of the class is in CPP,
* so why use private properties while the whole implementation is already
* hidden)
- *
+ *
* @param name Name of the property
* @param value Actual property value
* @param flags Optional flags
@@ -273,16 +273,15 @@ private:
* @var std::shared_ptr<ClassImpl>
*/
std::shared_ptr<ClassImpl> _impl;
-
+
/**
* Constants can be used as class properties, and need access to private
* and protected methods
*/
friend class ConstantImpl;
};
-
+
/**
* End namespace
*/
}
-