CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::ConfigSelection< IsConst > Singleton Reference

#include <ProjectSettings.hh>

Detailed Description

template<bool IsConst>
singleton CASM::ConfigSelection< IsConst >

Definition at line 23 of file ProjectSettings.hh.

Public Types

typedef CASM_TMP::ConstSwitch
< IsConst, PrimClex
PrimClexType
 
typedef CASM_TMP::ConstSwitch
< IsConst, Configuration
value_type
 
typedef
ConfigSelectionIterator
< IsConst, false > 
iterator
 
typedef
ConfigSelectionIterator
< IsConst, true > 
const_iterator
 

Public Member Functions

 ConfigSelection ()
 Default constructor. More...
 
 ConfigSelection (PrimClexType &_primclex, const fs::path &selection_path="MASTER")
 Construct a configuration selection from all configurations. More...
 
 ConfigSelection (const ConfigSelection< false > &RHS)
 
ConfigSelectionoperator= (const ConfigSelection &)=default
 
Index size () const
 
iterator find (const std::string &configname)
 
const_iterator find (const std::string &configname) const
 
void read (std::istream &_input)
 
const jsonParserfrom_json (const jsonParser &_json)
 
jsonParserto_json (const DataFormatterDictionary< Configuration > &_dict, jsonParser &_json, bool only_selected=false) const
 
