Imported Upstream version 1.2.0
[platform/upstream/iotivity.git] / service / resource-encapsulation / include / RCSResourceObject.h
index 8a58b15..ff68863 100644 (file)
@@ -79,14 +79,36 @@ namespace OIC
          * in instead of overriding SetRequestHandler.
          * </p>
          */
+
         class RCSResourceObject
         {
         private:
-            class WeakGuard;
 
             typedef AtomicWrapper< std::thread::id > AtomicThreadId;
 
+        //! @cond
+        class WeakGuard
+        {
+        public:
+            WeakGuard(const RCSResourceObject&);
+            ~WeakGuard();
+
+            WeakGuard(const WeakGuard&) = delete;
+            WeakGuard(WeakGuard&&) = delete;
+
+            WeakGuard& operator=(const WeakGuard&) = delete;
+            WeakGuard& operator=(WeakGuard&&) = delete;
+
+            bool hasLocked() const;
+
+        private:
+            bool m_isOwningLock;
+            const RCSResourceObject& m_resourceObject;
+        };
+        //! @endcond
+
         public:
+
             /**
              * Represents the policy of auto-notify function.
              * In accord with this policy, observers are notified of attributes
@@ -328,7 +350,7 @@ namespace OIC
             template< typename T >
             T getAttribute(const std::string& key) const
             {
-                WeakGuard lock(*this);
+               RCSResourceObject::WeakGuard lock(*this);
                 return m_resourceAttributes.at(key).get< T >();
             }
 
@@ -668,26 +690,6 @@ namespace OIC
             std::function<void()> m_autoNotifyFunc;
         };
 
-        //! @cond
-        class RCSResourceObject::WeakGuard
-        {
-        public:
-            WeakGuard(const RCSResourceObject&);
-            ~WeakGuard();
-
-            WeakGuard(const WeakGuard&) = delete;
-            WeakGuard(WeakGuard&&) = delete;
-
-            WeakGuard& operator=(const WeakGuard&) = delete;
-            WeakGuard& operator=(WeakGuard&&) = delete;
-
-            bool hasLocked() const;
-
-        private:
-            bool m_isOwningLock;
-            const RCSResourceObject& m_resourceObject;
-        };
-        //! @endcond
     }
 }