CASM  1.1.0
A Clusters Approach to Statistical Mechanics
Update.hh
Go to the documentation of this file.
1 #ifndef CASM_DB_Update
2 #define CASM_DB_Update
3 
5 
6 namespace CASM {
7 namespace Completer {
8 class UpdateOption;
9 }
10 } // namespace CASM
11 
12 // To be specialized for calculable 'ConfigType' classes:
13 // StructureMap<ConfigType>::map(fs::path, DatabaseIterator<ConfigType> hint,
14 // inserter result) Import<ConfigType>::desc Import<ConfigType>::run
15 // Import<ConfigType>::_import_formatter
16 // Update<ConfigType>::desc
17 // Update<ConfigType>::run
18 // Update<ConfigType>::_update_formatter
19 // Remove<ConfigType>::desc
20 // Remove<ConfigType>::run
21 
22 namespace CASM {
23 namespace DB {
24 
25 template <typename T>
26 class Selection;
27 
29 template <typename _ConfigType>
30 class UpdateT : protected ConfigData {
31  public:
32  typedef _ConfigType ConfigType;
33 
35  UpdateT(const PrimClex &primclex, const StructureMap<ConfigType> &mapper,
36  std::string report_dir);
37 
39  void update(const DB::Selection<ConfigType> &selection, bool force);
40 
41  protected:
42  // Allow ConfigType to specialize the report formatting for 'update'
44 
45  void _update_report(std::vector<ConfigIO::Result> &results,
46  const DB::Selection<ConfigType> &selection) const;
47 
48  private:
50 
51  std::string m_report_dir;
52 };
53 
54 // To be specialized for ConfigType (no default implemenation exists)
55 template <typename ConfigType>
56 class Update;
57 /*: public UpdateT<ConfigType> {
58 public:
59  static const std::string desc;
60  int run(const PrimClex &, const jsonParser &input, const
61 Completer::UpdateOption &opt);
62 
63 private:
64  // Allow ConfigType to specialize the report formatting for 'update'
65  DataFormatter<ConfigIO::Result> _update_formatter() const override;
66  };*/
67 
68 } // namespace DB
69 } // namespace CASM
70 
71 #endif
const PrimClex & primclex() const
Definition: ConfigData.hh:152
Generic ConfigType-dependent part of Import.
Definition: Update.hh:30
UpdateT(const PrimClex &primclex, const StructureMap< ConfigType > &mapper, std::string report_dir)
Constructor.
Definition: Update_impl.hh:18
virtual DataFormatter< ConfigIO::Result > _update_formatter() const =0
void _update_report(std::vector< ConfigIO::Result > &results, const DB::Selection< ConfigType > &selection) const
Definition: Update_impl.hh:100
_ConfigType ConfigType
Definition: Update.hh:32
const StructureMap< ConfigType > & m_structure_mapper
Definition: Update.hh:49
std::string m_report_dir
Definition: Update.hh:51
void update(const DB::Selection< ConfigType > &selection, bool force)
Re-parse calculations 'from' all selected configurations.
Definition: Update_impl.hh:27
Extract data from objects of 'DataObject' class.
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:55
Main CASM namespace.
Definition: APICommand.hh:8