libbio
Loading...
Searching...
No Matches
SymmetryHelpers.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) 2025 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
26#include "bio/common/Cast.h"
30
31namespace bio {
32namespace molecular {
33namespace symmetry_helper {
34
36{
37 BIO_SANITIZE(symmetry, , return NULL)
38
40 symmetry->GetName(),
41 symmetry->GetType().GetId()
42 );
43 clone->SetValue(symmetry->GetValue());
44
45 // Recurse into nested children only for chemical Symmetries. The proven
46 // PeriodicTable-id resonance check (chemical::atom_detail) is used instead
47 // of an inline GetPropertiesOf< chemical::Symmetry >() resonance, which
48 // returns a non-resonating Property set under the fleet -fno-rtti build and
49 // silently dropped all nested children (and, via IsChemicalSymmetry below,
50 // the entire Solutes round-trip).
52 {
55 if (children)
56 {
57 for (
58 SmartIterator child = children->Begin();
59 !child.IsAfterEnd();
60 ++child
61 )
62 {
65 if (childClone)
66 {
68 }
69 }
70 }
71 }
72
73 return clone;
74}
75
77{
78 // Delegate to the proven PeriodicTable-id-keyed resonance check. The prior
79 // inline GetPropertiesOf< chemical::Symmetry >() variant returned a
80 // non-resonating Property set under the fleet -fno-rtti build, so this
81 // guard wrongly reported every freshly-Spun chemical::Symmetry as
82 // not-chemical — silently disabling Vesicle's entire Solutes Spin/Reify
83 // round-trip (and any StemCell/derived Spin built on this guard).
85}
86
87} //symmetry_helper namespace
88} //molecular namespace
89} //bio namespace
#define BIO_SANITIZE(test, success, failure)
Definition SanitizeMacros.h:94
Definition Pointer.h:115
Definition SmartIterator.h:40
Definition chemical/symmetry/Symmetry.h:55
Definition physical/symmetry/Symmetry.h:41
bool IsChemicalSymmetry(Pointer< const physical::Symmetry > symmetry)
Definition Helpers.cpp:133
Pointer< chemical::Symmetry > CloneSymmetry(Pointer< const physical::Symmetry > symmetry)
Definition SymmetryHelpers.h:35
bool IsChemicalSymmetry(Pointer< const physical::Symmetry > symmetry)
Definition SymmetryHelpers.h:76
Definition FinalCell.h:29