gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
Gambit::backend_functor< typename variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... > Class Template Reference

Template specialisation for variadic, non-void backend functions. More...

#include <functors.hpp>

Inheritance diagram for Gambit::backend_functor< typename variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >:
Collaboration diagram for Gambit::backend_functor< typename variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >:

Public Member Functions

 backend_functor (typename variadic_ptr< TYPE, ARGS... >::type, str, str, str, str, str, str, Models::ModelFunctorClaw &)
 Constructor. More...
 
virtual ~backend_functor ()
 Destructor. More...
 
template<typename... VARARGS>
TYPE operator() (VARARGS &&... varargs)
 Operation (execute function and return value) More...
 
- Public Member Functions inherited from Gambit::backend_functor_common< variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >
 backend_functor_common (funcPtrType, str, str, str, str, str, str, Models::ModelFunctorClaw &)
 Constructor. More...
 
virtual ~backend_functor_common ()
 Destructor. More...
 
void updatePointer (funcPtrType)
 Update the internal function pointer wrapped by the functor. More...
 
funcPtrType handoutFunctionPointer ()
 Hand out the internal function pointer wrapped by the functor. More...
 
safe_ptr< bool > inUsePtr ()
 Hand out a safe pointer to this backend functor's inUse flag. More...
 
virtual str safe_version () const
 Getter for the 'safe' incarnation of the version of the wrapped function's origin (module or backend) More...
 
- Public Member Functions inherited from Gambit::functor
 functor (str, str, str, str, Models::ModelFunctorClaw &)
 Constructor. More...
 
virtual ~functor ()
 
virtual void calculate ()
 Virtual calculate(); needs to be redefined in daughters. More...
 
virtual void reset_and_calculate ()
 Reset-then-recalculate method. More...
 
void setStatus (int)
 Setter for status: -6 = required external tool absent (pybind11) -5 = required external tool absent (Mathematica) -4 = required backend absent (backend ini functions) -3 = required classes absent -2 = function absent -1 = origin absent 0 = model incompatibility (default) 1 = available 2 = active. More...
 
void setPurpose (str)
 Setter for purpose (relevant only for next-to-output functors) More...
 
void setVertexID (int)
 Setter for vertex ID (used in printer system) More...
 
void setTimingVertexID (int)
 Set ID for timing 'vertex' (used in printer system) More...
 
str name () const
 Getter for the wrapped function's name. More...
 
str capability () const
 Getter for the wrapped function's reported capability. More...
 
str type () const
 Getter for the wrapped function's reported return type. More...
 
str origin () const
 Getter for the wrapped function's origin (module or backend name) More...
 
str version () const
 Getter for the version of the wrapped function's origin (module or backend) More...
 
int status () const
 Getter for the wrapped function current status: -4 = required backend absent (backend ini functions) -3 = required classes absent -2 = function absent -1 = origin absent 0 = model incompatibility (default) 1 = available 2 = active. More...
 
sspair quantity () const
 Getter for the overall quantity provided by the wrapped function (capability-type pair) More...
 
str purpose () const
 Getter for purpose (relevant for output nodes, aka helper structures for the dep. resolution) More...
 
int vertexID () const
 Getter for vertex ID. More...
 
int timingVertexID () const
 Getter for timing vertex ID. More...
 
str label () const
 Getter for string label. More...
 
str timingLabel () const
 Getter for the printer timing label. More...
 
virtual bool requiresPrinting () const
 Getter indicating if the wrapped function's result should to be printed. More...
 
virtual bool requiresTimingPrinting () const
 Getter indicating if the timing data for this function's execution should be printed. More...
 
virtual void setPrintRequirement (bool)
 Setter for indicating if the wrapped function's result should to be printed. More...
 
virtual void setTimingPrintRequirement (bool)
 Setter for indicating if the timing data for this function's execution should be printed. More...
 
