Develop Biology
The language of life
Pathway.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) 2021 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
22//
23// Created by eons on 12/17/21.
24//
25
27
28namespace bio {
29namespace molecular {
30
31Pathway::~Pathway()
32{
33
34}
35
37{
39
41 Reaction* reactionBuffer;
42 for (
43 SmartIterator rct = GetAll< Reaction* >()->Begin();
44 !rct.IsAtEnd();
45 ++rct
46 )
47 {
48 if (products == code::Success() && products != code::NoErrorNoSuccess())
49 {
50 chemical::Reactants nextReactants(products);
51 reactionBuffer = rct;
52 products = (*reactionBuffer)(&nextReactants);
53 }
54 else
55 {
56 break;
57 }
58 }
59 return products;
60}
61
63{
64 BIO_SANITIZE(GetCount< chemical::Reaction* >(),,return false)
65 return GetAll< chemical::Reaction* >()->Begin().As< chemical::Reaction* >()->ReactantsMeetRequirements(toCheck);
66}
67
68} //molecular namespace
69} //bio namespace
#define BIO_SANITIZE(test, success, failure)
bool IsAtEnd() const
const Reactants * reactants
Definition: Reaction.h:101
virtual chemical::Products Process(chemical::Reactants *reactants)
Definition: Pathway.cpp:36
virtual bool ReactantsMeetRequirements(const chemical::Reactants *toCheck) const
Definition: Pathway.cpp:62
Code NoErrorNoSuccess()
Code BadArgument1()
Code Success()
Definition: Cell.h:31