Detail::LockedRange Class Reference

#include <partdata.h>

Inheritance diagram for Detail::LockedRange:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

LockedRange object is an exclusivly locked Range in PartData.

The lock is aquired upon call to UsedRange::getLock() method, which constructs the lock object and returns to client code. The indicated range in PartData is then exclusivly locked, with this object being the only one allowed to access the locked region of the file. Upon the destruction of this object, the lock is automatically freed.

Definition at line 390 of file partdata.h.


Public Member Functions

 ~LockedRange ()
 Destructor public for boost::checked_deleter.
void write (uint64_t beginOffset, const std::string &data)
 Write data to within this locked region.
bool isComplete () const
 Check if this range is complete.

Private Member Functions

 LockedRange (PartData *parent, Range64 r)
 Construct new Lock.
 LockedRange (PartData *parent, Range64 r, Detail::AvailIter &it)
 Construct new lock and associate with chunk.
 LockedRange (const LockedRange &)
 Copying locks is forbidden.
LockedRangeoperator= (const LockedRange &)
 Parent file.

Private Attributes

PartDatam_parent
boost::scoped_ptr< Detail::AvailIterm_chunk
 The chunk containing this LockedRange. May be invalid.

Friends

class ::PartData

Constructor & Destructor Documentation

Detail::LockedRange::~LockedRange  ) 
 

Destructor public for boost::checked_deleter.

Definition at line 244 of file partdata.cpp.

References Range< uint64_t >::begin(), Range< uint64_t >::end(), RangeList< RangeType >::erase(), logTrace(), PartData::m_dest, PartData::m_locked, m_parent, and TRACE_PARTDATA.

Here is the call graph for this function:

Detail::LockedRange::LockedRange PartData parent,
Range64  r
[private]
 

Construct new Lock.

Parameters:
parent PartData object this lock belongs to
r Range to be locked

Definition at line 221 of file partdata.cpp.

References Range< uint64_t >::begin(), Range< uint64_t >::end(), Detail::ID_Avail, logTrace(), PartData::m_dest, PartData::m_locked, m_parent, RangeList< RangeType >::merge(), and TRACE_PARTDATA.

Here is the call graph for this function:

Detail::LockedRange::LockedRange PartData parent,
Range64  r,
Detail::AvailIter it
[private]
 

Construct new lock and associate with chunk.

Parameters:
parent PartData object this lock belongs to
r Range to be locked
it Iterator to chunk the lock belongs to

Definition at line 232 of file partdata.cpp.

References Range< uint64_t >::begin(), CHECK_THROW, Range< uint64_t >::end(), logTrace(), PartData::m_dest, PartData::m_locked, m_parent, RangeList< RangeType >::merge(), and TRACE_PARTDATA.

Here is the call graph for this function:

Detail::LockedRange::LockedRange const LockedRange  )  [private]
 

Copying locks is forbidden.


Member Function Documentation

bool Detail::LockedRange::isComplete  )  const [inline]
 

Check if this range is complete.

Definition at line 406 of file partdata.h.

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

Parent file.

void Detail::LockedRange::write uint64_t  beginOffset,
const std::string &  data
 

Write data to within this locked region.

Parameters:
beginOffset Begin offset where to write data
data Data to be written
Exceptions:
LockError If attempting to write outside this lock

Definition at line 253 of file partdata.cpp.

References PartData::doWrite(), Range< uint64_t >::end(), Detail::ID_Avail, m_chunk, PartData::m_chunks, and m_parent.

Here is the call graph for this function:


Friends And Related Function Documentation

friend class ::PartData [friend]
 

Definition at line 408 of file partdata.h.


Member Data Documentation

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

The chunk containing this LockedRange. May be invalid.

Definition at line 436 of file partdata.h.

Referenced by write().

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

Definition at line 433 of file partdata.h.

Referenced by LockedRange(), write(), and ~LockedRange().


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