Develop Biology
The language of life
Products.cpp
Go to the documentation of this file.
1/*
2 * This file is a part of the Biology project by eons LLC.
3 * Biology (aka Develop Biology) is a framework for approaching software
4 * development from a natural sciences perspective.
5 *
6 * Copyright (C) 2022 Séon O'Shannon & eons LLC
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
24
25namespace bio {
26namespace chemical {
27
29 :
30 m_result(CodePerspective::InvalidId())
31{
32
33}
34
36 :
37 m_result(result)
38{
39
40}
41
43 :
44 m_result(code::Success()),
45 m_substances(*substances)
46{
47
48}
49
51 :
52 m_result(code::Success()),
53 m_substances(reactants->GetAllAsVector< Substance* >())
54{
55
56}
57
59 Code result,
60 const Substances* substances
61)
62 :
63 m_result(result),
64 m_substances(*substances)
65{
66
67}
68
70{
71
72}
73
74Products::operator Code()
75{
76 return m_result;
77}
78
79Products::operator Substances()
80{
81 return m_substances;
82}
83
84Products::operator Reactants()
85{
86 return Reactants(m_substances);
87}
88
89bool Products::operator!=(const Code code) const
90{
91 return m_result != code;
92}
93
94bool Products::operator==(const Code code) const
95{
96 return m_result == code;
97}
98
99} //chemical namespace
100} //bio namespace
virtual bool operator!=(const Code code) const
Definition: Products.cpp:89
virtual bool operator==(const Code code) const
Definition: Products.cpp:94
std::vector< Substance * > Substances
Definition: Types.h:79
Code Success()
Definition: Cell.h:31