Arcane  v4.1.3.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ConcurrencyApplication.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/* ConcurrencyApplication.h (C) 2000-2026 */
9/* */
10/* Gestion des services de multi-threading d'une application Arccore. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COMMON_INTERNAL_CONCURRENCYAPPLICATION_H
13#define ARCCORE_COMMON_INTERNAL_CONCURRENCYAPPLICATION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/concurrency/ConcurrencyGlobal.h"
18
19#include "arccore/base/String.h"
20#include "arccore/base/ReferenceCounter.h"
21#include "arccore/base/Ref.h"
22#include "arccore/base/CoreArray.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33class ARCCORE_CONCURRENCY_EXPORT ConcurrencyApplicationBuildInfo
34{
35 public:
36
37 ConcurrencyApplicationBuildInfo(ConstArrayView<String> task_service_names,
38 ConstArrayView<String> thread_service_names,
39 Int32 nb_task)
40 : m_task_implementation_services(task_service_names)
41 , m_thread_implementation_services(thread_service_names)
42 , m_nb_task(nb_task)
43 {
44 }
45
46 public:
47
48 ConstArrayView<String> taskImplementationServices() const
49 {
50 return m_task_implementation_services.constView();
51 }
52
53 ConstArrayView<String> threadImplementationServices() const
54 {
55 return m_thread_implementation_services.constView();
56 }
57
58 Int32 nbTaskThread() const { return m_nb_task; }
59
60 private:
61
62 Impl::CoreArray<String> m_task_implementation_services;
63 Impl::CoreArray<String> m_thread_implementation_services;
64 Int32 m_nb_task = 0;
65};
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70class ARCCORE_CONCURRENCY_EXPORT ConcurrencyApplication
71{
72 public:
73
74 void setTraceMng(ReferenceCounter<ITraceMng> tm) { m_trace = tm; }
75 void setCoreServices(const ConcurrencyApplicationBuildInfo& build_info);
76
77 template <typename InterfaceType> Ref<InterfaceType>
78 tryCreateServiceUsingInjector(ConstArrayView<String> names, String* found_name, bool has_trace);
79
80 public:
81
83 Ref<IStackTraceService> m_stack_trace_service;
84 Ref<ISymbolizerService> m_symbolizer_service;
85 Ref<IThreadImplementationService> m_thread_implementation_service;
86 Ref<IThreadImplementation> m_thread_implementation;
87 Ref<ITaskImplementation> m_task_implementation;
92};
93
94/*---------------------------------------------------------------------------*/
95/*---------------------------------------------------------------------------*/
96
97} // namespace Arcane
98
99/*---------------------------------------------------------------------------*/
100/*---------------------------------------------------------------------------*/
101
102#endif
Gestion des références à une classe C++.
Ref< InterfaceType > tryCreateServiceUsingInjector(ConstArrayView< String > names, String *found_name, bool has_trace)
String m_used_task_service_name
Nom du service utilisé pour gérer les tâches.
ReferenceCounter< ITraceMng > m_trace
Gestionnaire de traces.
String m_used_thread_service_name
Nom du service utilisé pour gérer les threads.
Vue constante d'un tableau de type T.
Référence à une instance.
Encapsulation d'un pointeur avec compteur de référence.
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int32_t Int32
Type entier signé sur 32 bits.