Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
Generator Class Reference

Handles code generation and simulation workflows using generator plugins. More...

#include <generator.h>

Inheritance diagram for Generator:

Signals

void generationStarted (Pipeline *pipeline)
 Emitted when the generation pipeline starts.
void generationEnded (const QString &outputFolder)
 Emitted when generation has completed.

Public Member Functions

 Generator (Pipeline *pipeline, QObject *parent=nullptr)
 Constructs a Generator instance.
VoidResult generate (const QString &outputDir, maki::IPlugin *generator)
 Generates output artifacts using the specified generator plugin.
VoidResult simulate (const QString &outputDir, maki::IPlugin *generator)
 Runs a simulation using the specified generator plugin.
Pipeline * pipeline () const
 Returns the pipeline used for generation workflows.
void setup ()
 Performs initialization and setup of the generator.

Private Member Functions

QWidget * progressContent ()
 Returns a header string for notifications.

Private Attributes

Pipeline * mPipeline = nullptr
 Pipeline responsible for executing generation and simulation processes.
QString mGenerationFolder
 Directory where generated artifacts are stored.
Pipeline::Info mInfo
 Holds information regarding the current generation pipeline.
QString mProgressId
 Holds the id of the progress widget.

Detailed Description

Handles code generation and simulation workflows using generator plugins.

The Generator class coordinates the execution of generator plugins through a Pipeline. It is responsible for invoking generation or simulation procedures and emitting signals when these workflows start and finish.

Generator plugins provide the actual implementation for producing artifacts or launching simulations based on the current model state.

Constructor & Destructor Documentation

◆ Generator()

Generator::Generator ( Pipeline * pipeline,
QObject * parent = nullptr )

Constructs a Generator instance.

Parameters
pipelinePipeline used to execute generation-related processes.
parentOptional Qt parent object.

Member Function Documentation

◆ generate()

VoidResult Generator::generate ( const QString & outputDir,
maki::IPlugin * generator )

Generates output artifacts using the specified generator plugin.

The generator plugin is responsible for producing code or other output files in the provided output directory. The process is executed through the configured pipeline.

Parameters
outputDirDirectory where generated artifacts will be written.
generatorGenerator plugin responsible for producing the output.
Returns
VoidResult indicating whether generation was successfully initiated.

◆ generationEnded

void Generator::generationEnded ( const QString & outputFolder)
signal

Emitted when generation has completed.

Parameters
outputFolderDirectory where the generated artifacts were written.

◆ generationStarted

void Generator::generationStarted ( Pipeline * pipeline)
signal

Emitted when the generation pipeline starts.

Observers may use this signal to display progress indicators or track generation activity.

Parameters
pipelinePipeline responsible for executing the generation steps.

◆ pipeline()

Pipeline * Generator::pipeline ( ) const

Returns the pipeline used for generation workflows.

Returns
Pointer to the associated Pipeline instance.

◆ setup()

void Generator::setup ( )

Performs initialization and setup of the generator.

This may include configuring the pipeline, preparing generation directories, or registering required callbacks.

◆ simulate()

VoidResult Generator::simulate ( const QString & outputDir,
maki::IPlugin * generator )

Runs a simulation using the specified generator plugin.

Similar to the generation workflow, but intended for launching simulation environments or related runtime artifacts produced by the generator plugin.

Parameters
outputDirDirectory containing the generated artifacts required for simulation.
generatorGenerator plugin responsible for preparing the simulation.
Returns
VoidResult indicating whether simulation was successfully initiated.

The documentation for this class was generated from the following files:
  • /__w/maki/maki/app/compiler/generator.h
  • /__w/maki/maki/app/compiler/generator.cpp