CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
ConfigIOSelected.hh
Go to the documentation of this file.
1 #ifndef CONFIGIOSELECTED_HH
2 #define CONFIGIOSELECTED_HH
3 
7 //#include "casm/app/casm_functions.hh"
8 
9 namespace CASM {
10  class Configuration;
11 
12  namespace ConfigIO {
13 
20  class Selected : public BooleanAttribute<Configuration> {
21  public:
23  : BooleanAttribute<Configuration>("selected_in", "Returns true if configuration is specified in given selection (default MASTER). Ex: 'selected_in(myselection.txt)'") {}
24 
25  Selected(const Selected &) = default;
26 
27  template<bool IsConst>
28  explicit Selected(ConfigSelection<IsConst> _selection):
29  BooleanAttribute<Configuration>("selected_in", "Returns true if configuration is specified in given selection (default MASTER). Ex: 'selected_in(myselection.txt)'"),
30  m_selection(_selection) {}
31 
32 
33  // --- Required implementations -----------
34 
35  std::unique_ptr<Selected> clone() const;
36 
37  bool evaluate(const Configuration &_config) const override;
38 
39 
40  // --- Specialized implementation -----------
41 
42  void init(const Configuration &_tmplt) const override;
43 
44  std::string short_header(const Configuration &_config) const override;
45  /*
46  void inject(const Configuration &_config, DataStream &_stream, Index) const override;
47 
48  void print(const Configuration &_config, std::ostream &_stream, Index) const override;
49 
50  jsonParser &to_json(const Configuration &_config, jsonParser &json)const override;
51  */
52  bool parse_args(const std::string &args) override;
53 
54  private:
55 
57  Selected *_clone() const override;
58 
59  mutable std::string m_selection_name;
61  };
62  }
63 }
64 #endif
ConstConfigSelection m_selection
bool parse_args(const std::string &args) override
bool evaluate(const Configuration &_config) const override
Main CASM namespace.
Definition: complete.cpp:8
Base class for creating scalar DatumFormatter.
Selected(ConfigSelection< IsConst > _selection)
std::unique_ptr< Selected > clone() const
void init(const Configuration &_tmplt) const override
std::string short_header(const Configuration &_config) const override
Selected * _clone() const override
Clone.
A Configuration represents the values of all degrees of freedom in a Supercell.
Returns true if configuration is specified in given selection (default: MASTER)