CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::DB::PropertiesDatabaseIteratorBase Class Referenceabstract

#include <PropertiesDatabase.hh>

+ Inheritance diagram for CASM::DB::PropertiesDatabaseIteratorBase:

Detailed Description

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

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

DerivedDatabaseIterator A = ... get from DerivedDatabase ...;
const MappedProperties& A_ref1 = *A; // ok
A_ref1.method(); // ok
A->method(); // ok
DerivedDatabaseIterator B = ... get from DerivedDatabase ...;
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
DoFSpecsType const & get(DoFKey const &key, BasisFunctionSpecs const &basis_function_specs)

Derived classes must implement private methods:

Definition at line 52 of file PropertiesDatabase.hh.

Public Types

typedef MappedProperties value_type
 
typedef const value_typereference
 

Public Member Functions

 PropertiesDatabaseIteratorBase ()
 
virtual ~PropertiesDatabaseIteratorBase ()
 
std::unique_ptr< PropertiesDatabaseIteratorBaseclone () const
 

Private Member Functions

virtual void increment ()=0
 
virtual reference dereference () const =0
 
virtual bool equal (const PropertiesDatabaseIteratorBase &other) const =0
 
virtual PropertiesDatabaseIteratorBase_clone () const =0
 
virtual long distance_to (const PropertiesDatabaseIteratorBase &other) const =0
 

Private Attributes

friend PropertiesDatabaseIterator
 

Member Typedef Documentation

◆ reference

◆ value_type

Constructor & Destructor Documentation

◆ PropertiesDatabaseIteratorBase()

CASM::DB::PropertiesDatabaseIteratorBase::PropertiesDatabaseIteratorBase ( )
inline

Definition at line 59 of file PropertiesDatabase.hh.

◆ ~PropertiesDatabaseIteratorBase()

virtual CASM::DB::PropertiesDatabaseIteratorBase::~PropertiesDatabaseIteratorBase ( )
inlinevirtual

Definition at line 60 of file PropertiesDatabase.hh.

Member Function Documentation

◆ _clone()

virtual PropertiesDatabaseIteratorBase* CASM::DB::PropertiesDatabaseIteratorBase::_clone ( ) const
privatepure virtual

◆ clone()

std::unique_ptr<PropertiesDatabaseIteratorBase> CASM::DB::PropertiesDatabaseIteratorBase::clone ( ) const
inline

Definition at line 62 of file PropertiesDatabase.hh.

◆ dereference()

virtual reference CASM::DB::PropertiesDatabaseIteratorBase::dereference ( ) const
privatepure virtual

◆ distance_to()

virtual long CASM::DB::PropertiesDatabaseIteratorBase::distance_to ( const PropertiesDatabaseIteratorBase other) const
privatepure virtual

◆ equal()

virtual bool CASM::DB::PropertiesDatabaseIteratorBase::equal ( const PropertiesDatabaseIteratorBase other) const
privatepure virtual

◆ increment()

virtual void CASM::DB::PropertiesDatabaseIteratorBase::increment ( )
privatepure virtual

Member Data Documentation

◆ PropertiesDatabaseIterator

friend CASM::DB::PropertiesDatabaseIteratorBase::PropertiesDatabaseIterator
private

Definition at line 53 of file PropertiesDatabase.hh.


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