n2p2 - A neural network potential package
nnp::settings::Key Class Reference

Keyword properties. More...

#include <Key.h>

Collaboration diagram for nnp::settings::Key:

Public Member Functions

std::string getMainKeyword () const
 
bool hasUniqueKeyword () const
 Whether this keyword has no alternative definitions or spellings. More...
 
void addAlternative (std::string word)
 
void setDescription (std::string text)
 
std::vector< std::string >::const_iterator begin () const
 
std::vector< std::string >::const_iterator end () const
 

Private Attributes

std::string description
 A short description of the keyword. More...
 
std::vector< std::string > keywords
 Alternative keywords (first entry is main name). More...
 

Detailed Description

Keyword properties.

Definition at line 17 of file Key.h.

Member Function Documentation

◆ getMainKeyword()

std::string nnp::settings::Key::getMainKeyword ( ) const
inline

Definition at line 20 of file Key.h.

21 {
22 return keywords.at(0);
23 }
std::vector< std::string > keywords
Alternative keywords (first entry is main name).
Definition: Key.h:42

References keywords.

Referenced by nnp::settings::Settings::getValue(), and nnp::settings::Settings::keywordExists().

Here is the caller graph for this function:

◆ hasUniqueKeyword()

bool nnp::settings::Key::hasUniqueKeyword ( ) const
inline

Whether this keyword has no alternative definitions or spellings.

Definition at line 25 of file Key.h.

25{return (keywords.size() == 1);}

References keywords.

◆ addAlternative()

void nnp::settings::Key::addAlternative ( std::string  word)
inline

Definition at line 26 of file Key.h.

26{keywords.push_back(word);};

References keywords.

◆ setDescription()

void nnp::settings::Key::setDescription ( std::string  text)
inline

Definition at line 27 of file Key.h.

27{description = text;};
std::string description
A short description of the keyword.
Definition: Key.h:40

References description.

◆ begin()

std::vector< std::string >::const_iterator nnp::settings::Key::begin ( ) const
inline

Definition at line 29 of file Key.h.

30 {
31 return keywords.begin();
32 }

References keywords.

◆ end()

std::vector< std::string >::const_iterator nnp::settings::Key::end ( ) const
inline

Definition at line 33 of file Key.h.

34 {
35 return keywords.end();
36 }

References keywords.

Member Data Documentation

◆ description

std::string nnp::settings::Key::description
private

A short description of the keyword.

Definition at line 40 of file Key.h.

Referenced by setDescription().

◆ keywords

std::vector<std::string> nnp::settings::Key::keywords
private

Alternative keywords (first entry is main name).

Definition at line 42 of file Key.h.

Referenced by addAlternative(), begin(), end(), getMainKeyword(), and hasUniqueKeyword().


The documentation for this class was generated from the following file: