PRISM
 v0.0.0
Loading...
Searching...
No Matches
SubSpecies.h
1#pragma once
2
3#include <string>
4
5#include "SpeciesBase.h"
6
7class SpeciesFactory;
8
9namespace prism
10{
15class SubSpecies : public SpeciesBase
16{
17public:
22 SubSpecies(const std::string & name);
23
25 bool operator==(const SubSpecies & other) const;
27 bool operator!=(const SubSpecies & other) const;
28
30 const std::string & base() const { return _base; }
32 const std::string & modifier() const { return _modifier; }
34 unsigned int subscript() const { return _subscript; }
39 const std::string & neutralGroundState() const { return _neutral_ground_state; }
40
41private:
43 const std::string _base;
45 std::string _modifier;
47 const unsigned int _subscript;
48 const std::string _neutral_ground_state;
50 std::string setBase();
55 std::string setModifier();
59 unsigned int setSubscript();
64 void setMass() override;
68 void setCharge() override;
70 void setLatexName() override;
71
72 std::string setNeutralGroundState() const;
73};
74} // namespace RXN
75
76template <>
77struct std::hash<prism::SubSpecies>
78{
83 size_t operator()(const prism::SubSpecies & obj) const;
84};
Base class for species and subspecies.
Definition SpeciesBase.h:11
const std::string & name() const
Getter method for the name of species.
Definition SpeciesBase.h:23
The parts with a Species can be brokenup into Eg Speices: NH3, SubSpecies: [N, H3].
Definition SubSpecies.h:16
bool operator==(const SubSpecies &other) const
Comparison operator checks if the sub species have the same member variables.
Definition SubSpecies.C:301
const std::string & neutralGroundState() const
Gets the ground neutral state of the subspecies Ex: H3* -> H3.
Definition SubSpecies.h:39
SubSpecies(const std::string &name)
Creates a simple SubSpecies object.
Definition SubSpecies.C:14
unsigned int subscript() const
getter method for the subscript on the subspecies
Definition SubSpecies.h:34
bool operator!=(const SubSpecies &other) const
Comparison for checking whether or not the two are not equal
Definition SubSpecies.C:329
const std::string & modifier() const
getter method for the modifier std::string
Definition SubSpecies.h:32
const std::string & base() const
getter method for the elemental base of the species
Definition SubSpecies.h:30
size_t operator()(const prism::SubSpecies &obj) const
Custom override for the hash method Hash is only based on the name std::string.