2 namespace simpleformatter {
19 template <
typename ObjectType>
22 template <
typename ObjectType,
typename InputType>
24 std::function<EvaluatorPtrType<ObjectType>(InputType
const &)>;
26 template <
typename ObjectType,
typename InputType>
30 std::string _name, std::string _description,
34 m_make_evaluator_f(_make_evaluator_f) {}
40 std::unique_ptr<BaseDatumFormatter<ObjectType>>
make(
41 InputType
const &input)
const {
42 return m_make_evaluator_f(input);
52 std::string _name, std::string _description,
55 template <
typename ObjectType>
58 typedef std::map<std::string, DatumEvaluatorEntry<ObjectType>>
map_type;
63 template <
typename... Args>
65 insert(std::forward<Args>(args)...);
70 void insert(std::unique_ptr<DatumEvaluatorDictEntry<ObjectType>> entry_ptr) {
71 std::string
name = entry_ptr->name();
77 template <
typename... Args>
78 void insert(std::unique_ptr<DatumEvaluatorDictEntry<ObjectType>> entry_ptr,
80 insert(std::move(entry_ptr));
81 insert(std::forward<Args>(args)...);
101 std::map<std::string, DatumEvaluatorDictEntry<ObjectType>>
m_evaluators;
105 template <
typename ObjectType>
106 DatumEvaluatorDictEntry<ObjectType>::DatumEvaluatorDictEntry(
107 std::string _name, std::string _description,
110 m_description(_description),
111 m_make_evaluator_f(_make_evaluator_f) {}
113 template <
typename ObjectType>
118 template <
typename ObjectType>
120 return m_description;
123 template <
typename ObjectType>
124 std::unique_ptr<BaseDatumFormatter<ObjectType>>
125 DatumEvaluatorDictEntry<ObjectType>::make(
126 std::vector<std::string>
const &args)
const {
127 return m_make_evaluator_f(args);
std::string m_description
std::string description() const
std::unique_ptr< BaseDatumFormatter< ObjectType > > make(InputType const &input) const
MakeEvaluatorPtrFunction< ObjectType, InputType > make_evaluator_f
DatumEvaluatorEntry(std::string _name, std::string _description, MakeEvaluatorPtrFunction< ObjectType, InputType > _make_evaluator_ptr_f)
GenericDatumFormatter< std::string, ConfigEnumDataType > name()
std::string description(const SymOp &op, const xtal::Lattice &lat, SymInfoOptions opt=SymInfoOptions())
Print SymInfo to string.
GenericDatumFormatter< std::string, DataObject > name()