Develop Biology
The language of life
ExcitationMacros.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
24#define BIO_EXCITATION_CLASS_0(wave, ret, ...) \
25 ::bio::chemical::ExcitationWithoutArgument< wave, ret >
26
27#define BIO_EXCITATION_CLASS_1(wave, ret, ...) \
28 ::bio::chemical::ExcitationWithArgument< wave, ret, __VA_ARGS__ >
29
30#define BIO_EXCITATION_CLASS_2(wave, ret, ...) \
31 ::bio::chemical::ExcitationWithTwoArguments< wave, ret, __VA_ARGS__ >
32
33#define BIO_CREATE_EXCITATION_CLASS(wave, ret, num, ...) \
34 BIO_EXCITATION_CLASS_##num(wave, ret, __VA_ARGS__)
35
36#define BIO_CREATE_EXCITATION_CLASS_WITH_NUM(wave, ret, num, ...) \
37 BIO_CREATE_EXCITATION_CLASS(wave, ret, num, __VA_ARGS__)
38
47#define BIO_EXCITATION_CLASS(wave, ret, ...) \
48 BIO_CREATE_EXCITATION_CLASS_WITH_NUM( \
49 wave, \
50 ret, \
51 BIO_GET_NUM_ARGS(__VA_ARGS__), \
52 __VA_ARGS__ \
53 )
54
55//@formatter:off
56#if BIO_CPP_VERSION >= 17
57 #undef BIO_EXCITATION_CLASS
58 #define BIO_EXCITATION_CLASS(wave, ret ...) \
59 ::bio::chemical::Excitation< wave, ret, ... >
60#endif
61//@formatter:on
62
63//This only works for Excitations of 0 arguments. We cannot pass both the arg type and value at this time.
64//#define BIO_EXCITATION(wave, ret, func, ...) \
65// new BIO_EXCITATION_CLASS(wave, ret, __VA_ARGS__)(&wave::func)