Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
CodeService.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/* CodeService.h (C) 2000-2025 */
9/* */
10/* Code Service. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_CODESERVICE_H
13#define ARCANE_CORE_CODESERVICE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/String.h"
18#include "arcane/utils/List.h"
20
21#include "arcane/core/ICodeService.h"
22#include "arcane/core/ServiceBuildInfo.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
38/*!
39 * \internal
40 * \brief Abstract class for a code service.
41 *
42 * The derived class must implement ICodeService::createSession()
43 */
44class ARCANE_CORE_EXPORT CodeService
45: public ICodeService
46{
47 public:
48
49 explicit CodeService(const ServiceBuildInfo& sbi);
50 ~CodeService() override;
51
52 public:
53
54 bool parseArgs(StringList&) override { return false; }
55
56 ISubDomain* createAndLoadCase(ISession* session, const SubDomainBuildInfo& sdbi) override;
57 void initCase(ISubDomain* sub_domain, bool is_continue) override;
58 bool allowExecution() const override;
59 StringCollection validExtensions() const override;
60 Real lengthUnit() const override { return 1.0; }
61
62 public:
63
64 IServiceInfo* serviceInfo() const override;
65 IBase* serviceParent() const override;
66 IService* serviceInterface() override { return this; }
67
68 protected:
69
70 void _addExtension(const String& extension);
71 IApplication* _application() const;
72
73 virtual void _preInitializeSubDomain(ISubDomain*) {}
74
75 private:
76
77 CodeServicePrivate* m_p = nullptr;
78};
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83} // namespace Arcane
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88#endif
Declarations of types used in Arcane.
Real lengthUnit() const override
Length unit used by the code.
Definition CodeService.h:60
IService * serviceInterface() override
Interface of this service (normally this).
Definition CodeService.h:66
bool parseArgs(StringList &) override
Parses the command line arguments.
Definition CodeService.h:54
Application interface.
Interface of the base class for main arcane objects.
Definition IBase.h:32
Interface of a case loader.
Interface for service or module information.
Interface of a service.
Definition IService.h:40
Interface for a case execution session.
Definition ISession.h:38
Interface of the subdomain manager.
Definition ISubDomain.h:75
Structure containing the information to create a service.
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.