Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfSpecies.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of Tissue Forge.
3 * Copyright (c) 2022-2024 T.J. Sego
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 ******************************************************************************/
19
25#ifndef _SOURCE_STATE_TFSPECIES_H_
26#define _SOURCE_STATE_TFSPECIES_H_
27
28#include <tf_port.h>
29#include <io/tf_io.h>
30#include <string>
31
32
33namespace libsbml {
34 class Species;
35 class SBMLNamespaces;
36};
37
38
39namespace TissueForge {
40
41
42 namespace state {
43
44
45 enum SpeciesFlags {
46
47 SPECIES_BOUNDARY = 1 << 0,
48 SPECIES_SUBSTANCE = 1 << 2,
49 SPECIES_CONSTANT = 1 << 3,
50 SPECIES_KONSTANT = SPECIES_BOUNDARY | SPECIES_CONSTANT
51 };
52
58 struct CAPI_EXPORT Species {
59 libsbml::Species *species;
60 int32_t flags() const;
61 std::string str() const;
62 void initDefaults();
63
64 const std::string getId() const;
65 int setId(const char *sid);
66 const std::string getName() const;
67 int setName(const char *name);
68 const std::string getSpeciesType() const;
69 int setSpeciesType(const char *sid);
70 const std::string getCompartment() const;
71 int setCompartment(const char *sid);
72 FloatP_t getInitialAmount() const;
73 int setInitialAmount(FloatP_t value);
74 FloatP_t getInitialConcentration() const;
75 int setInitialConcentration(FloatP_t value);
76 const std::string getSubstanceUnits() const;
77 int setSubstanceUnits(const char *sid);
78 const std::string getSpatialSizeUnits() const;
79 int setSpatialSizeUnits(const char *sid);
80 const std::string getUnits() const;
81 int setUnits(const char *sname);
82 bool getHasOnlySubstanceUnits() const;
83 int setHasOnlySubstanceUnits(int value);
84 bool getBoundaryCondition() const;
85 int setBoundaryCondition(int value);
86 int getCharge() const;
87 int setCharge(int value);
88 bool getConstant() const;
89 int setConstant(int value);
90 const std::string getConversionFactor() const;
91 int setConversionFactor(const char *sid);
92 bool isSetId() const;
93 bool isSetName() const;
94 bool isSetSpeciesType() const;
95 bool isSetCompartment() const;
96 bool isSetInitialAmount() const;
97 bool isSetInitialConcentration() const;
98 bool isSetSubstanceUnits() const;
99 bool isSetSpatialSizeUnits() const;
100 bool isSetUnits() const;
101 bool isSetCharge() const;
102 bool isSetConversionFactor() const;
103 bool isSetConstant() const;
104 bool isSetBoundaryCondition() const;
105 bool isSetHasOnlySubstanceUnits() const;
106 int unsetId();
107 int unsetName();
108 int unsetConstant();
109 int unsetSpeciesType();
110 int unsetInitialAmount();
111 int unsetInitialConcentration();
112 int unsetSubstanceUnits();
113 int unsetSpatialSizeUnits();
114 int unsetUnits();
115 int unsetCharge();
116 int unsetConversionFactor();
117 int unsetCompartment();
118 int unsetBoundaryCondition();
119 int unsetHasOnlySubstanceUnits();
120 int hasRequiredAttributes();
121
122 Species();
123 Species(const std::string &s);
124 Species(const Species &other);
125 ~Species();
126
132 std::string toString();
133
140 static Species *fromString(const std::string &str);
141 };
142
143
144 CAPI_FUNC(libsbml::SBMLNamespaces*) getSBMLNamespaces();
145
146 }
147
148 namespace io {
149
150 template <>
151 HRESULT toFile(const TissueForge::state::Species &dataElement, const MetaData &metaData, IOElement &fileElement);
152
153 template <>
154 HRESULT fromFile(const IOElement &fileElement, const MetaData &metaData, TissueForge::state::Species *dataElement);
155
156 };
157
158}
159
160#endif // _SOURCE_STATE_TFSPECIES_H_
HRESULT toFile(const T &dataElement, const MetaData &metaData, IOElement &fileElement)
Convert an object to an intermediate I/O object.
HRESULT fromFile(const IOElement &fileElement, const MetaData &metaData, T *dataElement)
Instantiate an object from an intermediate I/O object.
Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.
Definition tfAngleConfig.h:26
The Tissue Forge species object.
Definition tfSpecies.h:58
static Species * fromString(const std::string &str)
Create from a JSON string representation.
std::string toString()
Get a JSON string representation.
int32_t HRESULT
Definition tf_port.h:255