gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
module_macros_inmodule_defs.hpp File Reference

Generic observable and likelihood function macro definitions, for inclusion from macro redirection headers. More...

#include "gambit/Elements/safety_bucket.hpp"
#include "gambit/Elements/module_macros_common.hpp"
#include "gambit/Utils/exceptions.hpp"
#include "gambit/Elements/elements_extras.hpp"
#include "gambit/Utils/util_macros.hpp"
#include "gambit/Models/safe_param_map.hpp"
#include <vector>
Include dependency graph for module_macros_inmodule_defs.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MODULE_NEEDS_MANAGER_2(LOOPMAN, TYPE)
 Redirection of NEEDS_MANAGER(LOOPMAN, TYPE) when invoked from within a module. More...
 
#define MODULE_NEEDS_MANAGER_1(LOOPMAN)
 Redirection of NEEDS_MANAGER(LOOPMAN) when invoked from within a module. More...
 
#define MODULE_DEPENDENCY(DEP, TYPE, MODULE, FUNCTION, IS_MODEL_DEP)
 Redirection of DEPENDENCY(DEP, TYPE) when invoked from within a module. More...
 
#define MODULE_ALLOWED_MODEL(MODULE, FUNCTION, MODEL, IS_MODEL)
 Redirection of ALLOW_MODEL when invoked from within a module. More...
 
#define MODULE_BE_GROUP(GROUP, IS_MODEL)
 Redirection of BACKEND_GROUP(GROUP) when invoked from within a module. More...
 
#define MODULE_BACKEND_REQ(MODULE, FUNCTION, GROUP, REQ, TAGS, TYPE, ARGS, IS_VARIABLE, IS_MODEL)
 Redirection of BACKEND_REQ(GROUP, REQUIREMENT, (TAGS), TYPE, [(ARGS)]) for declaring backend requirements when invoked from within a module. More...
 
In-module rollcall macros
#define MODULE_START_MODULE
 Redirection of START_MODULE when invoked from within a module. More...
 
#define MODULE_START_CAPABILITY(MODULE)
 Redirection of START_CAPABILITY when invoked from within a module. More...
 
#define MODULE_DECLARE_FUNCTION(MODULE, FUNCTION, TYPE, CAN_MANAGE, IS_MODEL)
 Redirection of START_FUNCTION when invoked from within a module (or model-module) More...
 
#define MODULE_NEEDS_MANAGER_REDIRECT_2(_1, _2)   MODULE_NEEDS_MANAGER_2(_1, _2)
 Variadic redirection for NEEDS_MANAGER when invoked from within a module. More...
 
#define MODULE_NEEDS_MANAGER_REDIRECT_1(_1)   MODULE_NEEDS_MANAGER_1(_1)
 
#define MODULE_NEEDS_MANAGER_REDIRECT(...)   VARARG(MODULE_NEEDS_MANAGER_REDIRECT, __VA_ARGS__)
 

Detailed Description

Generic observable and likelihood function macro definitions, for inclusion from macro redirection headers.


Authors (add name and date if you modify):

Author
Pat Scott (patsc.nosp@m.ott@.nosp@m.physi.nosp@m.cs.m.nosp@m.cgill.nosp@m..ca)
Date
2012 Nov
2013 All year
2014 Foreverrrrr
Author
Abram Krislock (abram.nosp@m..kri.nosp@m.slock.nosp@m.@fys.nosp@m.ik.su.nosp@m..se)
Date
2013 Jan, Feb
Author
Christoph Weniger (c.wen.nosp@m.iger.nosp@m.@uva..nosp@m.nl)
Date
2013 Jan, Feb, 2014 Jan
Author
Anders Kvellestad (ander.nosp@m.s.kv.nosp@m.elles.nosp@m.tad@.nosp@m.fys.u.nosp@m.io.n.nosp@m.o)
Date
2013 Nov
Author
Ben Farmer (b.far.nosp@m.mer@.nosp@m.imper.nosp@m.ial..nosp@m.ac.uk)
Date
2015 Apr, 2019 Jul

Definition in file module_macros_inmodule_defs.hpp.

Macro Definition Documentation

◆ MODULE_ALLOWED_MODEL

#define MODULE_ALLOWED_MODEL (   MODULE,
  FUNCTION,
  MODEL,
  IS_MODEL 
)
Value:
\
namespace Gambit \
{ \
/* Put everything inside the Models namespace if this is a model-module */ \
BOOST_PP_IIF(IS_MODEL, namespace Models {, ) \
\
namespace MODULE \
{ \
\
/* Create a safe pointer to the model parameters result. To be filled \
automatically at runtime when the dependency is resolved. */ \
namespace Pipes \
{ \
namespace FUNCTION \
{ \
namespace Dep {extern dep_bucket<ModelParameters> \
CAT(MODEL,_parameters); } \
} \
} \
\
} \
\
/* End Models namespace */ \
BOOST_PP_IIF(IS_MODEL, }, ) \
\
} \
#define MODEL
Definition: Axions.hpp:99
#define IS_MODEL
#define MODULE
#define FUNCTION
TODO: see if we can use this one:
Definition: Analysis.hpp:33
#define CAT(X, Y)
Concatenate macro arguments for 2-7 arguments.
Definition: cats.hpp:22

