14#include "arcane/MeshHandle.h"
16#include "arcane/utils/UserDataList.h"
17#include "arcane/utils/FatalErrorException.h"
18#include "arcane/utils/Observable.h"
19#include "arcane/utils/ValueConvert.h"
21#include "arcane/ISubDomain.h"
22#include "arcane/IMesh.h"
23#include "arcane/IMeshBase.h"
35MeshHandle::MeshHandleRef::
36MeshHandleRef(ISubDomain* sd,
const String& name)
39, m_is_null(name.null())
42 m_user_data_list =
new UserDataList();
44 m_trace_mng = sd->traceMng();
45 m_mesh_mng = sd->meshMng();
46 m_variable_mng = sd->variableMng();
47 m_on_destroy_observable =
new Observable();
48 if (
auto v = Convert::Type<Int32>::tryParseFromEnvironment(
"ARCANE_DO_FATAL_IN_MESHHANDLE",
true))
49 m_do_fatal_in_mesh_method = v.value()!=0;
55MeshHandle::MeshHandleRef::
58 delete m_user_data_list;
59 delete m_on_destroy_observable;
65void MeshHandle::MeshHandleRef::
74void MeshHandle::MeshHandleRef::
78 IMesh* mesh = m_mesh_ptr;
81 m_on_destroy_observable->notifyAllObservers();
82 m_user_data_list->clear();
96MeshHandle(ISubDomain* sd,
const String& name)
97: m_ref(new MeshHandleRef(sd,name))
106: m_ref(new MeshHandleRef())
116 return m_ref->meshMng();
125 IMesh* m = m_ref->mesh();
135 IMesh* m = m_ref->mesh();
140 bool do_fatal = m_ref->isDoFatalInMeshMethod();
142 ARCANE_FATAL(
"Invalid call for null mesh. Call MeshHandle::hasMesh() before to make sure mesh is valid");
152 return m_ref->mesh();
161 return m_ref->traceMng();
170 return m_ref->variableMng();
179 return m_ref->subDomain()->application();
186onDestroyObservable()
const
188 return m_ref->onDestroyObservable();
#define ARCANE_CHECK_POINTER(ptr)
Macro retournant le pointeur ptr s'il est non nul ou lancant une exception s'il est nul.
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Interface de l'application.
virtual MeshHandle handle() const =0
Handle sur ce maillage.
Interface du gestionnaire des maillages.
Interface d'un observable.
Interface du gestionnaire de variables.
IMesh * mesh() const
Maillage associé. Peut être nul si le maillage n'a pas encore été créé
MeshHandleOrMesh(const MeshHandle &handle)
Construit une instance à partir d'un MeshHandle.
Interface du gestionnaire de traces.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-