forked from cellml/libcellml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.i
71 lines (53 loc) · 2.04 KB
/
model.i
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
%module(package="libcellml") model
#define LIBCELLML_EXPORT
%import "types.i"
%import "componententity.i"
#if defined(SWIGPYTHON)
// Treat negative size_t as invalid index (instead of unknown method)
%extend libcellml::Model {
bool removeUnits(long index) {
if(index < 0) return false;
return $self->removeUnits(size_t(index));
}
UnitsPtr getUnits(long index) const {
if(index < 0) return nullptr;
return $self->getUnits(size_t(index));
}
UnitsPtr takeUnits(long index) {
if(index < 0) return nullptr;
return $self->takeUnits(size_t(index));
}
bool replaceUnits(long index, UnitsPtr &units) {
if(index < 0) return false;
return $self->replaceUnits(size_t(index), units);
}
}
#endif
%feature("docstring") libcellml::Model
"Represents a CellML model.";
%feature("docstring") libcellml::Model::addUnits
"Add a copy of the given Units to this model.";
%feature("docstring") libcellml::Model::getUnits
"Returns a Units object from this Model, specified by index or name.";
%feature("docstring") libcellml::Model::hasUnits
"Tests to see if this model has the given units, specified by name.";
%feature("docstring") libcellml::Model::removeUnits
"Removes the Units specified by index, name or Units object.
Returns `True` on success.";
%feature("docstring") libcellml::Model::removeAllUnits
"Removes all units stored in this model.";
%feature("docstring") libcellml::Model::replaceUnits
"Replaces a Units object, specified by index, name or Units object, by another
Units (second argument).
Returns `True` on success.";
%feature("docstring") libcellml::Model::takeUnits
"Removes and returns the Units specified by index or name.";
%feature("docstring") libcellml::Model::unitsCount
"Returns the number of units this model contains.";
%{
#include "libcellml/model.h"
%}
%ignore libcellml::Model::Model(Model &&);
%ignore libcellml::Model::operator =;
%include "libcellml/types.h"
%include "libcellml/model.h"