[Resource-Encapsulation] Improved doxygen comments 61/23761/5
authorJay Sharma <jay.sharma@samsung.com>
Thu, 12 Apr 2018 13:19:32 +0000 (18:49 +0530)
committerJay Sharma <jay.sharma@samsung.com>
Thu, 12 Apr 2018 13:20:34 +0000 (18:50 +0530)
Change-Id: I367e12d25e27b904a18bf9c6bb14c87001c3e20b
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
13 files changed:
service/resource-encapsulation/include/RCSAddress.h
service/resource-encapsulation/include/RCSDiscoveryManager.h
service/resource-encapsulation/include/RCSException.h
service/resource-encapsulation/include/RCSRemoteResourceObject.h
service/resource-encapsulation/include/RCSRepresentation.h
service/resource-encapsulation/include/RCSRequest.h
service/resource-encapsulation/include/RCSResourceObject.h
service/resource-encapsulation/src/common/expiryTimer/include/ExpiryTimer.h
service/resource-encapsulation/src/common/primitiveResource/include/PrimitiveResource.h
service/resource-encapsulation/src/resourceBroker/include/ResourceBroker.h
service/resource-encapsulation/src/resourceBroker/include/ResourcePresence.h
service/resource-encapsulation/src/resourceCache/include/ObserveCache.h
service/resource-encapsulation/src/resourceCache/include/ResourceCacheManager.h

index 0fd43d4..ca1cc49 100644 (file)
@@ -46,6 +46,7 @@ namespace OIC
             /**
              * Factory method for multicast.
              *
+             * @return RCSAddress Instance.
              */
             static RCSAddress multicast();
 
@@ -53,6 +54,8 @@ namespace OIC
              * Factory method for unicast.
              *
              * @param address A physical address for the target.
+             *
+             * @return RCSAddress Instance.
              */
             static RCSAddress unicast(const std::string& address);
 
index 5aaba8d..6b16b59 100644 (file)
@@ -95,8 +95,9 @@ namespace OIC
                         ResourceDiscoveredCallback;
 
             /**
-             * @return RCSDiscoveryManager instance.
+             * Gets instance of RCSDiscoveryManager.
              *
+             * @return RCSDiscoveryManager instance.
              */
             static RCSDiscoveryManager* getInstance();
 
@@ -107,6 +108,8 @@ namespace OIC
              * @param address         A RCSAddress object
              * @param cb              A callback to obtain discovered resource
              *
+             * @return Unique pointer of DiscoveryTask.
+             *
              * @throws InvalidParameterException If cb is empty.
              *
              * @note The callback will be invoked in an internal thread.
@@ -123,6 +126,8 @@ namespace OIC
              * @param relativeUri      The relative URI of resource to be searched
              * @param cb               A callback to obtain discovered resource
              *
+             * @return Unique pointer of DiscoveryTask.
+             *
              * @throws InvalidParameterException If cb is empty.
              *
              * @note The callback will be invoked in an internal thread.
@@ -139,6 +144,8 @@ namespace OIC
              * @param resourceType     Resource Type
              * @param cb               A callback to obtain discovered resource
              *
+             * @return Unique pointer of DiscoveryTask.
+             *
              * @throws InvalidParameterException If cb is empty.
              *
              * @note The callback will be invoked in an internal thread.
@@ -155,6 +162,8 @@ namespace OIC
              * @param resourceTypes    List of Resource Types
              * @param cb               A callback to obtain discovered resource
              *
+             * @return Unique pointer of DiscoveryTask.
+             *
              * @throws InvalidParameterException If cb is empty.
              * @throws RCSBadRequestException If resourceTypes contain more than one element and
              * any of them is empty.
@@ -176,6 +185,8 @@ namespace OIC
              * @param resourceType     Resource Type
              * @param cb               A callback to obtain discovered resource
              *
+             * @return Unique pointer of DiscoveryTask.
+             *
              * @throws InvalidParameterException If cb is empty.
              *
              * @note The callback will be invoked in an internal thread.
@@ -194,6 +205,8 @@ namespace OIC
              * @param resourceTypes     List of Resource Types
              * @param cb               A callback to obtain discovered resource
              *
+             * @return Unique pointer of DiscoveryTask.
+             *
              * @throws InvalidParameterException If cb is empty.
              * @throws RCSBadRequestException If resourceTypes contain more than one element and
              * any of them is empty.
index 849b61f..eeb33bc 100644 (file)
@@ -96,14 +96,16 @@ namespace OIC
             explicit RCSPlatformException(OCStackResult reason);
 
             /**
-             * Returns the reason.
+             * Gets the reason code associated with exception.
              *
+             * @return Reason code as OCStackResult.
              */
             OCStackResult getReasonCode() const;
 
             /**
-             * Returns the reason description.
+             * Gets the reason for exception.
              *
+             * @return Reason for exception as string.
              */
             std::string getReason() const;
 
