Plot Script
|
A variant type that may be a Number or Symbol or the default type None. More...
#include <atom.hpp>
Public Member Functions | |
Atom () | |
Construct a default Atom of type None. More... | |
Atom (double value) | |
Construct an Atom of type Number with value. More... | |
Atom (const std::string &value) | |
Construct an Atom of type Symbol named value. More... | |
Atom (const Token &token) | |
Construct an Atom directly from a Token. More... | |
Atom (const Atom &x) | |
Copy-construct an Atom. More... | |
Atom & | operator= (const Atom &x) |
Assign an Atom. More... | |
~Atom () | |
Atom destructor. More... | |
bool | isNone () const noexcept |
predicate to determine if an Atom is of type None More... | |
bool | isNumber () const noexcept |
predicate to determine if an Atom is of type Number More... | |
bool | isSymbol () const noexcept |
predicate to determine if an Atom is of type Symbol More... | |
double | asNumber () const noexcept |
value of Atom as a number, return 0 if not a Number More... | |
std::string | asSymbol () const noexcept |
value of Atom as a number, returns empty-string if not a Symbol More... | |
bool | operator== (const Atom &right) const noexcept |
equality comparison based on type and value More... | |
A variant type that may be a Number or Symbol or the default type None.
This class provides value semantics.
Atom::Atom | ( | ) |
Construct a default Atom of type None.
Atom::Atom | ( | double | value | ) |
Construct an Atom of type Number with value.
Atom::Atom | ( | const std::string & | value | ) |
Construct an Atom of type Symbol named value.
Atom::~Atom | ( | ) |
Atom destructor.
|
noexcept |
value of Atom as a number, return 0 if not a Number
|
noexcept |
value of Atom as a number, returns empty-string if not a Symbol
|
noexcept |
predicate to determine if an Atom is of type None
|
noexcept |
predicate to determine if an Atom is of type Number
|
noexcept |
predicate to determine if an Atom is of type Symbol
|
noexcept |
equality comparison based on type and value
double Atom::numberValue |
std::string Atom::stringValue |