Develop Biology
The language of life
Vesicle.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
24
25namespace bio {
26namespace molecular {
27
28Vesicle::Vesicle(const Vesicle& toCopy) :
29 molecular::Class<Vesicle>(this, toCopy.GetId(), toCopy.GetPerspective(), toCopy.GetFilter()),
30 LinearMotif< Molecule* >(toCopy)
31{
33}
34
35Vesicle::~Vesicle()
36{
37}
38
39Molecule* Vesicle::operator[](StandardDimension moleculeId)
40{
41 return GetById< Molecule* >(moleculeId);
42}
43
44const Molecule* Vesicle::operator[](StandardDimension moleculeId) const
45{
46 return GetById< Molecule* >(moleculeId);
47}
48
49Molecule* Vesicle::operator[](Name moleculeName)
50{
51 return GetByName< Molecule* >(moleculeName);
52}
53
54const Molecule* Vesicle::operator[](Name moleculeName) const
55{
56 return GetByName< Molecule* >(moleculeName);
57}
58
59Vesicle* Vesicle::operator<<=(Vesicle* source)
60{
61 BIO_SANITIZE(source,,return NULL)
62 Import< Molecule* >(source);
63 return this;
64}
65
66Vesicle* Vesicle::operator>>=(Vesicle* target)
67{
68 BIO_SANITIZE(target,,return NULL)
69 target->Import< Molecule* >(this);
70 this->Clear< Molecule* >();
71 return target;
72}
73
74
75} //molecular namespace
76} //bio namespace
#define BIO_SANITIZE(test, success, failure)
physical::Perspective< StandardDimension > * m_perspective
Definition: LinearMotif.h:147
void Import(const UnorderedMotif< T > *other)
Definition: Cell.h:31
const char * Name
Definition: Types.h:46