Redirection of ALLOW_MODEL when invoked from within a module.

Definition at line 226 of file module_macros_inmodule_defs.hpp.

◆ MODULE_BACKEND_REQ

#define MODULE_BACKEND_REQ (   MODULE,
  FUNCTION,
  GROUP,
  REQ,
  TAGS,
  TYPE,
  ARGS,
  IS_VARIABLE,
  IS_MODEL 
)
Value:
\
namespace Gambit \
{ \
/* Put everything inside the Models namespace if this is a model-module */ \
BOOST_PP_IIF(IS_MODEL, namespace Models {, ) \
\
namespace MODULE \
{ \
namespace Pipes \
{ \
namespace FUNCTION \
{ \
namespace BEreq \
{ \
/* Create a safety_bucket for the backend variable/function. \
To be initialized by the dependency resolver at runtime. */ \
typedef BEvariable_bucket<TYPE> CAT(REQ,var); \
typedef BEfunction_bucket<BOOST_PP_IIF(IS_VARIABLE,int,TYPE(*) \
extern CAT(REQ,BOOST_PP_IIF(IS_VARIABLE,var,func)) REQ; \
} \
} \
} \
} \
/* End Models namespace */ \
BOOST_PP_IIF(IS_MODEL, }, ) \
} \
#define IS_MODEL
#define MODULE
#define INSERT_NONEMPTY(ARG)
Funk var(std::string arg)
Definition: daFunk.hpp:921
#define FUNCTION
Funk func(double(*f)(funcargs...), Args... args)
Definition: daFunk.hpp:768
#define STRIP_VARIADIC_ARG(T)
#define CONVERT_VARIADIC_ARG(T)
TODO: see if we can use this one:
Definition: Analysis.hpp:33
#define CAT(X, Y)
Concatenate macro arguments for 2-7 arguments.
Definition: cats.hpp:22

Redirection of BACKEND_REQ(GROUP, REQUIREMENT, (TAGS), TYPE, [(ARGS)]) for declaring backend requirements when invoked from within a module.

Definition at line 284 of file module_macros_inmodule_defs.hpp.

◆ MODULE_BE_GROUP

#define MODULE_BE_GROUP (   GROUP,
  IS_MODEL 
)
Value:
\
namespace Gambit \
{ \
/* Put everything inside the Models namespace if this is a model-module */ \
BOOST_PP_IIF(IS_MODEL, namespace Models {, ) \
namespace MODULE \
{ \
namespace Pipes \
{ \
namespace FUNCTION \
{ \
namespace BEgroup \
{ \
/* Declare a safe pointer to the functor's internal register of \
which backend requirement is activated from this group. */ \
extern safe_ptr<str> GROUP; \
} \
} \
} \
} \
/* End Models namespace */ \
BOOST_PP_IIF(IS_MODEL, }, ) \
} \
#define IS_MODEL
#define MODULE
#define FUNCTION
TODO: see if we can use this one:
Definition: Analysis.hpp:33

Redirection of BACKEND_GROUP(GROUP) when invoked from within a module.

Definition at line 256 of file module_macros_inmodule_defs.hpp.

◆ MODULE_DECLARE_FUNCTION

#define MODULE_DECLARE_FUNCTION (   MODULE,
  FUNCTION,
  TYPE,
  CAN_MANAGE,
  IS_MODEL 
)

Redirection of START_FUNCTION when invoked from within a module (or model-module)

Definition at line 82 of file module_macros_inmodule_defs.hpp.

◆ MODULE_DEPENDENCY

#define MODULE_DEPENDENCY (   DEP,
  TYPE,
  MODULE,
  FUNCTION,
  IS_MODEL_DEP 
)
Value:
\
namespace Gambit \
{ \
/* Put everything inside the Models namespace if this is a model dep */ \
BOOST_PP_IIF(IS_MODEL_DEP, namespace Models {, ) \
\
namespace MODULE \
{ \
\
/* Given that TYPE is not void, create a safety_bucket for the \
dependency result. To be initialized automatically at runtime \
when the dependency is resolved. */ \
namespace Pipes \
{ \
namespace FUNCTION \
{ \
BOOST_PP_IIF(IS_TYPE(void,TYPE),, \
namespace Dep { extern dep_bucket<TYPE> DEP; } ) \
} \
\
} \
\
} \
\
/* Close the Models namespace if this is a model dep */ \
BOOST_PP_IIF(IS_MODEL_DEP, }, ) \
\
} \
#define IS_TYPE(COMPTYPE, TYPE)
#define MODULE
#define FUNCTION
TODO: see if we can use this one:
Definition: Analysis.hpp:33

Redirection of DEPENDENCY(DEP, TYPE) when invoked from within a module.

Definition at line 194 of file module_macros_inmodule_defs.hpp.

◆ MODULE_NEEDS_MANAGER_1

#define MODULE_NEEDS_MANAGER_1 (   LOOPMAN)
Value:
\
namespace Gambit \
{ \
namespace MODULE \
{ \
namespace Pipes \
{ \
namespace FUNCTION \
{ \
namespace Loop \
{ \
/* Declare the safe pointer to the iteration number of the loop \
this functor is running within, as external. */ \
extern omp_safe_ptr<long long> iteration; \
/* Create a loop-breaking function that can be called to tell the \
functor's loop manager that it is time to break. */ \
extern void wrapup(); \
/* Create a function that can be called to break a loop \
immediately,, without finishing the current iteration. */ \
extern void halt(); \
/* Create an iteration-skipping function that can be called to skip\
on to the next iteration. */ \
extern void cycle(); \
} \
} \
} \
} \
} \
\
#define MODULE
#define FUNCTION
TODO: see if we can use this one:
Definition: Analysis.hpp:33

Redirection of NEEDS_MANAGER(LOOPMAN) when invoked from within a module.

Definition at line 162 of file module_macros_inmodule_defs.hpp.

◆ MODULE_NEEDS_MANAGER_2

#define MODULE_NEEDS_MANAGER_2 (   LOOPMAN,
  TYPE 
)
Value:
MODULE_DEPENDENCY(LOOPMAN, TYPE, MODULE, FUNCTION, NOT_MODEL)
#define NOT_MODEL
#define MODULE
#define FUNCTION
#define MODULE_NEEDS_MANAGER_1(LOOPMAN)
Redirection of NEEDS_MANAGER(LOOPMAN) when invoked from within a module.

Redirection of NEEDS_MANAGER(LOOPMAN, TYPE) when invoked from within a module.

Definition at line 157 of file module_macros_inmodule_defs.hpp.

◆ MODULE_NEEDS_MANAGER_REDIRECT

#define MODULE_NEEDS_MANAGER_REDIRECT (   ...)    VARARG(MODULE_NEEDS_MANAGER_REDIRECT, __VA_ARGS__)

Definition at line 153 of file module_macros_inmodule_defs.hpp.

◆ MODULE_NEEDS_MANAGER_REDIRECT_1

#define MODULE_NEEDS_MANAGER_REDIRECT_1 (   _1)    MODULE_NEEDS_MANAGER_1(_1)

Definition at line 152 of file module_macros_inmodule_defs.hpp.

◆ MODULE_NEEDS_MANAGER_REDIRECT_2

#define MODULE_NEEDS_MANAGER_REDIRECT_2 (   _1,
  _2 
)    MODULE_NEEDS_MANAGER_2(_1, _2)

Variadic redirection for NEEDS_MANAGER when invoked from within a module.

Definition at line 151 of file module_macros_inmodule_defs.hpp.

◆ MODULE_START_CAPABILITY

#define MODULE_START_CAPABILITY (   MODULE)
Value:
IF_TOKEN_UNDEFINED(MODULE,FAIL("You must define MODULE before calling " \
"START_CAPABILITY.")) \
#define IF_TOKEN_UNDEFINED(A, B)
#define FAIL(x)
Definition: util_macros.hpp:37
#define MODULE

Redirection of START_CAPABILITY when invoked from within a module.

bjf> Does this actually do anything? Isn't MODULE always defined because it is the macro argument here?

Definition at line 76 of file module_macros_inmodule_defs.hpp.

◆ MODULE_START_MODULE

#define MODULE_START_MODULE
Value:
\
IF_TOKEN_UNDEFINED(MODULE,FAIL("You must define MODULE before calling " \
"START_MODULE.")) \
\
namespace Gambit \
{ \
namespace MODULE \
{ \
/* Module errors */ \
error& CAT(MODULE,_error)(); \
/* Module warnings */ \
warning& CAT(MODULE,_warning)(); \
} \
} \
#define FAIL(x)
Definition: util_macros.hpp:37
#define MODULE
TODO: see if we can use this one:
Definition: Analysis.hpp:33
#define CAT(X, Y)
Concatenate macro arguments for 2-7 arguments.
Definition: cats.hpp:22

Redirection of START_MODULE when invoked from within a module.

Definition at line 55 of file module_macros_inmodule_defs.hpp.