summaryrefslogtreecommitdiff
path: root/src/classbase.cpp
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-14 13:54:39 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-14 13:54:39 +0100
commita525d95b26fa6e4afdca803a8f77579cd26cedc6 (patch)
treed0bbaecbaa4f477ea7f5b7f30c05d0dc63229d8a /src/classbase.cpp
parent1f1a0fa9349d37e623ae763b48c7ea21681cd45b (diff)
added extra property methods to allow both const and non-const setters and getters, updated documentation
Diffstat (limited to 'src/classbase.cpp')
-rw-r--r--src/classbase.cpp61
1 files changed, 60 insertions, 1 deletions
diff --git a/src/classbase.cpp b/src/classbase.cpp
index 1773890..09850a7 100644
--- a/src/classbase.cpp
+++ b/src/classbase.cpp
@@ -1686,15 +1686,74 @@ void ClassBase::property(const char *name, double value, int flags)
* Set property with callbacks
* @param name Name of the property
* @param getter Getter method
+ */
+void ClassBase::property(const char *name, const getter_callback_0 &getter)
+{
+ // add property
+ _properties[name] = std::make_shared<Property>(getter);
+}
+
+/**
+ * Set property with callbacks
+ * @param name Name of the property
+ * @param getter Getter method
+ */
+void ClassBase::property(const char *name, const getter_callback_1 &getter)
+{
+ // add property
+ _properties[name] = std::make_shared<Property>(getter);
+}
+
+/**
+ * Set property with callbacks
+ * @param name Name of the property
+ * @param getter Getter method
+ * @param setter Setter method
+ */
+void ClassBase::property(const char *name, const getter_callback_0 &getter, const setter_callback_0 &setter)
+{
+ // add property
+ _properties[name] = std::make_shared<Property>(getter,setter);
+}
+
+/**
+ * Set property with callbacks
+ * @param name Name of the property
+ * @param getter Getter method
+ * @param setter Setter method
+ */
+void ClassBase::property(const char *name, const getter_callback_1 &getter, const setter_callback_0 &setter)
+{
+ // add property
+ _properties[name] = std::make_shared<Property>(getter,setter);
+}
+
+/**
+ * Set property with callbacks
+ * @param name Name of the property
+ * @param getter Getter method
* @param setter Setter method
*/
-void ClassBase::property(const char *name, const getter_callback &getter, const setter_callback &setter)
+void ClassBase::property(const char *name, const getter_callback_0 &getter, const setter_callback_1 &setter)
{
// add property
_properties[name] = std::make_shared<Property>(getter,setter);
}
/**
+ * Set property with callbacks
+ * @param name Name of the property
+ * @param getter Getter method
+ * @param setter Setter method
+ */
+void ClassBase::property(const char *name, const getter_callback_1 &getter, const setter_callback_1 &setter)
+{
+ // add property
+ _properties[name] = std::make_shared<Property>(getter,setter);
+}
+
+
+/**
* End namespace
*/
}