CASM  1.1.0
A Clusters Approach to Statistical Mechanics
QueryHandler.hh
Go to the documentation of this file.
1 #ifndef CASM_QueryHandler
2 #define CASM_QueryHandler
3 
4 #include <map>
5 #include <memory>
6 
9 
10 namespace CASM {
11 
12 class RuntimeLibrary;
13 class ProjectSettings;
14 
15 namespace DB {
16 template <typename DataObject>
17 class Selected;
18 template <typename DataObject>
19 class Selection;
20 } // namespace DB
21 
22 template <typename _DataObject>
25  public:
26  typedef _DataObject DataObject;
27 
29 
31 
33 
35  void set_selected(const DB::Selected<DataObject> &selection);
36 
38  void set_selected(const DB::Selection<DataObject> &selection);
39 
44  void add_alias(const std::string &alias_name,
45  const std::string &alias_command);
46 
51  const std::map<std::string, std::string> &aliases() const {
52  return m_aliases;
53  }
54 
55  private:
60  std::map<std::string, std::string> &_aliases() { return m_aliases; }
61 
63 
64  std::map<std::string, std::string> m_aliases;
65 
67 
68  std::map<std::string, std::shared_ptr<RuntimeLibrary> > m_lib;
69 };
70 
72 template <typename DataFormatterDictInserter, typename RuntimeLibInserter>
73 std::pair<DataFormatterDictInserter, RuntimeLibInserter> load_query_plugins(
74  const ProjectSettings &set, DataFormatterDictInserter dict_it,
75  RuntimeLibInserter lib_it);
76 
77 } // namespace CASM
78 
79 #endif
Returns true if configuration is specified in given selection (default: MASTER)
Definition: Selected.hh:20
QueryHandler(const ProjectSettings &set)
const std::map< std::string, std::string > & aliases() const
const Access aliases map
Definition: QueryHandler.hh:51
const ProjectSettings * m_set
Definition: QueryHandler.hh:62
DataFormatterDictionary< DataObject > & dict()
std::map< std::string, std::shared_ptr< RuntimeLibrary > > m_lib
Definition: QueryHandler.hh:68
_DataObject DataObject
Definition: QueryHandler.hh:26
std::map< std::string, std::string > & _aliases()
Access aliases map.
Definition: QueryHandler.hh:60
std::map< std::string, std::string > m_aliases
Definition: QueryHandler.hh:64
notstd::cloneable_ptr< DataFormatterDictionary< DataObject > > m_dict
Definition: QueryHandler.hh:66
void add_alias(const std::string &alias_name, const std::string &alias_command)
Add user-defined query alias.
void set_selected(const DB::Selected< DataObject > &selection)
Set the selection to be used for the 'selected' column.
Base class for cloning.
A 'cloneable_ptr' can be used in place of 'unique_ptr'.
#define CLONEABLE_NEEDS_DESTRUCTOR_DEF(T)
Main CASM namespace.
Definition: APICommand.hh:8
std::pair< DataFormatterDictInserter, RuntimeLibInserter > load_query_plugins(const ProjectSettings &set, DataFormatterDictInserter dict_it, RuntimeLibInserter lib_it)
Load enumerator plugins from a CASM project.
ProjectSettings & set
Definition: settings.cc:137