Develop Biology
The language of life
PeriodicTable.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
24#include "bio/common/TypeName.h"
27
28
29namespace bio {
30namespace chemical {
31
41 public physical::Perspective< AtomicNumber >
42{
43public:
48
53
58 template < typename T >
60 {
61 return TypeName< T >().c_str();
62 }
63
70 template < typename T >
71 Name GetNameFromType(const T t) const
72 {
73 return GetNameFromType< T >();
74 }
75
80 template < typename T >
82 {
83 return GetIdFromName(GetNameFromType< T >());
84 }
85
92 template < typename T >
94 {
95 return GetIdFromType< T >();
96 }
97
103
108 const Properties GetPropertiesOf(Name name) const;
109
114 template < typename T >
116 {
117 return GetPropertiesOf(TypeName< T >().c_str());
118 }
119
127 AtomicNumber id,
128 Property property
129 );
130
138 Name name,
139 Property property
140 );
141
148 template < typename T >
150 {
151 return RecordPropertyOf(
152 TypeName< T >().c_str(),
153 property
154 );
155 }
156
164 AtomicNumber id,
165 Properties properties
166 );
167
175 Name name,
176 Properties properties
177 );
178
185 template < typename T >
187 {
188 return RecordPropertiesOf(
189 TypeName< T >().c_str(),
190 properties
191 );
192 }
193
199 virtual const physical::Wave* GetTypeFromId(AtomicNumber id) const;
200
209 virtual bool AssociateType(
210 AtomicNumber id,
211 physical::Wave* type
212 );
213
220 virtual bool DisassociateType(AtomicNumber id);
221};
222
223BIO_SINGLETON(PeriodicTable,
224 PeriodicTableImplementation)
225
226} //chemical namespace
227} //bio namespace
AtomicNumber RecordPropertiesOf(Properties properties)
const Properties GetPropertiesOf() const
virtual const physical::Wave * GetTypeFromId(AtomicNumber id) const
AtomicNumber RecordPropertiesOf(AtomicNumber id, Properties properties)
AtomicNumber RecordPropertyOf(AtomicNumber id, Property property)
virtual bool DisassociateType(AtomicNumber id)
virtual bool AssociateType(AtomicNumber id, physical::Wave *type)
AtomicNumber RecordPropertyOf(Property property)
#define BIO_SINGLETON(className, baseClass)
Definition: Macros.h:94
uint16_t AtomicNumber
Definition: Types.h:72
Definition: Cell.h:31
const char * Name
Definition: Types.h:46
uint8_t Properties
Definition: Types.h:58