summaryrefslogtreecommitdiff
path: root/src/CommonAPI/Attribute.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/CommonAPI/Attribute.h')
-rw-r--r--src/CommonAPI/Attribute.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/CommonAPI/Attribute.h b/src/CommonAPI/Attribute.h
index a466e78..8295a3e 100644
--- a/src/CommonAPI/Attribute.h
+++ b/src/CommonAPI/Attribute.h
@@ -18,6 +18,11 @@
namespace CommonAPI {
+/**
+ * \brief Class representing a read only attribute
+ *
+ * Class representing a read only attribute
+ */
template <typename _ValueType>
class ReadonlyAttribute {
public:
@@ -26,10 +31,32 @@ class ReadonlyAttribute {
virtual ~ReadonlyAttribute() { }
+ /**
+ * \brief Get value of attribute, usually from remote. Synchronous call.
+ *
+ * Get value of attribute, usually from remote. Synchronous call.
+ *
+ * @param value Reference to be filled with value.
+ * @return Call status of the operation.
+ */
virtual CallStatus getValue(_ValueType& value) const = 0;
+
+ /**
+ * \brief Get value of attribute, usually from remote. Asynchronous call.
+ *
+ * Get value of attribute, usually from remote. Asynchronous call.
+ *
+ * @param attributeAsyncCallback std::function object for the callback to be invoked.
+ * @return std::future containing the call status of the operation.
+ */
virtual std::future<CallStatus> getValueAsync(AttributeAsyncCallback attributeAsyncCallback) = 0;
};
+/**
+ * \brief Class representing a read and writable attribute
+ *
+ * Class representing a read and writable attribute
+ */
template <typename _ValueType>
class Attribute: public ReadonlyAttribute<_ValueType> {
public:
@@ -38,11 +65,35 @@ class Attribute: public ReadonlyAttribute<_ValueType> {
virtual ~Attribute() { }
+ /**
+ * \brief Set value of attribute, usually to remote. Synchronous call.
+ *
+ * Set value of attribute, usually to remote. Synchronous call.
+ *
+ * @param requestValue Value to be set
+ * @param callStatus call status reference will be filled with status of the operation
+ * @param responseValue Reference which will contain the actuall value set by the remote.
+ */
virtual void setValue(const _ValueType& requestValue, CallStatus& callStatus, _ValueType& responseValue) = 0;
+
+ /**
+ * \brief Set value of attribute, usually to remote. Asynchronous call.
+ *
+ * Set value of attribute, usually to remote. Asynchronous call.
+ *
+ * @param requestValue Value to be set
+ * @param attributeAsyncCallback std::function object for the callback to be invoked.
+ * @return std::future containing the call status of the operation.
+ */
virtual std::future<CallStatus> setValueAsync(const _ValueType& requestValue,
AttributeAsyncCallback attributeAsyncCallback) = 0;
};
+/**
+ * \brief Class representing an observable attribute
+ *
+ * Class representing an observable attribute
+ */
template <typename _AttributeBaseClass>
class _ObservableAttributeImpl: public _AttributeBaseClass {
public:
@@ -52,6 +103,13 @@ class _ObservableAttributeImpl: public _AttributeBaseClass {
virtual ~_ObservableAttributeImpl() { }
+ /**
+ * \brief Returns the event handler for the remote change notifiaction event
+ *
+ * Returns the event handler for the remote change notifiaction event
+ *
+ * @return The event handler object
+ */
virtual ChangedEvent& getChangedEvent() = 0;
};