CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::DB::PropertiesDatabaseIterator Class Reference

#include <PropertiesDatabase.hh>

+ Inheritance diagram for CASM::DB::PropertiesDatabaseIterator:

Detailed Description

Wrapper class for specializations PropertiesDatabaseIteratorBase.

Dereferencing PropertiesDatabaseIterator only provides const references, whether the underlying resource is persistent (jsonPropertiesDatabase) or temporary (other types). Changing database entries must be done via copy then insert, or update.

DatabaseIterator should always be dereferenceable (except end or when default constructed), though the reference may be invalidated when a second DatabaseIterator is dereferenced, dereferencing the first again should be valid (though it may require re-allocation):

primclex.properties<ValueType>().find_via_origin(A_name); const
MappedProperties& A_ref1 = *A; // ok A_ref1.method(); // ok A->method();
// ok
PropertiesDatabaseIterator<ValueType> B =
primclex.properties<ValueType>().find_via_origin(B_name); const
MappedProperties& B_ref = *B; // ok, but now A_ref1 may be invalidated
A_ref1.method(); // maybe not ok
A->method(); // ok
B->method(); // ok
const MappedProperties& A_ref2 = *A; // ok, but now B_ref may be
invalidated A_ref1.method(); // maybe not ok A_ref2.method(); // ok
B_ref.method(); // maybe not ok
A->method(); // ok
B->method(); // ok
PropertiesDatabaseIterator()
Default constructor.
PrimClex * primclex
Definition: settings.cc:135

Definition at line 113 of file PropertiesDatabase.hh.

Public Member Functions

 PropertiesDatabaseIterator ()
 Default constructor. More...
 
 PropertiesDatabaseIterator (const PropertiesDatabaseIteratorBase &it)
 Construct iterator. More...
 
PropertiesDatabaseIteratorBaseget () const
 

Private Member Functions

void increment ()
 boost::iterator_facade implementation More...
 
const MappedPropertiesdereference () const
 boost::iterator_facade implementation More...
 
bool equal (const PropertiesDatabaseIterator &B) const
 boost::iterator_facade implementation More...
 
long distance_to (const PropertiesDatabaseIterator &B) const
 

Private Attributes

notstd::cloneable_ptr< PropertiesDatabaseIteratorBasem_ptr
 

Constructor & Destructor Documentation

◆ PropertiesDatabaseIterator() [1/2]

CASM::DB::PropertiesDatabaseIterator::PropertiesDatabaseIterator ( )
inline

Default constructor.

Definition at line 120 of file PropertiesDatabase.hh.

◆ PropertiesDatabaseIterator() [2/2]

CASM::DB::PropertiesDatabaseIterator::PropertiesDatabaseIterator ( const PropertiesDatabaseIteratorBase it)
inline

Construct iterator.

Definition at line 123 of file PropertiesDatabase.hh.

Member Function Documentation

◆ dereference()

const MappedProperties& CASM::DB::PropertiesDatabaseIterator::dereference ( ) const
inlineprivate

boost::iterator_facade implementation

Definition at line 135 of file PropertiesDatabase.hh.

◆ distance_to()

long CASM::DB::PropertiesDatabaseIterator::distance_to ( const PropertiesDatabaseIterator B) const
inlineprivate

Definition at line 142 of file PropertiesDatabase.hh.

◆ equal()

bool CASM::DB::PropertiesDatabaseIterator::equal ( const PropertiesDatabaseIterator B) const
inlineprivate

boost::iterator_facade implementation

Definition at line 138 of file PropertiesDatabase.hh.

◆ get()

PropertiesDatabaseIteratorBase* CASM::DB::PropertiesDatabaseIterator::get ( ) const
inline

Definition at line 126 of file PropertiesDatabase.hh.

◆ increment()

void CASM::DB::PropertiesDatabaseIterator::increment ( )
inlineprivate

boost::iterator_facade implementation

Definition at line 132 of file PropertiesDatabase.hh.

Member Data Documentation

◆ m_ptr

notstd::cloneable_ptr<PropertiesDatabaseIteratorBase> CASM::DB::PropertiesDatabaseIterator::m_ptr
private

Definition at line 146 of file PropertiesDatabase.hh.


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