Develop Biology
The language of life
Wave.h
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#pragma once
23
25
26//@formatter:off
27#if BIO_CPP_VERSION < 11
28 #include <stdint.h>
29#else
30 #include <cstdint>
31#endif
32//@formatter:on
33
34namespace bio {
35
36//the easy way out...
37//see AsAtom()
38namespace chemical {
39class Atom;
40}
41
42namespace physical {
43
44class Symmetry;
45
46typedef std::vector< Symmetry* > Symmetries;
47
48class Wave;
49
50typedef std::vector< Wave* > Waves;
51typedef std::vector< const Wave* > ConstWaves;
52
64class Wave
65{
66public:
67
71 Wave(Symmetry* symmetry = NULL);
72
76 virtual ~Wave();
77
81 virtual Wave* Clone() const;
82
92 virtual Properties GetProperties() const;
93
101
109 const Wave* wave1,
110 const Wave* wave2
111 );
112
120 const Wave* wave,
121 const Properties& properties
122 );
123
134 virtual Symmetry* Spin() const;
135
143 virtual Code Reify(Symmetry* symmetry);
144
149 virtual Wave* Modulate(Wave* signal);
150
155 virtual Wave* Demodulate();
156
161 virtual const Wave* Demodulate() const;
162
169 virtual Code Attenuate(const Wave* other);
170
178 virtual Code Disattenuate(const Wave* other);
179
186 virtual Wave* AsWave()
187 {
188 return this;
189 }
190
197 virtual const Wave* AsWave() const
198 {
199 return this;
200 }
201
210 {
211 return NULL;
212 }
213
221 virtual const chemical::Atom* AsAtom() const
222 {
223 return NULL;
224 }
225
226 //HERE THERE BE OPERATORS
227
233 virtual void operator|(Symmetry* symmetry);
234
240 virtual Wave* operator*(Wave* signal);
241
246 virtual Wave* operator*();
247
252 virtual const Wave* operator*() const;
253
259 virtual void operator+(const Wave* other);
260
266 virtual void operator-(const Wave* other);
267
268protected:
273
278};
279
280} //physical namespace
281} //bio namespace
virtual void operator+(const Wave *other)
Definition: Wave.cpp:128
virtual Code Attenuate(const Wave *other)
Definition: Wave.cpp:81
virtual Wave * AsWave()
Definition: Wave.h:186
virtual Code Disattenuate(const Wave *other)
Definition: Wave.cpp:86
virtual Properties GetProperties() const
Definition: Wave.cpp:142
virtual Wave * Modulate(Wave *signal)
Definition: Wave.cpp:91
Wave * m_signal
Definition: Wave.h:277
virtual Wave * Clone() const
Definition: Wave.cpp:52
virtual ~Wave()
Definition: Wave.cpp:45
virtual const chemical::Atom * AsAtom() const
Definition: Wave.h:221
virtual Wave * Demodulate()
Definition: Wave.cpp:99
virtual Symmetry * Spin() const
Definition: Wave.cpp:59
virtual Code Reify(Symmetry *symmetry)
Definition: Wave.cpp:64
virtual Wave * operator*()
Definition: Wave.cpp:118
virtual const Wave * AsWave() const
Definition: Wave.h:197
virtual void operator-(const Wave *other)
Definition: Wave.cpp:135
virtual chemical::Atom * AsAtom()
Definition: Wave.h:209
virtual void operator|(Symmetry *symmetry)
Definition: Wave.cpp:72
Wave(Symmetry *symmetry=NULL)
Definition: Wave.cpp:32
static Properties GetResonanceBetween(ConstWaves waves)
Definition: Wave.cpp:209
Symmetry * m_symmetry
Definition: Wave.h:272
std::vector< Wave * > Waves
Definition: Wave.h:48
std::vector< const Wave * > ConstWaves
Definition: Wave.h:51
std::vector< Symmetry * > Symmetries
Definition: Wave.h:44
Definition: Cell.h:31
uint8_t Properties
Definition: Types.h:58