virtual void setNestedList (std::vector< functor *> &)
 Set the ordered list of pointers to other functors that should run nested in a loop managed by this one. More...
 
virtual void setIteration (long long)
 Set the iteration number in a loop in which this functor runs. More...
 
virtual bool canBeLoopManager ()
 Getter for revealing whether this is permitted to be a manager functor. More...
 
virtual str loopManagerCapability ()
 Getter for revealing the required capability of the wrapped function's loop manager. More...
 
virtual str loopManagerType ()
 Getter for revealing the required type of the wrapped function's loop manager. More...
 
virtual str loopManagerName ()
 Getter for revealing the name of the wrapped function's assigned loop manager. More...
 
virtual str loopManagerOrigin ()
 Getter for revealing the module of the wrapped function's assigned loop manager. More...
 
virtual void breakLoop ()
 Tell the functor that the loop it manages should break now. More...
 
virtual std::set< sspairdependencies ()
 Getter for listing currently activated dependencies. More...
 
virtual std::set< strbackendgroups ()
 Getter for listing backend requirement groups. More...
 
virtual std::set< sspairbackendreqs ()
 Getter for listing all backend requirements. More...
 
virtual std::set< sspairbackendreqs (str)
 Getter for listing backend requirements from a specific group. More...
 
virtual std::set< sspairbackendspermitted (sspair)
 Getter for listing permitted backends. More...
 
virtual std::set< strbackendreq_tags (sspair)
 Getter for listing tags associated with backend requirements. More...
 
virtual std::set< sspairforcematchingbackend (str)
 Getter for listing backend requirements that must be resolved from the same backend. More...
 
virtual std::set< sspairbackend_conditional_dependencies (str, str, str, str)
 Getter for listing backend-specific conditional dependencies (4-string version) More...
 
virtual std::set< sspairbackend_conditional_dependencies (str req, str type, str be)
 Getter for backend-specific conditional dependencies (3-string version) More...
 
virtual std::set< sspairbackend_conditional_dependencies (functor *)
 Getter for backend-specific conditional dependencies (backend functor pointer version) More...
 
virtual std::set< sspairmodel_conditional_dependencies (str)
 Getter for listing model-specific conditional dependencies. More...
 
virtual std::set< sspairmodel_conditional_backend_reqs (str)
 Getter for listing model-specific conditional backend requirements. More...
 
virtual void resolveDependency (functor *)
 Resolve a dependency using a pointer to another functor object. More...
 
virtual void resolveLoopManager (functor *)
 Set this functor's loop manager (if it has one) More...
 
virtual void resolveBackendReq (functor *)
 Resolve a backend requirement using a pointer to another functor object. More...
 
virtual void notifyOfModel (str)
 Notify the functor that a certain model is being scanned, so that it can activate itself accordingly. More...
 
virtual void notifyOfDependee (functor *)
 Notify the functor that it is being used to fill a dependency of another functor. More...
 
virtual void notifyOfBackends (std::map< str, std::set< str > >)
 Indicate to the functor which backends are actually loaded and working. More...
 
virtual void print (Printers::BasePrinter *printer, const int pointID, int thread_num)
 Printer function. More...
 
virtual void print (Printers::BasePrinter *printer, const int pointID)
 Printer function (no-thread-index short-circuit) More...
 
virtual invalid_point_exceptionretrieve_invalid_point_exception ()
 Retrieve the previously saved exception generated when this functor invalidated the current point in model space. More...
 
void notifyOfIniOptions (const Options &)
 Notify the functor about an instance of the options class that contains information from its corresponding ini-file entry in the auxiliaries or observables section. More...
 
template<typename TYPE >
void setOption (const str &key, const TYPE val)
 Set an option for the functor directly (for use in standalone executables). More...
 
safe_ptr< OptionsgetOptions ()
 Return a safe pointer to the options that this functor is supposed to run with (e.g. from the ini file). More...
 
void notifyOfSubCaps (const Options &)
 Notify the functor about an instance of the options class that contains sub-capability information. More...
 
template<typename TYPE >
void setSubCap (const str &key, const TYPE val)
 Set a sub-capability (subcap)for the functor directly (for use in standalone executables). More...
 
safe_ptr< OptionsgetSubCaps ()
 Return a safe pointer to the subcaps that this functor realises it is supposed to facilitate downstream calculation of. More...
 
safe_ptr< std::set< sspair > > getDependees ()
 Return a safe pointer to the vector of all capability,type pairs of functors arranged downstream of this one in the dependency tree. More...
 
bool allModelsAllowed ()
 Test whether the functor is allowed to be used with all models. More...
 
bool modelAllowed (str model)
 Test whether the functor is always allowed (either explicitly or implicitly) to be used with a given model. More...
 
bool modelExplicitlyAllowed (str model)
 Test whether the functor is explictly always allowed to be used with a given model. More...
 
void setAllowedModel (str model)
 Add a model to the internal list of models for which this functor is allowed to be used. More...
 
bool modelComboAllowed (std::set< str > combo)
 Test whether the functor is allowed (either explicitly or implicitly) to be used with a given combination of models. More...
 
bool modelComboExplicitlyAllowed (std::set< str > combo)
 Test whether the functor has been explictly allowed to be used with a given combination of models. More...
 
void setModelGroup (str group, str contents)
 Add a model group definition to the internal list of model groups. More...
 
void setAllowedModelGroupCombo (str groups)
 Add a combination of model groups to the internal list of combinations for which this functor is allowed to be used. More...
 
virtual double getRuntimeAverage ()
 Interfaces for runtime optimization Need to be implemented by daughters. More...
 
virtual double getInvalidationRate ()
 
virtual void setFadeRate (double)
 
virtual void notifyOfInvalidation (const str &)
 
virtual void reset ()
 

Additional Inherited Members

- Protected Types inherited from Gambit::backend_functor_common< variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >
typedef variadic_ptr< TYPE, ARGS... >::type funcPtrType
 Type of the function pointer being encapsulated. More...
 
- Protected Member Functions inherited from Gambit::backend_functor_common< variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >
virtual void setInUse (bool)
 Set the inUse flag. More...
 
- Protected Member Functions inherited from Gambit::functor
bool allowed_parent_or_friend_exists (str model)
 Test if there is a model in the functor's allowedModels list as which this model can be interpreted. More...
 
bool in_allowed_combo (str model)
 Check that a model is actually part of a combination that is allowed to be used with this functor. More...
 
bool contains_anything_interpretable_as_member_of (std::set< str > combo, str group)
 Test whether any of the entries in a given model group is a valid interpretation of any members in a given combination. More...
 
bool has_common_elements (std::set< str > combo, str group)
 Work out whether a given combination of models and a model group have any elements in common. More...
 
str find_friend_or_parent_model_in_map (str model, std::map< str, std::set< sspair > > karta)
 Try to find a parent or friend model in some user-supplied map from models to sspair vectors. More...
 
virtual void reset (int)
 Reset functor for one thread only. More...
 
- Static Protected Member Functions inherited from Gambit::functor
static void failBigTime (str method)
 Attempt to retrieve a dependency or model parameter that has not been resolved. More...
 
- Protected Attributes inherited from Gambit::backend_functor_common< variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >
funcPtrType myFunction
 Internal storage of function pointer. More...
 
int myLogTag
 Integer LogTag, for tagging log messages. More...
 
str mySafeVersion
 Internal storage of the 'safe' version of the version (for use in namespaces, variable names, etc). More...
 
bool inUse
 Flag indicating if this backend functor is actually in use in a given scan. More...
 
- Protected Attributes inherited from Gambit::functor
str myName
 Internal storage of the function name. More...
 
str myCapability
 Internal storage of exactly what the function calculates. More...
 
str myType
 Internal storage of the type of what the function calculates. More...
 
str myOrigin
 Internal storage of the name of the module or backend to which the function belongs. More...
 
str myVersion
 Internal storage of the version of the module or backend to which the function belongs. More...
 
str myPurpose
 Purpose of the function (relevant for output and next-to-output functors) More...
 
const Models::ModelFunctorClawmyClaw
 Bound model functor claw, for checking relationships between models. More...
 
const str myLabel
 String label, used to label functor results for printer system. More...
 
const str myTimingLabel
 String label, used to label functor timing data for printer system. More...
 
int myStatus
 Status: -4 = required backend absent (backend ini functions) -3 = required classes absent -2 = function absent -1 = origin absent 0 = model incompatibility (default) 1 = available 2 = active. More...
 
int myVertexID
 Internal storage of the vertex ID number used by the printer system to identify functors. More...
 
int myTimingVertexID
 ID assigned by printers to the timing data output stream. More...
 
bool verbose
 Debug flag. More...
 
Options myOptions
 Internal storage of function options, as a YAML node. More...
 
Options mySubCaps
 Internal storage of function sub-capabilities, as a YAML node. More...
 
std::set< sspairmyDependees
 List of all capability,type pairs of functors downstream of this one in the dependency tree. More...
 
std::set< strallowedModels
 List of allowed models. More...
 
std::set< std::set< str > > allowedGroupCombos
 List of allowed model group combinations. More...
 
std::map< str, std::set< str > > modelGroups
 Map from model group names to group contents. More...
 

Detailed Description

template<typename TYPE, typename... ARGS>
class Gambit::backend_functor< typename variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >

Template specialisation for variadic, non-void backend functions.

Definition at line 921 of file functors.hpp.

Constructor & Destructor Documentation

◆ backend_functor()

template<typename TYPE , typename... ARGS>
Gambit::backend_functor< typename variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >::backend_functor ( typename variadic_ptr< TYPE, ARGS... >::type  inputFunction,
str  func_name,
str  func_capability,
str  result_type,
str  origin_name,
str  origin_version,
str  safe_version,
Models::ModelFunctorClaw claw 
)

Constructor.

Definition at line 314 of file functor_definitions.hpp.

References convolve_with_theory::ARGS, and void.

316  : backend_functor_common<typename variadic_ptr<TYPE,ARGS...>::type, TYPE, ARGS...>(inputFunction, func_name,
317  func_capability, result_type, origin_name, origin_version, safe_version, claw) {}
virtual str safe_version() const
Getter for the &#39;safe&#39; incarnation of the version of the wrapped function&#39;s origin (module or backend)...
str type() const
Getter for the wrapped function&#39;s reported return type.
Definition: functors.cpp:119
backend_functor_common(funcPtrType, str, str, str, str, str, str, Models::ModelFunctorClaw &)
Constructor.

◆ ~backend_functor()

template<typename TYPE , typename... ARGS>
virtual Gambit::backend_functor< typename variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >::~backend_functor ( )
inlinevirtual

Destructor.

Definition at line 931 of file functors.hpp.

931 {}

Member Function Documentation

◆ operator()()

template<typename TYPE , typename... ARGS>
template<typename... VARARGS>
TYPE Gambit::backend_functor< typename variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >::operator() ( VARARGS &&...  varargs)
inline

Operation (execute function and return value)

Definition at line 935 of file functors.hpp.

References convolve_with_theory::ARGS, Gambit::Logging::LogMaster::entering_backend(), Gambit::Logging::LogMaster::leaving_backend(), and Gambit::logger().

936  {
938  TYPE tmp = this->myFunction(std::forward<VARARGS>(varargs)...);
940  return tmp;
941  }
EXPORT_SYMBOLS Logging::LogMaster & logger()
Function to retrieve a reference to the Gambit global log object.
Definition: logger.cpp:95
Here is the call graph for this function:

The documentation for this class was generated from the following files: