Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IExternalPlugin.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* IExternalPlugin.h (C) 2000-2025 */
9/* */
10/* Interface for external plugin service. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IEXTERNALPLUGIN_H
13#define ARCANE_CORE_IEXTERNALPLUGIN_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21// WARNING: Experimental API. Do not use outside of Arcane
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29/*!
30 * \brief Interface for external service loading.
31 * \warning This interface is experimental.
32 *
33 * You must call loadFile() (possibly with an empty string)
34 * to initialize the instance.
35 */
36class ARCANE_CORE_EXPORT IExternalPlugin
37{
38 public:
39
40 //! Releases resources
41 virtual ~IExternalPlugin() = default;
42
43 public:
44
45 /*!
46 * \brief Loads and executes a file containing an external script.
47 *
48 * \a filename may be null, in which case only the instance is initialized.
49 */
50 virtual void loadFile(const String& filename) = 0;
51
52 /*!
53 * \brief Executes the function \a function_name.
54 *
55 * You must have loaded a script containing this function (via loadFile())
56 * before calling this method. The method \a function_name must not
57 * have arguments.
58 */
59 virtual void executeFunction(const String& function_name) = 0;
60
61 /*!
62 * \brief Executes the function \a function_name with a context
63 *
64 * You must have loaded a script containing this function (via loadFile())
65 * before calling this method. The specified method must take an
66 * instance of PythonSubDomainContext as an argument.
67 */
68 virtual void executeContextFunction(const String& function_name) = 0;
69};
70
71/*---------------------------------------------------------------------------*/
72/*---------------------------------------------------------------------------*/
73
74} // namespace Arcane
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79#endif
Declarations of Arcane's general types.
Interface for external service loading.
virtual void executeContextFunction(const String &function_name)=0
Executes the function function_name with a context.
virtual void loadFile(const String &filename)=0
Loads and executes a file containing an external script.
virtual void executeFunction(const String &function_name)=0
Executes the function function_name.
virtual ~IExternalPlugin()=default
Releases resources.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --