model_macros.hpp File Reference Helper macros for model definitions. More... #include "gambit/Models/orphan.hpp" #include "gambit/Models/claw_singleton.hpp" #include "gambit/Utils/util_macros.hpp" #include "gambit/Utils/boost_fallbacks.hpp" #include "gambit/Elements/ini_functions.hpp" #include <boost/preprocessor/seq/for_each.hpp> #include "gambit/Elements/module_macros_inmodule_defs.hpp"
Include dependency graph for model_macros.hpp:
![]()
This graph shows which files directly or indirectly include this file:
![]() Go to the source code of this file.
Detailed DescriptionHelper macros for model definitions. Authors (add name and date if you modify):
Definition in file model_macros.hpp. Macro Definition Documentation◆ ACTIVATE_BACKEND_REQ_FOR_MODELS
Definition at line 104 of file model_macros.hpp. ◆ ACTIVATE_DEP_BE
Definition at line 106 of file model_macros.hpp. ◆ ACTIVATE_FOR_MODELS
Definition at line 107 of file model_macros.hpp. ◆ ALLOW_MODEL_COMBINATION
Definition at line 96 of file model_macros.hpp. ◆ ALLOW_MODELS
Definition at line 116 of file model_macros.hpp. ◆ ALLOWED_MODEL
Definition at line 94 of file model_macros.hpp. ◆ ALLOWED_MODEL_DEPENDENCE
Definition at line 95 of file model_macros.hpp. ◆ BACKEND_OPTION
Definition at line 109 of file model_macros.hpp. ◆ BE_GROUP
Definition at line 99 of file model_macros.hpp. ◆ CLASSLOAD_NEEDED
Definition at line 113 of file model_macros.hpp. ◆ CORE_DEFINEPARS
Define multiple model parameters. Definition at line 325 of file model_macros.hpp. ◆ CORE_INTERPRET_AS_PARENT_FUNCTION
Definition at line 425 of file model_macros.hpp. ◆ CORE_INTERPRET_AS_X_DEPENDENCY
Add a dependency to an interpret-as-X function. Definition at line 418 of file model_macros.hpp. ◆ CORE_INTERPRET_AS_X_FUNCTION
Real declaration macro for INTERPRET_AS_X functions. Definition at line 331 of file model_macros.hpp. ◆ CORE_MAP_TO_CAPABILITY
Tells the core that the current parameter corresponds to the specified CAPABILITY, so that module functions can then draw upon them like any other capabilities. Draws from CORE_START_CAPABILITY macro. So far we only allow parameters of type double (currently the parameter object cannot store anything else anyway). If we really want to allow integer or maybe complex parameters later we could extend some things in here. Definition at line 237 of file model_macros.hpp. ◆ CORE_START_MODEL
Piggybacks off the CORE_START_MODULE_COMMON macro, as we need all the same machinery. Definition at line 189 of file model_macros.hpp. ◆ DECLARE_BACKEND_REQ
Definition at line 100 of file model_macros.hpp. ◆ DECLARE_FUNCTION
Definition at line 88 of file model_macros.hpp. ◆ DEFINEPAR
Value:
namespace Gambit \ { \ namespace Models \ { \ namespace MODEL \ { \ /* Tell the functor holding the ModelParameters object to add the new \ parameter to its [parameter name, value] map. */ \ int CAT(added_,PARAMETER) = \ add_parameter(Functown::primary_parameters,STRINGIFY(PARAMETER)); \ } \ } \ } \
Macro to define parameter. Does not create a corresponding CAPABILITY; use MAP_TO_CAPABILITY to do this after calling DEFINEPAR(S). Definition at line 308 of file model_macros.hpp. ◆ DEFINEPARS
Definition at line 80 of file model_macros.hpp. ◆ DEPENDENCY
Definition at line 91 of file model_macros.hpp. ◆ DO_LINKDefinition at line 327 of file model_macros.hpp. ◆ FORCE_SAME_BACKEND
Definition at line 112 of file model_macros.hpp. ◆ INTERPRET_AS_PARENT_DEPENDENCY
Wrappers to convert INTERPRET_AS_X macros to INTERPRET_AS_PARENT macros. Definition at line 423 of file model_macros.hpp. ◆ INTERPRET_AS_PARENT_FUNCTION
Definition at line 83 of file model_macros.hpp. ◆ INTERPRET_AS_X_DEPENDENCY
Definition at line 84 of file model_macros.hpp. ◆ INTERPRET_AS_X_FUNCTION
Definition at line 82 of file model_macros.hpp. ◆ INTERPRET_AS_X_FUNCTION_FULL
Generic declaration macro for INTERPRET_AS_ functions. Definition at line 335 of file model_macros.hpp. ◆ LONG_BACKEND_OPTION
Definition at line 110 of file model_macros.hpp. ◆ LONG_DECLARE_BACKEND_REQ
Definition at line 102 of file model_macros.hpp. ◆ LONG_DECLARE_FUNCTION
Definition at line 89 of file model_macros.hpp. ◆ LONG_DEPENDENCY
Definition at line 92 of file model_macros.hpp. ◆ LONG_START_CAPABILITY
Definition at line 87 of file model_macros.hpp. ◆ MAKE_PRIMARY_MODEL_FUNCTOR
Value:
MAKE_PRIMARY_MODEL_FUNCTOR_SUPP(FUNCTION)
#define MAKE_PRIMARY_MODEL_FUNCTOR_MAIN(FUNCTION, CAPABILITY, ORIGIN) Macros to create and register primary model functors. Definition: model_macros.hpp:445 Definition at line 119 of file model_macros.hpp. ◆ MAKE_PRIMARY_MODEL_FUNCTOR_MAIN
Value:
/* Create the function wrapper object (functor) */ \ namespace Functown \ { \ primary_model_functor FUNCTION \ } \
Macros to create and register primary model functors. We need this extra wrapper in order to define these special functors and add them to the Core's primary model functor list (no other functors allowed here).Main version of MAKE_FUNCTOR modified to build primary_parameters functors. Definition at line 445 of file model_macros.hpp. ◆ MAKE_PRIMARY_MODEL_FUNCTOR_SUPP
Value:
/* Register the functor with the Core. */ \ int register_model_functor_core(primary_model_functor &) Register a model functor with the Core. Definition: ini_functions.cpp:51 Supplementary version of MAKE_FUNCTOR modded for primary_parameters functors. Definition at line 455 of file model_macros.hpp. ◆ MAP_TO_CAPABILITY
Definition at line 81 of file model_macros.hpp. ◆ MODEL_CONDITIONAL_DEPENDENCY
Definition at line 108 of file model_macros.hpp. ◆ MODEL_GROUP
Definition at line 97 of file model_macros.hpp. ◆ MODEL_NAMESPACE
Macro to get to model namespace easily. Interpret-as-friend (mA parameterisations to primary parameterisations) Definition at line 430 of file model_macros.hpp. ◆ MODULE_INTERPRET_AS_X_DEPENDENCY
"In module" version of the INTERPRET_AS_X_DEPENDENCY macro Definition at line 183 of file model_macros.hpp. ◆ MODULE_INTERPRET_AS_X_FUNCTION
Value:
namespace Gambit \ { \ namespace Models \ { \ namespace MODEL \ { \ /* Declare the user-defined function as defined elsewhere */ \ extern void FUNC (const ModelParameters&, ModelParameters&); \ \ /* Let the module source know that this functor is declared*/ \ namespace Functown { extern module_functor<ModelParameters> \ CAT(MODEL_X,_parameters); } \ \ namespace Pipes \ { \ namespace CAT(MODEL_X,_parameters) \ { \ /* Declare the parameters safe-pointer map as external. */ \ extern std::map<str, safe_ptr<double> > Param; \ /* Declare the safe-pointer to the models vector as external. */ \ extern safe_ptr< std::vector<str> > Models; \ /* Declare the safe pointer to the run options as external. */ \ extern safe_ptr<Options> runOptions; \ } \ } \ } \ } \ } \
"In module" version of the INTERPRET_AS_X_FUNCTION macro Definition at line 152 of file model_macros.hpp. ◆ MODULE_START_MODEL
Value:
"START_MODEL.")) \ /*_Pragma("message declaring model...") \ _Pragma( STRINGIFY(CAT("message Forward declaring model: ",MODEL)) ) */ \ namespace Gambit \ { \ namespace Models \ { \ namespace MODEL \ { \ /* Module errors */ \ /* Module warnings */ \ } \ } \ } \
"Rollcall" macros. These are lifted straight from module_macros_incore.hpp but are modified here and there to suit the role of models. "In module" version of the START_MODEL macro Definition at line 132 of file model_macros.hpp. ◆ NEEDS_MANAGER
Definition at line 93 of file model_macros.hpp. ◆ START_CAPABILITY
Definition at line 86 of file model_macros.hpp. ◆ START_CONDITIONAL_DEPENDENCY
Definition at line 105 of file model_macros.hpp. ◆ START_MODEL
Definition at line 79 of file model_macros.hpp. ◆ USE_MODEL_PIPE
Macro to easily get the Pipes for an INTERPRET_AS_X function, for retrieving dependencies. Definition at line 434 of file model_macros.hpp. Referenced by Gambit::MSSM_mA_to_MSSM_mhud(). |