Merge pull request #3131 from akohlmey/lammps-cxx-style

More general LAMMPS code design info for the Programmer guide section of the manual
This commit is contained in:
Axel Kohlmeyer
2022-02-14 18:13:32 -05:00
committed by GitHub
6 changed files with 605 additions and 143 deletions

View File

@ -52,10 +52,15 @@ class Tokenizer {
std::vector<std::string> as_vector();
};
/** General Tokenizer exception class */
class TokenizerException : public std::exception {
std::string message;
public:
// remove unused default constructor
TokenizerException() = delete;
/** Thrown during retrieving or skipping tokens
*
* \param msg String with error message
@ -67,7 +72,10 @@ class TokenizerException : public std::exception {
const char *what() const noexcept override { return message.c_str(); }
};
/** Exception thrown by ValueTokenizer when trying to convert an invalid integer string */
class InvalidIntegerException : public TokenizerException {
public:
/** Thrown during converting string to integer number
*
@ -78,6 +86,8 @@ class InvalidIntegerException : public TokenizerException {
}
};
/** Exception thrown by ValueTokenizer when trying to convert an floating point string */
class InvalidFloatException : public TokenizerException {
public:
/** Thrown during converting string to floating point number