Storage Engine API
mongo::Partitioned< AssociativeContainer, nPartitions, KeyPartitioner >::OnePartition Class Reference

Used to protect access to a single partition of a Partitioned. More...

#include <partitioned.h>

Detailed Description

template<typename AssociativeContainer, std::size_t nPartitions = 16, typename KeyPartitioner = Partitioner<typename AssociativeContainer::key_type>>
class mongo::Partitioned< AssociativeContainer, nPartitions, KeyPartitioner >::OnePartition

Used to protect access to a single partition of a Partitioned.

For example, can be used to do a series of reads and/or modifications to a single entry without interference from other threads.

Public Member Functions

AssociativeContainer * operator-> () const &
 Returns a pointer to the structure in this partition. More...
 
void operator-> () &&=delete
 
AssociativeContainer & operator* () const &
 Returns a reference to the structure in this partition. More...
 
void operator* () &&=delete
 

Private Member Functions

 OnePartition (Partitioned &partitioned, PartitionId partitionId)
 Acquires locks for the ith partition. More...
 

Private Attributes

stdx::unique_lock< stdx::mutex > _partitionLock
 
Partitioned_partitioned
 
PartitionId _id
 

Friends

class Partitioned
 

Constructor & Destructor Documentation

◆ OnePartition()

template<typename AssociativeContainer , std::size_t nPartitions = 16, typename KeyPartitioner = Partitioner<typename AssociativeContainer::key_type>>
mongo::Partitioned< AssociativeContainer, nPartitions, KeyPartitioner >::OnePartition::OnePartition ( Partitioned partitioned,
PartitionId  partitionId 
)
inlineprivate

Acquires locks for the ith partition.

partitionedAssociativeContainer must outlive this GuardedPartition. If a single thread needs access to multiple partitions, it must use GuardedAssociativeContainer, or acquire them in ascending order.

Member Function Documentation

◆ operator*() [1/2]

template<typename AssociativeContainer , std::size_t nPartitions = 16, typename KeyPartitioner = Partitioner<typename AssociativeContainer::key_type>>
AssociativeContainer& mongo::Partitioned< AssociativeContainer, nPartitions, KeyPartitioner >::OnePartition::operator* ( ) const &
inline

Returns a reference to the structure in this partition.

◆ operator*() [2/2]

template<typename AssociativeContainer , std::size_t nPartitions = 16, typename KeyPartitioner = Partitioner<typename AssociativeContainer::key_type>>
void mongo::Partitioned< AssociativeContainer, nPartitions, KeyPartitioner >::OnePartition::operator* ( ) &&
delete

◆ operator->() [1/2]

template<typename AssociativeContainer , std::size_t nPartitions = 16, typename KeyPartitioner = Partitioner<typename AssociativeContainer::key_type>>
AssociativeContainer* mongo::Partitioned< AssociativeContainer, nPartitions, KeyPartitioner >::OnePartition::operator-> ( ) const &
inline

Returns a pointer to the structure in this partition.

◆ operator->() [2/2]

template<typename AssociativeContainer , std::size_t nPartitions = 16, typename KeyPartitioner = Partitioner<typename AssociativeContainer::key_type>>
void mongo::Partitioned< AssociativeContainer, nPartitions, KeyPartitioner >::OnePartition::operator-> ( ) &&
delete

Friends And Related Function Documentation

◆ Partitioned

template<typename AssociativeContainer , std::size_t nPartitions = 16, typename KeyPartitioner = Partitioner<typename AssociativeContainer::key_type>>
friend class Partitioned
friend

Member Data Documentation

◆ _id

template<typename AssociativeContainer , std::size_t nPartitions = 16, typename KeyPartitioner = Partitioner<typename AssociativeContainer::key_type>>
PartitionId mongo::Partitioned< AssociativeContainer, nPartitions, KeyPartitioner >::OnePartition::_id
private

◆ _partitioned

template<typename AssociativeContainer , std::size_t nPartitions = 16, typename KeyPartitioner = Partitioner<typename AssociativeContainer::key_type>>
Partitioned* mongo::Partitioned< AssociativeContainer, nPartitions, KeyPartitioner >::OnePartition::_partitioned
private

◆ _partitionLock

template<typename AssociativeContainer , std::size_t nPartitions = 16, typename KeyPartitioner = Partitioner<typename AssociativeContainer::key_type>>
stdx::unique_lock<stdx::mutex> mongo::Partitioned< AssociativeContainer, nPartitions, KeyPartitioner >::OnePartition::_partitionLock
private

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