fw4spl
fwMemory::BufferObject::LockBase< T > Class Template Reference

base class for BufferObject Lock More...

#include <BufferObject.hpp>

Public Types

typedef ::boost::conditional< std::is_const< T >::value, const void *, void * >::type BufferType
 

Public Member Functions

 LockBase ()
 Build an empty lock.
 
 LockBase (const std::shared_ptr< T > &bo)
 Build a lock on object 'bo'. More...
 
LockBase< T >::BufferType getBuffer () const
 Returns BufferObject's buffer pointer.
 
void reset ()
 Release any count on any Buffer the lock may have.
 

Protected Attributes

BufferObject::CounterType m_count
 
std::weak_ptr< T > m_bufferObject
 

Detailed Description

template<typename T>
class fwMemory::BufferObject::LockBase< T >

base class for BufferObject Lock

This class purpose is to provide a way to count buffer uses, to prevent BufferManager changes on buffer if nb uses > 0

The count is shared with the associated BufferObject. Be aware that this mechanism is actually not thread-safe.

Definition at line 88 of file BufferObject.hpp.

Constructor & Destructor Documentation

template<typename T>
fwMemory::BufferObject::LockBase< T >::LockBase ( const std::shared_ptr< T > &  bo)
inline

Build a lock on object 'bo'.

Increments BufferObject's lock counts.

Parameters
boBufferObject to lock

Definition at line 108 of file BufferObject.hpp.

References SLM_ASSERT.


The documentation for this class was generated from the following file: