* 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
template< typename T >
T getAttribute(const std::string& key) const
{
- WeakGuard lock(*this);
+ RCSResourceObject::WeakGuard lock(*this);
return m_resourceAttributes.at(key).get< T >();
}
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
}
}
m_resourceObject, m_resourceObject.m_resourceAttributes, m_autoNotifyPolicy);
}
- RCSResourceObject::WeakGuard::WeakGuard(
+ RCSResourceObject::WeakGuard::WeakGuard(
const RCSResourceObject& resourceObject) :
m_isOwningLock{ false },
m_resourceObject(resourceObject)