Develop Biology
The language of life
Periodic.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
27
28namespace bio {
29namespace physical {
30
34class Periodic :
35 public physical::Class< Periodic >,
36 protected VirtualBase
37{
38public:
39
45
46
50 static TimeUS GetDefaultInterval();
51
57
61 Periodic(TimeUS interval = GetDefaultInterval());
62
66 virtual ~Periodic();
67
72 virtual void InitializeImplementation(ByteStreams args);
73
84 virtual Code Peak()
85 {
86
87 // YOU CODE GOES HERE!
88
89 return code::NotImplemented();
90 }
91
96 virtual void CheckIn();
97
102 virtual void SetInterval(TimeUS interval);
103
107 TimeUS GetInterval() const;
108
113
117 float GetIntervalInSeconds() const;
118
124 virtual void SetLastPeakTimestamp(Timestamp lastPeak);
125
130 virtual Symmetry* Spin() const;
131
137 virtual Code Reify(Symmetry* symmetry);
138
143 virtual Properties GetProperties() const;
144
145protected:
148};
149
150} //physical namespace
151} //bio namespace
BIO_DISAMBIGUATE_ALL_CLASS_METHODS(physical, Periodic) static TimeUS GetDefaultInterval()
virtual void InitializeImplementation(ByteStreams args)
Definition: Periodic.cpp:105
virtual void SetInterval(TimeUS interval)
Definition: Periodic.cpp:64
virtual void CheckIn()
Definition: Periodic.cpp:119
virtual Code Reify(Symmetry *symmetry)
Definition: Periodic.cpp:97
virtual Symmetry * Spin() const
Definition: Periodic.cpp:89
virtual Code Peak()
Definition: Periodic.h:84
float GetIntervalInSeconds() const
Definition: Periodic.cpp:79
virtual Properties GetProperties() const
Definition: Periodic.cpp:114
TimeUS GetInterval() const
Definition: Periodic.cpp:69
static Properties GetClassProperties()
Definition: Periodic.cpp:36
Timestamp m_lastPeakTimestamp
Definition: Periodic.h:147
Timestamp GetTimeLastPeaked() const
Definition: Periodic.cpp:74
virtual void SetLastPeakTimestamp(Timestamp lastPeak)
Definition: Periodic.cpp:84
Periodic(TimeUS interval=GetDefaultInterval())
Definition: Periodic.cpp:44
Code NotImplemented()
Definition: Cell.h:31
std::vector< ByteStream > ByteStreams
Definition: Types.h:52
uint8_t Properties
Definition: Types.h:58
uint32_t TimeUS
Definition: Types.h:74
uint32_t Timestamp
Definition: Types.h:68