index ee632c4..9d18ba6 100644 (file)
@@ -68,8 +68,8 @@ namespace OIC
 
         enum class CacheMode
         {
-            OBSERVE_ONLY,
-            OBSERVE_WITH_POLLING
+            OBSERVE_ONLY, /**< Caching with observe.*/
+            OBSERVE_WITH_POLLING /**< Caching with periodic polling.*/
         };
 
         /**
@@ -103,24 +103,30 @@ namespace OIC
         public:
 
             /**
-             * Sets an interface of the resource to operate on
+             * Sets an interface of the resource to operate on.
              *
-             * @param interface interface
+             * @param interface resource interface to be set.
+             *
+             * @return Updated RCSQueryParams instance.
              */
             RCSQueryParams& setResourceInterface(std::string interface);
 
             /**
-             * Sets a resource type of the resource to operate on
+             * Sets a resource type of the resource to operate on.
+             *
+             * @param type resource type to be set.
              *
-             * @param type resource type
+             * @return Updated RCSQueryParams instance.
              */
             RCSQueryParams& setResourceType(std::string type);
 
             /**
-             * Sets a resource type of the resource to operate on
+             * Puts given key and value in query params.
              *
-             * @param key key to be inserted
-             * @param value value to be inserted
+             * @param key key to be inserted.
+             * @param value value to be inserted.
+             *
+             * @return Updated RCSQueryParams instance.
              *
              * @note "rt" and "if" are reserved, so you should avoid them as a key.
              *
@@ -128,26 +134,34 @@ namespace OIC
             RCSQueryParams& put(std::string key, std::string value);
 
             /**
-             * Returns the resource interface.
+             * Gets the resource interface.
+             *
+             * @return Resource interface.
              */
             std::string getResourceInterface() const;
 
             /**
-             * Returns the resource type.
+             * Gets the resource type.
+             *
+             * @return Resource type.
              */
             std::string getResourceType() const;
 
             /**
-             * Returns a value.
+             * Gets query value for the given key.
              *
              * @param key key of the element whose mapped value is accessed.
              *
+             * @return Value associated with given key.
+             *
              * @throws InvalidKeyException If @a key doesn't match the key of any value.
              */
             std::string get(const std::string& key) const;
 
             /**
-             * Returns all params.
+             * Get all the query params.
+             *
+             * @return Map containing all the queries [Key-Value pair].
              */
             const Map& getAll() const;
 
@@ -250,7 +264,9 @@ namespace OIC
             ~RCSRemoteResourceObject();
 
             /**
-             * Creates an instance from an OCResource instance.
+             * Creates an RCSRemoteResourceObject instance from an OCResource instance.
+             *
+             * @return RCSRemoteResourceObject instance.
              *
              * @throw RCSInvalidParameterException If ocResource is nullptr.
              */
@@ -258,7 +274,9 @@ namespace OIC
                     std::shared_ptr< OC::OCResource > ocResource);
 
             /**
-             * Returns an equivalent OCResource using RCSRemoteResourceObject instance.
+             * Converts RCSRemoteResourceObject instance to an equivalent OCResource.
+             *
+             * @return OCResource instance.
              *
              * @throw RCSInvalidParameterException If rcsResource is nullptr.
              */
@@ -266,14 +284,18 @@ namespace OIC
                     RCSRemoteResourceObject::Ptr rcsResource);
 
             /**
-             * Returns whether monitoring is enabled.
+             * Checks whether monitoring is started or not.
+             *
+             * @return True if monitoring started, otherwise false.
              *
              * @see startMonitoring()
              */
             bool isMonitoring() const;
 
             /**
-             * Returns whether caching is enabled.
+             * Checks whether caching is started or not.
+             *
+             * @return True if caching started, otherwise false.
              *
              * @see startCaching()
              */
@@ -281,8 +303,9 @@ namespace OIC
             bool isCaching() const;
 
             /**
-             * Returns whether the resource is observable.
+             * Checks whether resource is observable or not.
              *
+             * @return True if resource is observable, otherwise false.
              */
             bool isObservable() const;
 
@@ -318,9 +341,12 @@ namespace OIC
             void stopMonitoring();
 
             /**
-             * Returns the current state of the resource.
+             * Gets the current state of the resource.
+             *
+             * @return Current resource state.
              *
              * @see startMonitoring
+             * @see ResourceState
              */
             ResourceState getState() const;
 
@@ -376,17 +402,24 @@ namespace OIC
             void stopCaching();
 
             /**
-             * Returns the current cache state.
+             * Gets the current cache state.
+             *
+             * @return Current cache state.
+             *
+             * @see startCaching
+             * @see CacheState
              *
              */
             CacheState getCacheState() const;
 
             /**
-             * Returns whether cached data is available.
+             * Checks whether cached data is available.
              *
              * Cache will be available always once cache state had been CacheState::READY
              * even if current state is CacheState::LOST_SIGNAL.
              *
+             * @return True if caching data available, otherwise false.
+             *
              * @see getCacheState()
              */
             bool isCachedAvailable() const;
