feat(assets/static): moved data type logic to dedicated headers
This commit is contained in:
File diff suppressed because it is too large
Load Diff
17801
assets/static/atomic/include/species.h
Normal file
17801
assets/static/atomic/include/species.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
|||||||
required_headers = [
|
required_headers = [
|
||||||
'atomicSpecies.h',
|
'atomicSpecies.h',
|
||||||
|
'species.h'
|
||||||
]
|
]
|
||||||
|
|
||||||
foreach h : required_headers
|
foreach h : required_headers
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ namespace serif::network::reaclib {
|
|||||||
std::string m_sourceLabel; ///< Source label for the rate data, indicating the origin of the rate coefficients (e.g., "wc12w", "st08").
|
std::string m_sourceLabel; ///< Source label for the rate data, indicating the origin of the rate coefficients (e.g., "wc12w", "st08").
|
||||||
RateFitSet m_rateSets; ///< Fitting coefficients for the reaction rate, containing the seven parameters used in the rate calculation.
|
RateFitSet m_rateSets; ///< Fitting coefficients for the reaction rate, containing the seven parameters used in the rate calculation.
|
||||||
bool m_reverse = false; ///< indicates if the reaction is reversed
|
bool m_reverse = false; ///< indicates if the reaction is reversed
|
||||||
|
|
||||||
|
friend bool operator==(const REACLIBReaction& lhs, const REACLIBReaction& rhs);
|
||||||
|
friend bool operator!=(const REACLIBReaction& lhs, const REACLIBReaction& rhs);
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Constructs a REACLIBReaction object at compile time.
|
* @brief Constructs a REACLIBReaction object at compile time.
|
||||||
@@ -79,7 +82,7 @@ namespace serif::network::reaclib {
|
|||||||
return std::exp(rateExponent);
|
return std::exp(rateExponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] std::string id() const { return m_id; }
|
[[nodiscard]] const std::string& id() const { return m_id; }
|
||||||
|
|
||||||
[[nodiscard]] int chapter() const { return m_chapter; }
|
[[nodiscard]] int chapter() const { return m_chapter; }
|
||||||
|
|
||||||
@@ -92,6 +95,12 @@ namespace serif::network::reaclib {
|
|||||||
[[nodiscard]] std::string sourceLabel() const { return m_sourceLabel; }
|
[[nodiscard]] std::string sourceLabel() const { return m_sourceLabel; }
|
||||||
|
|
||||||
[[nodiscard]] bool is_reverse() const { return m_reverse; }
|
[[nodiscard]] bool is_reverse() const { return m_reverse; }
|
||||||
|
|
||||||
|
friend std::ostream& operator<<(std::ostream& os, const REACLIBReaction& reaction) {
|
||||||
|
os << "REACLIBReaction(" << reaction.m_id << ", "
|
||||||
|
<< "Chapter: " << reaction.m_chapter << ")";
|
||||||
|
return os;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class REACLIBReactionSet {
|
class REACLIBReactionSet {
|
||||||
@@ -179,4 +188,20 @@ namespace serif::network::reaclib {
|
|||||||
};
|
};
|
||||||
static std::unordered_map<std::string, REACLIBReaction> s_all_reaclib_reactions;
|
static std::unordered_map<std::string, REACLIBReaction> s_all_reaclib_reactions;
|
||||||
static bool s_initialized = false;
|
static bool s_initialized = false;
|
||||||
|
|
||||||
|
inline bool operator==(const REACLIBReaction& lhs, const REACLIBReaction& rhs) {
|
||||||
|
return lhs.m_id == rhs.m_id;
|
||||||
|
}
|
||||||
|
inline bool operator!=(const REACLIBReaction& lhs, const REACLIBReaction& rhs) {
|
||||||
|
return !(lhs == rhs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
template<>
|
||||||
|
struct hash<serif::network::reaclib::REACLIBReaction> {
|
||||||
|
size_t operator()(const serif::network::reaclib::REACLIBReaction& r) const noexcept {
|
||||||
|
return std::hash<std::string>()(r.id());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} // namespace std
|
||||||
|
|||||||
Reference in New Issue
Block a user