Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ICodeService.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/* ICodeService.h (C) 2000-2025 */
9/* */
10/* Interface of the code service. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ICODESERVICE_H
13#define ARCANE_CORE_ICODESERVICE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/core/IService.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29/*!
30 * \brief Interface of a case loader.
31 * \ingroup StandardService
32 */
33class ARCANE_CORE_EXPORT ICodeService
34: public IService
35{
36 public:
37
38 ~ICodeService() = default; //!< Frees resources
39
40 public:
41
42 /*! \brief Creates a session.
43 *
44 * The instance must call IApplication::addSession().
45 */
46 virtual ISession* createSession() = 0;
47
48 /*!
49 * \brief Parses the command line arguments.
50 *
51 * The array \a args only contains arguments that have not
52 * been interpreted by Arcane.
53 *
54 * Recognized arguments must be removed from the list.
55 *
56 * \retval true if the execution must stop,
57 * \retval false if it continues normally
58 */
59 virtual bool parseArgs(StringList& args) = 0;
60
61 /*!
62 * \brief Creates and loads the case using the info \a sdbi
63 * for the session \a session.
64 */
65 virtual ISubDomain* createAndLoadCase(ISession* session, const SubDomainBuildInfo& sdbi) = 0;
66
67 /*!
68 * \brief Initializes the session \a session.
69 *
70 * \param is_continue indicates if we are resuming
71 * The case must already have been loaded by loadCase()
72 */
73 virtual void initCase(ISubDomain* sub_domain, bool is_continue) = 0;
74
75 //! Returns whether the code allows execution.
76 virtual bool allowExecution() const = 0;
77
78 /*! \brief Returns the list of file extensions processed by the instance.
79 * The extension does not include the '.'.
80 */
81 virtual StringCollection validExtensions() const = 0;
82
83 /*!
84 * \brief Length unit used by the code.
85 *
86 * This must be 1.0 if the code uses the international system and thus
87 * the meter as the length unit. If the unit is the centimeter, for
88 * example, the value is 0.01.
89 *
90 * This value can be used, for example, when reading the
91 * mesh if the mesh format supports the notion of length unit.
92 */
93 virtual Real ARCANE_DEPRECATED lengthUnit() const = 0;
94};
95
96/*---------------------------------------------------------------------------*/
97/*---------------------------------------------------------------------------*/
98
99} // namespace Arcane
100
101/*---------------------------------------------------------------------------*/
102/*---------------------------------------------------------------------------*/
103
104#endif
Declarations of Arcane's general types.
Interface of a case loader.
virtual bool parseArgs(StringList &args)=0
Parses the command line arguments.
virtual ISubDomain * createAndLoadCase(ISession *session, const SubDomainBuildInfo &sdbi)=0
Creates and loads the case using the info sdbi for the session session.
virtual Real ARCANE_DEPRECATED lengthUnit() const =0
Length unit used by the code.
virtual bool allowExecution() const =0
Returns whether the code allows execution.
~ICodeService()=default
Frees resources.
virtual ISession * createSession()=0
Creates a session.
virtual void initCase(ISubDomain *sub_domain, bool is_continue)=0
Initializes the session session.
virtual StringCollection validExtensions() const =0
Returns the list of file extensions processed by the instance. The extension does not include the '....
IService()
Constructor.
Definition IService.h:44
Interface for a case execution session.
Definition ISession.h:38
Interface of the subdomain manager.
Definition ISubDomain.h:75
Parameters necessary for building a subdomain.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Collection< String > StringCollection
Collection of strings.
Definition UtilsTypes.h:506
List< String > StringList
Unicode string list.
Definition UtilsTypes.h:509
double Real
Type representing a real number.