Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
IHashDatabase.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* IHashDatabase.h (C) 2000-2023 */
9/* */
10/* Interface d'une base de données de hash. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_STD_INTERNAL_IHASHDATABASE_H
13#define ARCANE_STD_INTERNAL_IHASHDATABASE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/ArrayView.h"
18#include "arcane/utils/Ref.h"
19
20#include "arcane/utils/String.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
32{
33 public:
34
35 HashDatabaseReadArgs() = default;
36
38 : m_hash_value(hash_value)
39 , m_values(v)
40 {}
41
42 public:
43
44 void setKey(const String& v) { m_key = v; }
45 const String& key() const { return m_key; }
46
47 void setValues(const Span<std::byte>& v) { m_values = v; }
48 Span<std::byte> values() const { return m_values; }
49
50 const String& hashValueAsString() const { return m_hash_value; }
51 void setHashValueAsString(const String& v) { m_hash_value = v; }
52
53 private:
54
55 String m_key;
56 String m_hash_value;
57 Span<std::byte> m_values;
58};
59
60/*---------------------------------------------------------------------------*/
61/*---------------------------------------------------------------------------*/
62
64{
65 public:
66
67 HashDatabaseWriteArgs() = default;
68
70 : m_values(v), m_hash_value(hash_value)
71 {}
72
73 public:
74
75 void setKey(const String& v) { m_key = v; }
76 const String& key() const { return m_key; }
77
78 void setValues(const Span<const std::byte>& v) { m_values = v; }
79 Span<const std::byte> values() const { return m_values; }
80
81 void setHashValue(const String& v) { m_hash_value = v; }
82 const String& hashValue() const { return m_hash_value; }
83
84 private:
85
86 String m_key;
87 Span<const std::byte> m_values;
88 String m_hash_value;
89};
90
91/*---------------------------------------------------------------------------*/
92/*---------------------------------------------------------------------------*/
93
95{
96 public:
97
98 const String& hashValueAsString() const { return m_hash_value; }
99 void setHashValueAsString(const String& v) { m_hash_value = v; }
100
101 private:
102
103 String m_hash_value;
104};
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
110{
111 public:
112
113 virtual ~IHashDatabase() = default;
114
115 public:
116
117 virtual void writeValues(const HashDatabaseWriteArgs& args, HashDatabaseWriteResult& result) = 0;
118 virtual void readValues(const HashDatabaseReadArgs& args) = 0;
119};
120
121/*---------------------------------------------------------------------------*/
122/*---------------------------------------------------------------------------*/
123
124extern "C++" Ref<IHashDatabase>
125createFileHashDatabase(ITraceMng* tm, const String& directory);
126
127extern "C++" Ref<IHashDatabase>
128createRedisHashDatabase(ITraceMng* tm, const String& machine_ip, Int32 port);
129
130/*---------------------------------------------------------------------------*/
131/*---------------------------------------------------------------------------*/
132
133} // namespace Arcane
134
135/*---------------------------------------------------------------------------*/
136/*---------------------------------------------------------------------------*/
137
138#endif
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Interface du gestionnaire de traces.
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-