Skip to content

Commit

Permalink
Merge pull request #44 from leapmotion/doc-atomicobject
Browse files Browse the repository at this point in the history
Updating atomic_object documentation
  • Loading branch information
gtremper committed Aug 14, 2014
2 parents eccabf8 + b4be119 commit e6eec3c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions autowiring/atomic_object.h
Expand Up @@ -3,6 +3,7 @@
#include MUTEX_HEADER

#include "unlock_object.h"

template<class object, class lock> class unlock_object;

///<summary>
Expand All @@ -24,7 +25,6 @@ class atomic_object {
typedef std::shared_ptr<atomic_object<object, lock>> shared;

protected:
//CONTRACT: If !m_initialized then m_object == object();
mutable lock m_lock;
object m_object;

Expand All @@ -35,12 +35,8 @@ class atomic_object {
atomic_object() {};

///<summary>
///Initialization yielding initialized() == source.initialized().
///Thread-safe copy constructor
///</summary>
///<remarks>
///Intermediate copies can be avoided during construction using:
/// atomic_object<object> target(*unlock_object<object>(source));
///</remarks>
atomic_object(const atomic_object<object>& source) {
std::lock_guard<lock> lock_source(source.m_lock);
m_object = source.m_object;
Expand Down Expand Up @@ -75,7 +71,7 @@ class atomic_object {
}

///<summary>
///Assignment yielding initialized() == true.
///Assignment overload
///</summary>
atomic_object<object, lock>& operator = (const object& source) {
std::lock_guard<lock> lock_this(m_lock);
Expand Down

0 comments on commit e6eec3c

Please sign in to comment.