14#include "arcane/core/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/core/ISubDomain.h"
22#include "arcane/core/IMesh.h"
23#include "arcane/core/IMeshBase.h"
36MeshHandle::MeshHandleRef::
40, m_is_null(name.null())
43 m_user_data_list =
new UserDataList();
45 m_trace_mng = sd->traceMng();
46 m_mesh_mng = sd->meshMng();
47 m_variable_mng = sd->variableMng();
48 m_on_destroy_observable =
new Observable();
49 if (
auto v = Convert::Type<Int32>::tryParseFromEnvironment(
"ARCANE_DO_FATAL_IN_MESHHANDLE",
true))
50 m_do_fatal_in_mesh_method = v.value() != 0;
56MeshHandle::MeshHandleRef::
59 delete m_user_data_list;
60 delete m_on_destroy_observable;
66void MeshHandle::MeshHandleRef::
75void MeshHandle::MeshHandleRef::
79 IMesh* mesh = m_mesh_ptr;
82 m_on_destroy_observable->notifyAllObservers();
83 m_user_data_list->clear();
97MeshHandle(ISubDomain* sd,
const String& name)
98: m_ref(new MeshHandleRef(sd, name))
107: m_ref(new MeshHandleRef())
117 return m_ref->meshMng();
126 IMesh* m = m_ref->mesh();
136 IMesh* m = m_ref->mesh();
141 bool do_fatal = m_ref->isDoFatalInMeshMethod();
143 ARCANE_FATAL(
"Invalid call for null mesh. Call MeshHandle::hasMesh() before to make sure mesh is valid");
153 return m_ref->mesh();
162 return m_ref->traceMng();
171 return m_ref->variableMng();
180 return m_ref->subDomain()->application();
187onDestroyObservable()
const
189 return m_ref->onDestroyObservable();
210 m_handle =
mesh->handle();
#define ARCANE_CHECK_POINTER(ptr)
Macro returning the pointer ptr if it is not null or throwing an exception if it is null.
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Interface of an observable.
Interface of the subdomain manager.
Variable manager interface.
IMesh * mesh() const
Associated mesh. Can be null if the mesh has not yet been created.
const MeshHandle & handle() const
Associated handle.
MeshHandleOrMesh(const MeshHandle &handle)
Constructs an instance from a MeshHandle.
Unicode character string.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --