Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
AbstractModule.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/* AbstractModule.h (C) 2000-2025 */
9/* */
10/* Abstract base class of a module. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ABSTRACTMODULE_H
13#define ARCANE_CORE_ABSTRACTMODULE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/String.h"
18#include "arcane/utils/VersionInfo.h"
19#include "arcane/utils/TraceAccessor.h"
20
22#include "arcane/core/IModule.h"
23#include "arcane/core/ModuleBuildInfo.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34class ModuleBuildInfo;
35typedef ModuleBuildInfo ModuleBuilder;
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
47class ARCANE_CORE_EXPORT AbstractModule
48: public TraceAccessor
49, public IModule
50{
51 public:
52
55
56 public:
57
59 virtual ~AbstractModule();
60
61 public:
62
64 VersionInfo versionInfo() const override { return m_version_info; }
65
66 public:
67
80 static void staticInitialize(ISubDomain* sd) { ARCANE_UNUSED(sd); }
81
82 public:
83
85 String name() const override { return m_name; }
87 ISession* session() const override { return m_session; }
89 ISubDomain* subDomain() const override { return m_sub_domain; }
91 IMesh* defaultMesh() const override { return m_default_mesh_handle.mesh(); }
95 IParallelMng* parallelMng() const override;
97 IAcceleratorMng* acceleratorMng() const override;
99 ITraceMng* traceMng() const override;
101 void setUsed(bool v) override { m_used = v; }
103 bool used() const override { return m_used; }
105 void setDisabled(bool v) override { m_disabled = v; }
107 bool disabled() const override { return m_disabled; }
109
123 bool isGarbageCollected() const override { return false; }
124
125 protected:
126
127 void _setVersionInfo(const VersionInfo& vi)
128 {
129 m_version_info = vi;
130 }
131
132 private:
133
138 bool m_used;
142};
143
144/*---------------------------------------------------------------------------*/
145/*---------------------------------------------------------------------------*/
146
147} // End namespace Arcane
148
149/*---------------------------------------------------------------------------*/
150/*---------------------------------------------------------------------------*/
151
152#endif
Declarations of Arcane's general types.
ISession * session() const override
Session associated with the module.
bool m_used
true if the module is used
void setDisabled(bool v) override
Sets the module activation flag.
static void staticInitialize(ISubDomain *sd)
Initialization of the module for the sub-domain sd.
String name() const override
Module name.
String m_name
Module name.
MeshHandle defaultMeshHandle() const override
Default mesh for this module.
MeshHandle m_default_mesh_handle
Default mesh of the module.
VersionInfo m_version_info
Module version.
void setUsed(bool v) override
Sets the module usage flag.
ISubDomain * subDomain() const override
Sub-domain associated with the module.
ISession * m_session
Session.
bool isGarbageCollected() const override
Indicates if the module uses a Garbage collection system.
ISubDomain * m_sub_domain
sub-domain
bool m_disabled
Module activation status.
VersionInfo versionInfo() const override
Module version.
bool disabled() const override
Returns the module activation status.
IMesh * defaultMesh() const override
Default mesh for this module.
bool used() const override
Returns the module usage status.
IAcceleratorMng * m_accelerator_mng
Accelerator manager.
AbstractModule(const ModuleBuildInfo &)
Constructor from a ModuleBuildInfo.
Interface of a module.
Definition IModule.h:40
Interface of the parallelism manager for a subdomain.
Interface for a case execution session.
Definition ISession.h:38
Interface of the subdomain manager.
Definition ISubDomain.h:75
Handle on a mesh.
Definition MeshHandle.h:48
Information for building a module.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
Information about a version.
Definition VersionInfo.h:47
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --