Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IUserDataList.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/* IUserDataList.h (C) 2000-2018 */
9/* */
10/* Interface of a list that manages user data. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_IUSERDATALIST_H
13#define ARCANE_UTILS_IUSERDATALIST_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28class IUserData;
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33/*!
34 * \brief Interface of a list that manages user data.
35 * \ingroup Core
36 */
37class ARCANE_UTILS_EXPORT IUserDataList
38{
39 public:
40
41 //! Frees resources
42 virtual ~IUserDataList() {}
43
44 public:
45
46 /*!
47 * \brief Sets the user data associated with the name \a name.
48 *
49 * No data should already be associated with \a name, otherwise an
50 * exception is thrown.
51 */
52 virtual void setData(const String& name, IUserData* ud) = 0;
53
54 /*!
55 * \brief Data associated with \a name.
56 *
57 * An exception is thrown if \a allow_null is \a false and no
58 * data is associated with \a name. If \a allow_null is \a true and
59 * no data is associated, a null pointer is returned.
60 */
61 virtual IUserData* data(const String& name, bool allow_null = false) const = 0;
62
63 /*!
64 * \brief Removes the data associated with the name \a name.
65 *
66 * An exception is thrown if \a allow_null is \a false and no
67 * data is associated with \a name.
68 */
69 virtual void removeData(const String& name, bool allow_null = false) = 0;
70
71 /*!
72 * \brief Removes all user data.
73 *
74 * This is equivalent to calling removeData() for all user data.
75 */
76 virtual void clear() = 0;
77};
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82} // namespace Arcane
83
84/*---------------------------------------------------------------------------*/
85/*---------------------------------------------------------------------------*/
86
87#endif
Arcane configuration file.
Interface of a list that manages user data.
virtual void setData(const String &name, IUserData *ud)=0
Sets the user data associated with the name name.
virtual ~IUserDataList()
Frees resources.
virtual void removeData(const String &name, bool allow_null=false)=0
Removes the data associated with the name name.
virtual IUserData * data(const String &name, bool allow_null=false) const =0
Data associated with name.
virtual void clear()=0
Removes all user data.
Interface for user data attached to another object.
Definition IUserData.h:33
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --