libbio
Loading...
Searching...
No Matches
CallerDependentProtein.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) 2022 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 neural {
30
31template < class CALLER >
33 public molecular::Class< CallerDependentProtein< CALLER > >,
35{
36public:
37
42
62
67 virtual Code Fold()
68 {
70 }
71
72protected:
73
86 {
87 if (context)
88 {
90 if (perCall)
91 {
93 }
94 }
95 return mCaller;
96 }
97
111 {
112 if (context)
113 {
115 if (perCall)
116 {
117 return perCall;
118 }
119 }
120 return mCaller;
121 }
122
123 // Pointer< CALLER > rather than a raw CALLER*: BIO_DEFAULT_IDENTIFIABLE_-
124 // CONSTRUCTORS does NOT zero this member, so a raw pointer was left
125 // UNINITIALIZED on construction. Pointer< T >'s default ctor NULL-inits
126 // (cpp98 AND cpp20, no NSDMI needed) and is a same-size, behavior-identical
127 // raw-pointer stand-in, so the LEVEL_1 guard above reliably catches an
128 // unresolved caller instead of dereferencing garbage in Activate(NULL).
130};
131
132} // namespace neural
133} // namespace bio
#define BIO_DISAMBIGUATE_ALL_CLASS_METHODS(ns, caller)
Definition ClassMethodMacros.h:112
#define BIO_SANITIZE_AT_SAFETY_LEVEL_1(test, success, failure)
Definition SanitizeMacros.h:55
#define BIO_SANITIZE(test, success, failure)
Definition SanitizeMacros.h:94
#define BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS(ns, class,...)
Definition chemical/macro/ConstructorMacros.h:38
Definition Pointer.h:115
Definition molecular/common/Class.h:42
Definition Protein.h:55
virtual Code RecruitChaperones(Pointer< Vesicle > environment)
Definition Protein.cpp:49
virtual Code Fold()
Definition Protein.cpp:40
Definition CallerDependentProtein.h:35
Pointer< CALLER > mCaller
Definition CallerDependentProtein.h:129
virtual Code Fold()
Definition CallerDependentProtein.h:67
Pointer< CALLER > ResolveCallerLocal(Pointer< molecular::Vesicle > context) const
Definition CallerDependentProtein.h:110
virtual Pointer< CALLER > ResolveCaller(Pointer< molecular::Vesicle > context)
Definition CallerDependentProtein.h:85
Code GeneralFailure()
Definition FinalCell.h:29