n2p2 - A neural network potential package
Key.h
Go to the documentation of this file.
1//
2// Created by philipp on 2/21/23.
3//
4
5#ifndef N2P2_KEY_H
6#define N2P2_KEY_H
7
8#include <string>
9#include <vector>
10#include <iterator>
11
12namespace nnp
13{
14 namespace settings
15 {
17 class Key
18 {
19 public:
20 std::string getMainKeyword() const
21 {
22 return keywords.at(0);
23 }
25 bool hasUniqueKeyword() const {return (keywords.size() == 1);}
26 void addAlternative(std::string word) {keywords.push_back(word);};
27 void setDescription(std::string text) {description = text;};
28
29 std::vector<std::string>::const_iterator begin() const
30 {
31 return keywords.begin();
32 }
33 std::vector<std::string>::const_iterator end() const
34 {
35 return keywords.end();
36 }
37
38 private:
40 std::string description;
42 std::vector<std::string> keywords;
43 };
44 }
45}
46#endif //N2P2_KEY_H
Keyword properties.
Definition: Key.h:18
std::string getMainKeyword() const
Definition: Key.h:20
std::vector< std::string >::const_iterator begin() const
Definition: Key.h:29
std::vector< std::string > keywords
Alternative keywords (first entry is main name).
Definition: Key.h:42
std::string description
A short description of the keyword.
Definition: Key.h:40
void setDescription(std::string text)
Definition: Key.h:27
std::vector< std::string >::const_iterator end() const
Definition: Key.h:33
bool hasUniqueKeyword() const
Whether this keyword has no alternative definitions or spellings.
Definition: Key.h:25
void addAlternative(std::string word)
Definition: Key.h:26
Definition: Atom.h:29