Detail::UsedRange Class Reference

#include <partdata.h>

Inheritance diagram for Detail::UsedRange:

Inheritance graph
[legend]
Collaboration diagram for Detail::UsedRange:

Collaboration graph
[legend]
List of all members.

Detailed Description

Range marked as "in use".

UsedRange concept is similar to many thread libraries lock object concepts - you retrieve one via get() methods in PartData, and when it is destroyed, it takes care that all used/locked ranges do get freed properly. This object may only be used when wrapped in boost::shared_ptr.

Note:
There may be multiple UsedRange's refering to same Chunk. This is indicated by m_useCnt member of Chunk class.

Definition at line 325 of file partdata.h.


Public Member Functions

boost::shared_ptr< LockedRangegetLock (uint32_t size)
 Aquire a lock within this UsedRange.
bool isComplete () const
 Check this UsedRange for completeness.
 ~UsedRange ()
 Destructor public for boost::checked_deleter.

Private Member Functions

template<typename IterType>
 UsedRange (PartData *parent, IterType it)
 Constructor.
 UsedRange (PartData *parent, uint64_t begin, uint64_t end)
 Constructs new UsedRange with specified begin and end offsets, w/o associating it with any specific chunk.
 UsedRange (const UsedRange &)
 copying is not allowed
UsedRangeoperator= (const UsedRange &)

Private Attributes

PartDatam_parent
 Parent PartData.
boost::scoped_ptr< Detail::AvailIterm_chunk
 Chunk this UsedRange refers to.

Friends

class ::PartData

Constructor & Destructor Documentation

Detail::UsedRange::~UsedRange  ) 
 

Destructor public for boost::checked_deleter.

Definition at line 198 of file partdata.cpp.

References __1, Range< T >::begin(), Range< T >::end(), Detail::ID_Avail, logTrace(), m_chunk, PartData::m_chunks, PartData::m_dest, m_parent, and TRACE_PARTDATA.

Here is the call graph for this function:

template<typename IterType>
Detail::UsedRange::UsedRange PartData parent,
IterType  it
[private]
 

Constructor.

Allowed only by PartData. UsedRange keeps a pointer back to its parent object, and also sets up event handers as neccesery to ensure the pointer remains valid.

Note:
The template may be left undefined here since it's only called from inside partdata.cpp

Definition at line 172 of file partdata.cpp.

References __1, Range< T >::begin(), CHECK_THROW, Range< T >::end(), Detail::ID_Avail, logTrace(), m_chunk, PartData::m_chunks, PartData::m_dest, m_parent, and TRACE_PARTDATA.

Here is the call graph for this function:

Detail::UsedRange::UsedRange PartData parent,
uint64_t  begin,
uint64_t  end
[private]
 

Constructs new UsedRange with specified begin and end offsets, w/o associating it with any specific chunk.

Definition at line 188 of file partdata.cpp.

References Range< T >::begin(), Range< T >::end(), logTrace(), m_chunk, PartData::m_chunks, PartData::m_dest, m_parent, and TRACE_PARTDATA.

Here is the call graph for this function:

Detail::UsedRange::UsedRange const UsedRange  )  [private]
 

copying is not allowed


Member Function Documentation

LockedRangePtr Detail::UsedRange::getLock uint32_t  size  ) 
 

Aquire a lock within this UsedRange.

Parameters:
size Size of the requested lock
Returns:
Locked range object
Note:
The returned locked range may be smaller than requested
Exceptions:
PartData::LockError if locking fails for any reason

Definition at line 211 of file partdata.cpp.

References PartData::getLock(), and m_parent.

Here is the call graph for this function:

bool Detail::UsedRange::isComplete  )  const
 

Check this UsedRange for completeness.

Definition at line 215 of file partdata.cpp.

References PartData::isComplete(), and m_parent.

Here is the call graph for this function:

UsedRange& Detail::UsedRange::operator= const UsedRange  )  [private]
 


Friends And Related Function Documentation

friend class ::PartData [friend]
 

Definition at line 349 of file partdata.h.


Member Data Documentation

boost::scoped_ptr<Detail::AvailIter> Detail::UsedRange::m_chunk [private]
 

Chunk this UsedRange refers to.

Definition at line 378 of file partdata.h.

Referenced by UsedRange(), and ~UsedRange().

PartData* Detail::UsedRange::m_parent [private]
 

Parent PartData.

Definition at line 375 of file partdata.h.

Referenced by getLock(), isComplete(), UsedRange(), and ~UsedRange().


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