| Cantera 3.0.0

Loading...
Searching...
No Matches
PythonExtensionManager.h
Go to the documentation of this file.
1//! @file PythonExtensionManager.h
2
3#ifndef CT_PYTHONEXTENSIONMANAGER_H
4#define CT_PYTHONEXTENSIONMANAGER_H
5
6// This file is part of Cantera. See License.txt in the top-level directory or
7// at https://cantera.org/license.txt for license and copyright information.
8
9#include "cantera/base/ExtensionManager.h"
10
11 namespace Cantera
12{
13
14//! Class for managing user-defined %Cantera extensions written in Python
15//!
16//! Handles Python initialization if the main application is not the Python interpreter.
17//!
18//! Imports a user-specified module, which must be on the Python path and registers
19//! user-defined classes that are marked with the `@extension` decorator. See the
20//! documentation for
21//! <a href="../../sphinx/html/cython/utilities.html#cantera.extension">`@extension`</a>
22//! in the Python documentation for more information.
23//!
24//! @since New in %Cantera 3.0
25 class PythonExtensionManager : public ExtensionManager
26{
27 public:
28 void registerRateBuilders(const string& extensionName) override;
29
30 void registerRateBuilder(const string& moduleName,
31 const string& className, const string& rateName) override;
32
33 static void registerSelf();
34
35 void registerRateDataBuilder(const string& moduleName,
36 const string& className, const string& rateName) override;
37
38 private:
39 PythonExtensionManager() = default;
40};
41
42}
43
44#endif
ExtensionManager.h
Cantera::ExtensionManager
Base class for managing user-defined Cantera extensions written in other languages.
Definition ExtensionManager.h:36
Cantera::PythonExtensionManager
Class for managing user-defined Cantera extensions written in Python.
Definition PythonExtensionManager.h:26
Cantera::PythonExtensionManager::registerRateBuilder
void registerRateBuilder(const string &moduleName, const string &className, const string &rateName) override
Register a user-defined ReactionRate implementation with ReactionRateFactory.
Cantera::PythonExtensionManager::registerRateBuilders
void registerRateBuilders(const string &extensionName) override
Register ReactionRate defined in a user extension with ReactionRateFactory.
Cantera::PythonExtensionManager::registerRateDataBuilder
void registerRateDataBuilder(const string &moduleName, const string &className, const string &rateName) override
Register a user-defined ReactionData implementation.
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564