Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
ModelFileChecker Class Reference

Checks and resolves MARTY model classes in a model header. More...

#include <ModelFileChecker.h>

Public Member Functions

 ModelFileChecker (const std::string &filePath)
 Constructs a checker for a given file path.
 
bool isAnyModelTemplate () const
 Tests whether the file contains any MARTY model template class.
 
ModelClassInfo resolveModelClass (const std::string &model) const
 Resolve the concrete C++ class name for a user-provided model name.
 

Static Public Member Functions

static std::vector< std::string > modelClassCandidates (const std::string &model)
 Return the exact candidate sequence used by resolveModelClass.
 

Detailed Description

Checks and resolves MARTY model classes in a model header.

The resolver intentionally does not force the legacy _Model suffix. Given a model name such as THDM, it first looks for class THDM, then uppercase and lowercase variants, and only then tries the corresponding *_Model names. This keeps existing SM_Model / THDM_Model files working while allowing simpler class names in custom MARTY model headers.

Definition at line 36 of file ModelFileChecker.h.

Constructor & Destructor Documentation

◆ ModelFileChecker()

ModelFileChecker::ModelFileChecker ( const std::string &  filePath)

Constructs a checker for a given file path.

Parameters
filePathPath to the C++ source/header file to inspect.

Definition at line 9 of file ModelFileChecker.cpp.

Member Function Documentation

◆ isAnyModelTemplate()

bool ModelFileChecker::isAnyModelTemplate ( ) const

Tests whether the file contains any MARTY model template class.

This method is preserved for backwards compatibility. New code should prefer resolveModelClass.

Definition at line 22 of file ModelFileChecker.cpp.

◆ modelClassCandidates()

std::vector< std::string > ModelFileChecker::modelClassCandidates ( const std::string &  model)
static

Return the exact candidate sequence used by resolveModelClass.

Definition at line 31 of file ModelFileChecker.cpp.

◆ resolveModelClass()

ModelClassInfo ModelFileChecker::resolveModelClass ( const std::string &  model) const

Resolve the concrete C++ class name for a user-provided model name.

Candidate order for model is:

  1. model
  2. uppercase(model)
  3. lowercase(model)
  4. model_Model
  5. uppercase(model)_Model
  6. lowercase(model)_Model

Duplicate candidates are ignored. Both non-template and template class declarations are accepted.

Exceptions
std::runtime_errorif no candidate is found or if the file cannot be opened.

Definition at line 110 of file ModelFileChecker.cpp.


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