bool selected (const std::string &configname) const
 check if configuration is selected (returns false if 'configname' cannot be found More...
 
bool selected (const Configuration &config) const
 
void set_selected (const std::string &configname, bool is_selected)
 
void set_selected (const Configuration &config, bool is_selected)
 
iterator config_begin ()
 
const_iterator config_begin () const
 
iterator config_end ()
 
const_iterator config_end () const
 
const_iterator config_cbegin () const
 
const_iterator config_cend () const
 
iterator selected_config_begin ()
 
const_iterator selected_config_begin () const
 
iterator selected_config_end ()
 
const_iterator selected_config_end () const
 
const_iterator selected_config_cbegin () const
 
const_iterator selected_config_cend () const
 
std::pair< iterator, bool > insert (const std::pair< std::string, bool > &value)
 
const_iterator erase (const const_iterator &it)
 
int erase (const std::string &configname)
 
const std::vector< std::string > & col_headers () const
 
const std::string & name () const
 
void print (const DataFormatterDictionary< Configuration > &_dict, std::ostream &_out, bool only_selected=false) const
 

Private Attributes

PrimClexTypem_primclex
 
std::string m_name
 
std::map< std::string, bool > m_config
 
std::vector< std::string > m_col_headers
 

Friends

class ConfigSelection< !IsConst >
 

Member Typedef Documentation

template<bool IsConst>
typedef ConfigSelectionIterator<IsConst, true> CASM::ConfigSelection< IsConst >::const_iterator

Definition at line 93 of file ConfigSelection.hh.

template<bool IsConst>
typedef ConfigSelectionIterator<IsConst, false> CASM::ConfigSelection< IsConst >::iterator

Definition at line 92 of file ConfigSelection.hh.

template<bool IsConst>
typedef CASM_TMP::ConstSwitch<IsConst, PrimClex> CASM::ConfigSelection< IsConst >::PrimClexType

Definition at line 90 of file ConfigSelection.hh.

template<bool IsConst>
typedef CASM_TMP::ConstSwitch<IsConst, Configuration> CASM::ConfigSelection< IsConst >::value_type

Definition at line 91 of file ConfigSelection.hh.

Constructor & Destructor Documentation

template<bool IsConst>
CASM::ConfigSelection< IsConst >::ConfigSelection ( )
inline

Default constructor.

Definition at line 97 of file ConfigSelection.hh.

template<bool IsConst>
CASM::ConfigSelection< IsConst >::ConfigSelection ( PrimClexType _primclex,
const fs::path &  selection_path = "MASTER" 
)

Construct a configuration selection from all configurations.

Reads a configuration selection from file at 'selection_path'

  • If selection_path=="MASTER", load master config_list as selection
  • If selection_path=="ALL", load all from config_list as selection
  • If selection_path=="NONE", load all from config_list as not selected
  • If selection_path=="CALCULATED", load configurations for which 'is_calculated' returns true
  • Else, assume path to file:
    • Checks extension to determine file type:
      • Ending in '.json' or '.JSON' for JSON formatted file
      • Otherwise, CSV formatted file
    • If column headers are detected, they are also stored, and can be accessed using 'ConfigSelection::col_headers()'
      • Currently, the first two columns are always 'name' and 'selected' so these headers are assumed and not stored
template<bool IsConst>
CASM::ConfigSelection< IsConst >::ConfigSelection ( const ConfigSelection< false > &  RHS)
inline

Definition at line 118 of file ConfigSelection.hh.

Member Function Documentation

template<bool IsConst>
const std::vector<std::string>& CASM::ConfigSelection< IsConst >::col_headers ( ) const
inline

Definition at line 226 of file ConfigSelection.hh.

template<bool IsConst>
iterator CASM::ConfigSelection< IsConst >::config_begin ( )
inline

Definition at line 164 of file ConfigSelection.hh.

template<bool IsConst>
const_iterator CASM::ConfigSelection< IsConst >::config_begin ( ) const
inline

Definition at line 168 of file ConfigSelection.hh.

template<bool IsConst>
const_iterator CASM::ConfigSelection< IsConst >::config_cbegin ( ) const
inline

Definition at line 180 of file ConfigSelection.hh.

template<bool IsConst>
const_iterator CASM::ConfigSelection< IsConst >::config_cend ( ) const
inline

Definition at line 184 of file ConfigSelection.hh.

template<bool IsConst>
iterator CASM::ConfigSelection< IsConst >::config_end ( )
inline

Definition at line 172 of file ConfigSelection.hh.

template<bool IsConst>
const_iterator CASM::ConfigSelection< IsConst >::config_end ( ) const
inline

Definition at line 176 of file ConfigSelection.hh.

template<bool IsConst>
const_iterator CASM::ConfigSelection< IsConst >::erase ( const const_iterator it)
inline

Definition at line 217 of file ConfigSelection.hh.

template<bool IsConst>
int CASM::ConfigSelection< IsConst >::erase ( const std::string &  configname)
inline

Definition at line 222 of file ConfigSelection.hh.

template<bool IsConst>
iterator CASM::ConfigSelection< IsConst >::find ( const std::string &  configname)
inline

Definition at line 130 of file ConfigSelection.hh.

template<bool IsConst>
const_iterator CASM::ConfigSelection< IsConst >::find ( const std::string &  configname) const
inline

Definition at line 134 of file ConfigSelection.hh.

template<bool IsConst>
const jsonParser & CASM::ConfigSelection< IsConst >::from_json ( const jsonParser _json)

Definition at line 79 of file ConfigSelection_impl.hh.

template<bool IsConst>
std::pair<iterator, bool> CASM::ConfigSelection< IsConst >::insert ( const std::pair< std::string, bool > &  value)
inline

Definition at line 212 of file ConfigSelection.hh.

template<bool IsConst>
const std::string& CASM::ConfigSelection< IsConst >::name ( ) const
inline

Definition at line 230 of file ConfigSelection.hh.

template<bool IsConst>
ConfigSelection& CASM::ConfigSelection< IsConst >::operator= ( const ConfigSelection< IsConst > &  )
default
template<bool IsConst>
void CASM::ConfigSelection< IsConst >::print ( const DataFormatterDictionary< Configuration > &  _dict,
std::ostream &  _out,
bool  only_selected = false 
) const

Definition at line 153 of file ConfigSelection_impl.hh.

template<bool IsConst>
void CASM::ConfigSelection< IsConst >::read ( std::istream &  _input)

Definition at line 56 of file ConfigSelection_impl.hh.

template<bool IsConst>
bool CASM::ConfigSelection< IsConst >::selected ( const std::string &  configname) const
inline

check if configuration is selected (returns false if 'configname' cannot be found

Definition at line 147 of file ConfigSelection.hh.

template<bool IsConst>
bool CASM::ConfigSelection< IsConst >::selected ( const Configuration config) const
inline

Definition at line 152 of file ConfigSelection.hh.

template<bool IsConst>
iterator CASM::ConfigSelection< IsConst >::selected_config_begin ( )
inline

Definition at line 188 of file ConfigSelection.hh.

template<bool IsConst>
const_iterator CASM::ConfigSelection< IsConst >::selected_config_begin ( ) const
inline

Definition at line 192 of file ConfigSelection.hh.

template<bool IsConst>
const_iterator CASM::ConfigSelection< IsConst >::selected_config_cbegin ( ) const
inline

Definition at line 204 of file ConfigSelection.hh.

template<bool IsConst>
const_iterator CASM::ConfigSelection< IsConst >::selected_config_cend ( ) const
inline

Definition at line 208 of file ConfigSelection.hh.

template<bool IsConst>
iterator CASM::ConfigSelection< IsConst >::selected_config_end ( )
inline

Definition at line 196 of file ConfigSelection.hh.

template<bool IsConst>
const_iterator CASM::ConfigSelection< IsConst >::selected_config_end ( ) const
inline

Definition at line 200 of file ConfigSelection.hh.

template<bool IsConst>
void CASM::ConfigSelection< IsConst >::set_selected ( const std::string &  configname,
bool  is_selected 
)
inline

Definition at line 156 of file ConfigSelection.hh.

template<bool IsConst>
void CASM::ConfigSelection< IsConst >::set_selected ( const Configuration config,
bool  is_selected 
)
inline

Definition at line 160 of file ConfigSelection.hh.

template<bool IsConst>
Index CASM::ConfigSelection< IsConst >::size ( ) const
inline

Definition at line 126 of file ConfigSelection.hh.

template<bool IsConst>
jsonParser & CASM::ConfigSelection< IsConst >::to_json ( const DataFormatterDictionary< Configuration > &  _dict,
jsonParser _json,
bool  only_selected = false 
) const

Definition at line 130 of file ConfigSelection_impl.hh.

Friends And Related Function Documentation

template<bool IsConst>
friend class ConfigSelection< !IsConst >
friend

Definition at line 239 of file ConfigSelection.hh.

Member Data Documentation

template<bool IsConst>
std::vector<std::string> CASM::ConfigSelection< IsConst >::m_col_headers
private

Definition at line 244 of file ConfigSelection.hh.

template<bool IsConst>
std::map<std::string, bool> CASM::ConfigSelection< IsConst >::m_config
private

Definition at line 243 of file ConfigSelection.hh.

template<bool IsConst>
std::string CASM::ConfigSelection< IsConst >::m_name
private

Definition at line 242 of file ConfigSelection.hh.

template<bool IsConst>
PrimClexType* CASM::ConfigSelection< IsConst >::m_primclex
private

Definition at line 241 of file ConfigSelection.hh.


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