Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
GlibAdapter.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* GlibAdapter.h (C) 2000-2018 */
9/* */
10/* Classes utilitaires pour s'adapter aux différentes versions de la 'glib'. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_CONCURRENCY_GLIBADAPTER_H
13#define ARCCORE_CONCURRENCY_GLIBADAPTER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/concurrency/ConcurrencyGlobal.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arccore
23{
24
25class GlibCond;
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29/*!
30 * \internal
31 * \brief Encapsule un GMutex de la glib.
32 */
33class ARCCORE_CONCURRENCY_EXPORT GlibMutex
34{
35 friend class GlibCond;
36 public:
37 class Impl;
38 public:
39 class Lock
40 {
41 public:
42 Lock(GlibMutex& x);
43 ~Lock();
44 Lock() = delete;
45 Lock(const Lock&) = delete;
46 void operator=(const Lock&) = delete;
47 private:
48 Impl* m_mutex;
49 };
50 public:
51 GlibMutex() ARCCORE_NOEXCEPT;
52 ~GlibMutex();
53 public:
54 void lock();
55 void unlock();
56 private:
57 Impl* m_p;
58};
59
60/*---------------------------------------------------------------------------*/
61/*---------------------------------------------------------------------------*/
62/*!
63 * \internal
64 * \brief Encapsule un GPrivate de la glib.
65 */
66class ARCCORE_CONCURRENCY_EXPORT GlibPrivate
67{
68 public:
69 class Impl;
70 public:
73 void create();
74 void setValue(void* value);
75 void* getValue();
76 private:
77 Impl* m_p;
78};
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82/*!
83 * \internal
84 * \brief Encapsule un GCond de la glib.
85 */
86class ARCCORE_CONCURRENCY_EXPORT GlibCond
87{
88 public:
89 class Impl;
90 public:
91 GlibCond();
92 ~GlibCond();
93 void broadcast();
94 void wait(GlibMutex* mutex);
95 private:
96 Impl* m_p;
97};
98
99/*---------------------------------------------------------------------------*/
100/*---------------------------------------------------------------------------*/
101
102} // End namespace Arccore
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107#endif
Espace de nom de Arccore.
Definition ArcaneTypes.h:24