@@ -544,26 +577,30 @@ namespace OIC
                     SetCallback cb);
 
             /**
-             * Returns the URI of the resource.
+             * Gets the resource URI.
              *
+             * @return Resource URI.
              */
             std::string getUri() const;
 
             /**
-             * Returns the address of the resource .
+             * Gets the resource address.
              *
+             * @return Resource address.
              */
             std::string getAddress() const;
 
             /**
-             * Returns the resource types of the resource.
+             * Gets the resource types.
              *
+             * @return Vector containing resource types.
              */
             std::vector< std::string > getTypes() const;
 
             /**
-             * Returns the resource interfaces of the resource.
+             * Gets the resource interfaces.
              *
+             * @return Vector containing resource interfaces.
              */
             std::vector< std::string > getInterfaces() const;
 
index d090c3c..e1239f4 100644 (file)
@@ -55,24 +55,30 @@ namespace OIC
                     const RCSResourceAttributes& attrs);
 
             /**
-             * Returns the URI.
+             * Gets the resource URI.
+             *
+             * @return Resource URI.
              */
             std::string getUri() const;
 
             /**
              * Sets the URI of this representation.
+             *
+             * @param uri Resource URI to be set.
              */
             void setUri(std::string uri);
 
             /**
-             * Returns all interfaces added.
+             * Gets all interfaces added.
+             *
+             * @return Vector containing resource interfaces.
              */
             const std::vector< std::string >& getInterfaces() const;
 
             /**
              * Adds an interface.
              *
-             * @param interface an interface to add
+             * @param interface an interface to add.
              */
             void addInterface(std::string interface);
 
@@ -82,13 +88,17 @@ namespace OIC
             void clearInterfaces();
 
             /**
-             * Returns all resource types added.
+             * Gets all resource types added.
+             *
+             * @return Vector containing resource types.
              */
             const std::vector< std::string >& getResourceTypes() const;
 
 
             /**
              * Adds a resource type.
+             *
+             * @param resourceType Resource type to add.
              */
             void addResourceType(std::string resourceType);
 
@@ -98,7 +108,11 @@ namespace OIC
             void clearResourceTypes();
 
             /**
-             * Returns attributes set in this representation.
+             * Gets attributes set in this representation.
+             *
+             * @return Resource attributes.
+             *
+             * @see RCSResourceAttributes
              */
             const RCSResourceAttributes& getAttributes() const;
 
@@ -120,21 +134,23 @@ namespace OIC
             void setAttributes(RCSResourceAttributes&& attrs);
 
             /**
-             * Returns children of this representation.
+             * Gets children of this representation.
+             *
+             * @return children of this representation.
              */
             const std::vector< RCSRepresentation >& getChildren() const;
 
             /**
              * Adds a child to this representation.
              *
-             * @param child a representation to be attached
+             * @param child a representation to be attached.
              */
             void addChild(RCSRepresentation child);
 
             /**
              * Sets children of this representation.
              *
-             * @param children new children
+             * @param children new children.
              */
             void setChildren(std::vector< RCSRepresentation > children);
 
@@ -146,6 +162,8 @@ namespace OIC
             /**
              * Converts OCRepresentation into RCSRepresentation.
              *
+             * @return Converted RCSRepresentation.
+             *
              * @see toOCRepresentation
              */
             static RCSRepresentation fromOCRepresentation(const OC::OCRepresentation&);
@@ -154,6 +172,8 @@ namespace OIC
             /**
              * Converts RCSRepresentation into OCRepresentation.
              *
+             * @return Converted OCRepresentation.
+             *
              * @see fromOCRepresentation
              */
             static OC::OCRepresentation toOCRepresentation(const RCSRepresentation&);
index 9ecbc01..e1314f2 100644 (file)
@@ -41,19 +41,19 @@ namespace OIC
         class RCSResourceObject;
 
         /**
-        * This class describes the request.
-        *
-        */
+         * This class describes the request.
+         *
+         */
         class RCSRequest
         {
         public:
             RCSRequest() = default;
 
             /**
-            * Constructor to set resource URI.
-            *
-            * @param resourceUri URI of the resource for which the request is generated.
-            */
+             * Constructor to set resource URI.
+             *
+             * @param resourceUri URI of the resource for which the request is generated.
+             */
             explicit RCSRequest(const std::string& resourceUri);
 
             RCSRequest(const std::shared_ptr< RCSResourceObject >&,
@@ -65,22 +65,29 @@ namespace OIC
             std::weak_ptr< RCSResourceObject > getResourceObject() const noexcept;
 
             /**
-            * @return the URI of the request.
-            *
-            */
+             * Gets the resouce URI.
+             *
+             * @return the URI of the request.
+             */
             std::string getResourceUri() const;
 
             /**
+             * Gets the OC resouce request.
+             *
              * @return the OCResourceRequest.
              */
             std::shared_ptr< OC::OCResourceRequest > getOCRequest() const noexcept;
 
             /**
+             * Gets the query parameter of request.
+             *
              * @return the query parameters of the request.
              */
             const std::map< std::string, std::string >& getQueryParams() const;
 
             /**
+             * Gets the interface of request.
+             *
              * @return the interface of the request.
              */
             std::string getInterface() const;
index c35f1b8..52eefa2 100644 (file)
@@ -350,7 +350,7 @@ namespace OIC
             template< typename T >
             T getAttribute(const std::string& key) const
             {
-               RCSResourceObject::WeakGuard lock(*this);
+                RCSResourceObject::WeakGuard lock(*this);
                 return m_resourceAttributes.at(key).get< T >();
             }
 
@@ -405,11 +405,15 @@ namespace OIC
 
             /**
              * Checks whether the resource is observable or not.
+             *
+             * @return True if resource is observable, otherwise false.
              */
             virtual bool isObservable() const;
 
             /**
              * Checks whether the resource is discoverable or not.
+             *
+             * @return True if resource is discoverable, otherwise false.
              */
             virtual bool isDiscoverable() const;
 
@@ -528,38 +532,52 @@ namespace OIC
             void unbindResource(const RCSResourceObject::Ptr& resource);
 
             /**
-             * Returns all bound resources to this resource.
+             * Gets all bounded resources to this resource.
+             *
+             * @return Bounded resources to this resource.
              */
             std::vector< RCSResourceObject::Ptr > getBoundResources() const;
 
             /**
-             * Returns the URI of the resource.
+             * Gets the URI of the resource.
+             *
+             * @return Resource URI.
              */
             std::string getUri() const;
 
             /**
-             * Returns the default interface of the resource
+             * Gets the default interface of the resource
+             *
+             * @return Default interface of the resource.
              *
              * @see Builder::setDefaultInterface
              */
             std::string getDefaultInterface() const;
 
             /**
-             * Returns all interfaces added for the resource.
+             * Gets all interfaces added for the resource.
+             *
+             * @return Vector containing all the interfaces.
              *
              * @see Builder::addInterface
              */
             std::vector< std::string > getInterfaces() const;
 
             /**
-             * Returns all types added for the resource.
+             * Gets all types added for the resource.
+             *
+             * @return Vector containing all the resource types.
              *
              * @see Builder::addType
              */
             std::vector< std::string > getTypes() const;
 
             /**
-             * Returns the resource handle of the resource.
+             * Gets the resource handle of the resource.
+             *
+             * @return OC resource handle.
+             *
+             * @see OCResourceHandle
              */
              OCResourceHandle getResourceHandle() const;
 
index 9eb859f..1637c22 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+/**
+ * @file
+ *
+ * This file contains the declaration of classes and its members related to expiry timer.
+ */
+
 #ifndef _EXPIRY_TIMER_H_
 #define _EXPIRY_TIMER_H_
 
@@ -32,6 +38,10 @@ namespace OIC
 
         class TimerTask;
 
+        /**
+         * This is expiry timer class.
+         * This utility is being used by other RE modules.
+         */
         class ExpiryTimer
         {
         public:
@@ -40,6 +50,10 @@ namespace OIC
             typedef long long DelayInMilliSec;
 
         public:
+
+            /**
+             * Constructor for ExpiryTimer.
+             */
             ExpiryTimer();
             ~ExpiryTimer();
 
@@ -49,10 +63,37 @@ namespace OIC
             ExpiryTimer(const ExpiryTimer&) = delete;
             ExpiryTimer& operator=(const ExpiryTimer&) = delete;
 
-            Id post(DelayInMilliSec, Callback);
-            bool cancel(Id);
+            /**
+             * Post/Start a new task.
+             *
+             * @param delay Time in milli second.
+             * @param cb callback function.
+             *
+             * @return id of the task.
+             *
+             * @see Callback
+             */
+            Id post(DelayInMilliSec delay, Callback cb);
+
+            /**
+             * Cancel the task for the given id.
+             *
+             * @param id identifier of task to be cancelled.
+             *
+             * @return true for success case, otherwise false.
+             */
+            bool cancel(Id id);
+
+            /**
+             * Cancel all the tasks.
+             */
             void cancelAll();
 
+            /**
+             * Gets number of pending tasks.
+             *
+             * @return number of tasks.
+             */
             size_t getNumOfPending();
             size_t getNumOfPending() const;
 
index 59409ea..f3867b8 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+/**
+ * @file
+ *
+ * This file contains the declaration of classes and its members related to Primitive resource.
+ */
+
 #ifndef COMMON_PRIMITIVERESOURCE_H
 #define COMMON_PRIMITIVERESOURCE_H
 
@@ -41,58 +47,197 @@ namespace OIC
         class RCSResourceAttributes;
         class RCSRepresentation;
 
+        /**
+         * This class represents resource of resource-encapsulation layer.
+         * This class is common for both server and client side.
+         */
         class PrimitiveResource: public std::enable_shared_from_this< PrimitiveResource >
         {
         public:
             typedef std::shared_ptr< PrimitiveResource > Ptr;
             typedef std::shared_ptr< const PrimitiveResource > ConstPtr;
 
+            /**
+             * Callback function for get request.
+             */
             typedef std::function<void(const HeaderOptions&, const RCSRepresentation&, int)>
                     GetCallback;
 
+            /**
+             * Callback function for set request.
+             */
             typedef std::function<void(const HeaderOptions&, const RCSRepresentation&, int)>
                     SetCallback;
 
+            /**
+             * Callback function for put request.
+             */
             typedef std::function<void(const HeaderOptions&, const RCSRepresentation&, int)>
                     PutCallback;
 
+            /**
+             * Callback function for observe request.
+             */
             typedef std::function<void(const HeaderOptions&, const RCSRepresentation&, int, int)>
                     ObserveCallback;
 
         public:
+
+            /**
+             * Create primitive resource from given OCResource.
+             */
             static PrimitiveResource::Ptr create(const std::shared_ptr<OC::OCResource>&);
 
+            /**
+             * Destructor for Primitive Resource.
+             */
             virtual ~PrimitiveResource() { }
 
-            virtual void requestGet(GetCallback) = 0;
+           /**
+            * Sends a get request to primitive resource.
+            *
+            * @param cb A callback to receive the response.
+            *
+            * @see GetCallback
+            */
+            virtual void requestGet(GetCallback cb) = 0;
 
+          /**
+            * Sends a get request with resource type, interface and query params
+            * to resource.
+            *
+            * @param resourceType Resource type.
+            * @param resourceInterface Resource interface.
+            * @param queryParametersMap Query parameters to be sent.
+            * @param cb A callback to receive the response.
+            *
+            * @see GetCallback
+            */
             virtual void requestGetWith(const std::string& resourceType,
                     const std::string& resourceInterface,
-                    const OC::QueryParamsMap& queryParametersMap, GetCallback) = 0;
+                    const OC::QueryParamsMap& queryParametersMap, GetCallback cb) = 0;
 
-            virtual void requestSet(const RCSResourceAttributes&, SetCallback) = 0;
+            /**
+             * Sends a set request with resource attributes to resource.
+             *
+             * @param attributes Resource attributes to be sent.
+             * @param cb A callback to receive the response.
+             *
+             * @see RCSResourceAttributes
+             * @see SetCallback
+             */
+            virtual void requestSet(const RCSResourceAttributes& attributes, SetCallback cb) = 0;
 
+           /**
+            * Sends a set request with resource attributes, type, interface and
+            * query params to resource.
+            *
+            * @param resourceType Resource type.
+            * @param resourceInterface Resource interface.
+            * @param queryParametersMap Query parameters to be sent.
+            * @param attributes Resource attributes to be sent.
+            * @param cb A callback to receive the response.
+            *
+            * @see RCSResourceAttributes
+            */
             virtual void requestSetWith(const std::string& resourceType,
                     const std::string& resourceInterface,
                     const OC::QueryParamsMap& queryParametersMap,
-                    const RCSResourceAttributes&, GetCallback) = 0;
+                    const RCSResourceAttributes& attributes, GetCallback cb) = 0;
 
+           /**
+            * Sends a set request with representation, type, interface and
+            * query params to resource.
+            *
+            * @param resourceType Resource type.
+            * @param resourceInterface Resource interface.
+            * @param queryParametersMap Query parameters to be sent.
+            * @param rep Representation to be sent.
+            * @param cb A callback to receive the response.
+            *
+            * @see SetCallback
+            * @see RCSRepresentation
+            */
             virtual void requestSetWith(const std::string& resourceType,
                     const std::string& resourceInterface,
                     const OC::QueryParamsMap& queryParametersMap,
-                    const RCSRepresentation&, SetCallback) = 0;
+                    const RCSRepresentation& rep, SetCallback cb) = 0;
+
+            /**
+             * Sends a put request with resource attributes to resource.
+             *
+             * @param attributes Resource attributes to be sent.
+             * @param cb A callback to receive the response.
+             *
+             * @see RCSResourceAttributes
+             * @see PutCallback
+             */
+            virtual void requestPut(const RCSResourceAttributes& attributes, PutCallback cb) = 0;
 
-            virtual void requestPut(const RCSResourceAttributes&, PutCallback) = 0;
-            virtual void requestObserve(ObserveCallback) = 0;
+            /**
+             * Sends an observe requet to resource.
+             *
+             * @param cb A callback to receive the response.
+             *
+             * @see ObserveCallback
+             */
+            virtual void requestObserve(ObserveCallback cb) = 0;
+
+            /**
+             * Sends an cancel observe requet to resource.
+             *
+             */
             virtual void cancelObserve() = 0;
 
+            /**
+             * Gets sid of resource.
+             *
+             * @return Resource sid.
+             */
             virtual std::string getSid() const = 0;
+
+            /**
+             * Gets resource URI.
+             *
+             * @return Resource URI.
+             */
             virtual std::string getUri() const = 0;
+
+            /**
+             * Gets resource host address.
+             *
+             * @return Resource host address.
+             */
             virtual std::string getHost() const = 0;
+
+            /**
+             * Gets resource types.
+             *
+             * @return Vector containing resource types.
+             */
             virtual std::vector< std::string > getTypes() const = 0;
+
+            /**
+             * Gets resource interfaces.
+             *
+             * @return Vector containing resource interfaces.
+             */
             virtual std::vector< std::string > getInterfaces() const = 0;
+
+            /**
+             * Gets resource Connectivity type.
+             *
+             * @return Connectivity type.
+             *
+             * @see OCConnectivityType
+             */
             virtual OCConnectivityType getConnectivityType() const = 0;
 
+            /**
+             * Check whether the resource is observable or not.
+             *
+             * @return True if resource is observable, otherwise false.
+             */
             virtual bool isObservable() const = 0;
 
         protected:
index fee3837..e1b28cd 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+/**
+ * @file
+ *
+ * This file contains the declaration of classes and its members related to Resource Broker.
+ */
+
 #ifndef RB_RESOURCEBROKER_H_
 #define RB_RESOURCEBROKER_H_
 
@@ -35,15 +41,35 @@ namespace OIC
 {
     namespace Service
     {
+       /**
+        * This is internal class for RCSRemoteResourceObject, represents resource
+        * broker and provides simple ways to interact with it.
+        * Resource broker represents, one of the feature of resource-encapsulation layer:
+        * "Monitor the state of remote resource".
+        *
+        * @see RCSRemoteResourceObject
+        */
         class ResourceBroker
         {
         public:
+
+            /**
+             * The Invalid parameter exception class for resource broker.
+             *
+             * @see RCSException
+             */
             class InvalidParameterException: public RCSException
             {
             public:
                 InvalidParameterException(std::string&& what)
                 : RCSException{ std::move(what) } {}
             };
+
+            /**
+             * The failed to subscribe presence exception class for resource broker.
+             *
+             * @see RCSPlatformException
+             */
             class FailedSubscribePresenceException: public RCSPlatformException
             {
             public:
@@ -51,12 +77,60 @@ namespace OIC
                 : RCSPlatformException{reason} {}
             };
 
+            /**
+             * Gets instance of ResourceBroker.
+             *
+             * @return ResourceBroker instance.
+             */
             static ResourceBroker * getInstance();
 
+            /**
+             * Start Monitoring state for the given resource.
+             * This method will be called internally by RCSRemoteResourceObject.
+             *
+             * @param pResource Primitive resource.
+             * @param cb Broker callback function.
+             *
+             * @return Broker Id.
+             *
+             * @see BrokerCB
+             * @see PrimitiveResourcePtr
+             * @see RCSRemoteResourceObject
+             */
             BrokerID hostResource(PrimitiveResourcePtr pResource, BrokerCB cb);
+
+            /**
+             * Stop Monitoring state for the given broker Id.
+             * This method  will be called internally by RCSRemoteResourceObject.
+             *
+             * @param brokerId Broker Id.
+             *
+             * @see RCSRemoteResourceObject
+             * @see BrokerID
+             */
             void cancelHostResource(BrokerID brokerId);
 
+           /**
+            * Gets the current state for the given broker Id.
+            *
+            * @param brokerId Broker Id.
+            *
+            * @return Current state of resource.
+            *
+            * @see BROKER_STATE
+            */
             BROKER_STATE getResourceState(BrokerID brokerId);
+
+           /**
+            * Gets the current state for the given primitive resource.
+            *
+            * @param pResource Primitive resource.
+            *
+            * @return Current state of resource.
+            *
+            * @see PrimitiveResourcePtr
+            * @see BROKER_STATE
+            */
             BROKER_STATE getResourceState(PrimitiveResourcePtr pResource);
 
         private:
index 220bc77..7baede1 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+/**
+ * @file
+ *
+ * This file contains the declaration of classes and its members related to Resource Presence.
+ */
+
 #ifndef RB_RESOURCEPRESENCE_H_
 #define RB_RESOURCEPRESENCE_H_
 
@@ -35,24 +41,103 @@ namespace OIC
 {
     namespace Service
     {
+       /**
+        * This is internal class used by ResourceBroker, provides simple APIs to
+        * monitor resource.
+        *
+        * @see ResourceBroker
+        */
         class ResourcePresence : public std::enable_shared_from_this<ResourcePresence>
         {
         public:
             ResourcePresence();
             ~ResourcePresence();
 
+            /**
+             * Start Monitoring state for the given resource.
+             * This method will be called internally by ResourceBroker.
+             *
+             * @param pResource Primitive resource.
+             *
+             * @see ResourceBroker
+             * @see PrimitiveResourcePtr
+             */
             void initializeResourcePresence(PrimitiveResourcePtr pResource);
 
+            /**
+             * Add given brokerId and callback in BrokerIDMap.
+             *
+             * @param _id Broker id to be added.
+             * @param _cb Broker callback to be added.
+             *
+             * @see BrokerCB
+             * @see BrokerIDMap
+             */
             void addBrokerRequester(BrokerID _id, BrokerCB _cb);
+
+           /**
+            * Remove given brokerId from BrokerIDMap.
+            *
+            * @param _id Broker id to be removed.
+            *
+            * @see BrokerIDMap
+            */
             void removeBrokerRequester(BrokerID _id);
+
+           /**
+            * Remove all the brokerId [Requester entries] from BrokerIDMap.
+            *
+            * @see BrokerIDMap
+            */
             void removeAllBrokerRequester();
 
+           /**
+            * Requests the current state of resource.
+            *
+            */
             void requestResourceState() const;
+
+           /**
+            * Change the broker mode.
+            *
+            * @see BROKER_MODE
+            */
             void changePresenceMode(BROKER_MODE newMode);
 
+           /**
+            * Check whether BrokerIDMap is empty or not.
+            *
+            * @return True if BrokerIDMap is empty, otherwise false.
+            *
+            * @see BrokerIDMap
+            */
             bool isEmptyRequester() const;
+
+           /**
+            * Gets BrokerIDMap size.
+            *
+            * @return Size of BrokerIDMap.
+            *
+            * @see BrokerIDMap
+            */
             int  requesterListSize() const;
+
+           /**
+            * Gets primitive resource.
+            *
+            * @return Primitive resource.
+            *
+            * @see PrimitiveResourcePtr
+            */
             const PrimitiveResourcePtr getPrimitiveResource() const;
+
+             /**
+             * Gets current state of resource.
+             *
+             * @return Current resource state.
+             *
+             * @see BROKER_STATE
+             */
             BROKER_STATE getResourceState() const;
 
         private:
index 11b72a6..3dcaac3 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+/**
+ * @file
+ *
+ * This file contains the declaration of classes and its members related to Cache.
+ */
+
 #ifndef RCM_OBSERVECACHE_H_
 #define RCM_OBSERVECACHE_H_
 
@@ -35,6 +41,13 @@ namespace OIC
 {
     namespace Service
     {
+
+      /**
+       * This is internal class for ResourceCacheManager, represents resource
+       * cache and provides simple ways to interact with it.
+       *
+       * @see ResourceCacheManager
+       */
         class ObserveCache : public std::enable_shared_from_this<ObserveCache>
         {
             public:
@@ -51,14 +64,55 @@ namespace OIC
                 ObserveCache & operator = (const ObserveCache &) = delete;
                 ObserveCache & operator = (ObserveCache &&) = delete;
 
+                /**
+                 * Starts Caching of data [attributes].
+                 * This method will be called internally by ResourceCacheManager.
+                 *
+                 * @param func Data cache callback.
+                 *
+                 * @see ResourceCacheManager
+                 * @see DataCacheCB
+                 */
                 void startCache(DataCacheCB func);
+
+                /**
+                 * Stops Caching of data [attributes].
+                 * This method will be called internally by ResourceCacheManager.
+                 *
+                 * @see ResourceCacheManager
+                 */
                 void stopCache();
 
+                /**
+                 * Gets cache state.
+                 *
+                 * @return cache state.
+                 *
+                 * @see CACHE_STATE
+                 */
                 CACHE_STATE getCacheState() const;
 
+                /**
+                 * Gets cached data.
+                 *
+                 * @return cached resource attributes.
+                 *
+                 * @see CACHE_STATE
+                 */
                 RCSResourceAttributes getCachedData() const;
 
+                /**
+                 * Checks whether cached data is available.
+                 *
+                 * @return True if cached data is available, otherwise false.
+                 */
                 bool isCachedData() const;
+
+                /**
+                 * Checks whether caching started or not.
+                 *
+                 * @return True if caching started, otherwise false.
+                 */
                 bool isStartCache() const;
 
             private:
index 0fc84c4..e3cf83c 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+/**
+ * @file
+ *
+ * This file contains the declaration of classes and its members related to Resource Cache.
+ */
+
 #ifndef RCM_RESOURCECACHEMANAGER_H_
 #define RCM_RESOURCECACHEMANAGER_H_
 
@@ -34,9 +40,24 @@ namespace OIC
 {
     namespace Service
     {
+
+      /**
+       * This is internal class for RCSRemoteResourceObject, represents resource
+       * cache and provides simple ways to interact with it. Resource Cache
+       * represents, one of the feature of  resource-encapsulation layer:
+       * "Caching data [attributes] of remote resource".
+       *
+       * @see RCSRemoteResourceObject
+       */
         class ResourceCacheManager
         {
             public:
+
+                /**
+                 * No cached data exception class for resource cache.
+                 *
+                 * @see RCSException
+                 */
                 class HasNoCachedDataException: public RCSException
                 {
                     public:
@@ -44,30 +65,111 @@ namespace OIC
                             : RCSException { std::move(what) } {}
                 };
 
+                /**
+                 * Gets instance of Resource cache manager.
+                 *
+                 * @return ResourceCacheManager instance.
+                 */
                 static ResourceCacheManager *getInstance();
 
-                // throw InvalidParameterException;
+                /**
+                 * Start Caching data [attributes] for the given resource.
+                 * This method will be called internally by RCSRemoteResourceObject.
+                 *
+                 * @param pResource Primitive resource.
+                 * @param func Cache callback function.
+                 * @param cm Caching method.
+                 * @param rf Report frequency.
+                 * @param time Caching interval.
+                 *
+                 * @return Cache Id.
+                 *
+                 * @throw InvalidParameterException In case of invalid parameters.
+                 *
+                 * @see PrimitiveResourcePtr
+                 * @see CacheCB
+                 * @see RCSRemoteResourceObject
+                 */
                 CacheID requestResourceCache(
                     PrimitiveResourcePtr pResource, CacheCB func = NULL,
                     CACHE_METHOD cm = CACHE_METHOD::ITERATED_GET,
                     REPORT_FREQUENCY rf = REPORT_FREQUENCY::NONE, long time = 0l);
 
-                // throw InvalidParameterException;
+                /**
+                 * Stops caching resource data [attributes] for the given cache id.
+                 * This method will be called internally by RCSRemoteResourceObject.
+                 *
+                 * @param id Cache Id.
+                 *
+                 * @throw InvalidParameterException In case of invalid Cache id.
+                 *
+                 * @see RCSRemoteResourceObject
+                 * @see requestResourceCache
+                 * @see CacheID
+                 */
                 void cancelResourceCache(CacheID id);
 
-                // throw InvalidParameterException;
+                /**
+                 * Updates resource cache for the given cache id.
+                 *
+                 * @param id Cache Id.
+                 *
+                 * @throw InvalidParameterException In case of invalid Cache id.
+                 *
+                 * @see requestResourceCache
+                 * @see CacheID
+                 */
                 void updateResourceCache(CacheID id) const;
 
-                // throw InvalidParameterException;
-                // throw HasNoCachedDataException;
+                /**
+                 * Gets cached resource data [attributes] for the given cache id.
+                 * This method will be called internally by RCSRemoteResourceObject.
+                 *
+                 * @param id Cache Id.
+                 *
+                 * @throw InvalidParameterException In case of invalid Cache id.
+                 * @throw HasNoCachedDataException In case of no cached data.
+                 *
+                 * @see RCSRemoteResourceObject
+                 * @see RCSResourceAttributes
+                 * @see requestResourceCache
+                 * @see CacheID
+                 */
                 const RCSResourceAttributes getCachedData(CacheID id) const;
 
-                // throw InvalidParameterException;
+                /**
+                 * Gets cache state for the given cache id.
+                 * This method will be called internally by RCSRemoteResourceObject.
+                 *
+                 * @param id Cache Id.
+                 *
+                 * @throw InvalidParameterException In case of invalid Cache id.
+                 *
+                 * @see RCSRemoteResourceObject
+                 * @see requestResourceCache
+                 * @see CacheID
+                 */
                 CACHE_STATE getResourceCacheState(CacheID id) const;
 
-                // throw InvalidParameterException;
+                /**
+                 * Checks whether cache data is available or not.
+                 *
+                 * @param id Cache Id.
+                 *
+                 * @return True if cached data available, otherwise false.
+                 *
+                 * @throw InvalidParameterException In case of invalid Cache id.
+                 *
+                 * @see RCSRemoteResourceObject
+                 * @see requestResourceCache
+                 * @see CacheID
+                 */
                 bool isCachedData(CacheID id) const;
 
+                /**
+                 * Stops resource cache manager.
+                 *
+                 */
                 static void stopResourceCacheManager();
 
             private: