Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
PropertyDeclarations.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/* PropertyDeclarations.h (C) 2000-2020 */
9/* */
10/* Déclaration des types et macros pour la gestion des propriétés. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_PROPERTYDECLARATIONS_H
13#define ARCANE_UTILS_PROPERTYDECLARATIONS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16/*
17 * NOTE: Les classes de ce fichier sont en cours de mise au point.
18 * NOTE: L'API peut changer à tout moment. Ne pas utiliser en dehors de Arcane.
19 */
20
22#include "arcane/utils/String.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29class JSONValue;
30}
31
32namespace Arcane::properties
33{
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
38class IPropertyVisitor;
39template<typename T>
40class PropertyVisitor;
41template<typename T>
42class GenericPropertyVisitorWrapper;
43template<typename T>
45{
46};
47
48/*---------------------------------------------------------------------------*/
49/*---------------------------------------------------------------------------*/
64#define ARCANE_DECLARE_PROPERTY_CLASS(class_name)\
65 public:\
66 static const char* propertyClassName() { return #class_name; }\
67 template<typename V> static void _applyPropertyVisitor(V& visitor);\
68 static void applyPropertyVisitor(Arcane::properties::PropertyVisitor<class_name>& p); \
69 static void applyPropertyVisitor(Arcane::properties::IPropertyVisitor* p)
70
71/*---------------------------------------------------------------------------*/
72/*---------------------------------------------------------------------------*/
96#define ARCANE_REGISTER_PROPERTY_CLASS(aclass,a_build_args) \
97namespace\
98{\
99 Arcane::properties::IPropertySettingsInfo* \
100 ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsInfo##aclass) (const Arcane::properties::PropertySettingsBuildInfo& sbi) \
101 {\
102 auto* si = Arcane::properties::PropertySettingsInfo<aclass>::create(sbi,__FILE__,__LINE__); \
103 return si;\
104 }\
105 Arcane::properties::PropertySettingsBuildInfo \
106 ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsBuildInfo##aclass) () \
107 {\
108 return Arcane::properties::PropertySettingsBuildInfo a_build_args;\
109 }\
110}\
111void aclass :: \
112applyPropertyVisitor(Arcane::properties::PropertyVisitor<aclass>& p)\
113{\
114 aclass :: _applyPropertyVisitor(p);\
115}\
116void aclass :: \
117applyPropertyVisitor(Arcane::properties::IPropertyVisitor* p) \
118{\
119 Arcane::properties::GenericPropertyVisitorWrapper<aclass> xp(p);\
120 aclass :: _applyPropertyVisitor(xp); \
121}\
122Arcane::properties::PropertySettingsRegisterer ARCANE_EXPORT \
123 ARCANE_JOIN_WITH_LINE(globalPropertySettingsRegisterer##aclass)\
124 (& ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsInfo##aclass),\
125 & ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsBuildInfo##aclass),\
126 #aclass)
127
128/*---------------------------------------------------------------------------*/
129/*---------------------------------------------------------------------------*/
130
131} // End namespace Arcane::properties
132
133/*---------------------------------------------------------------------------*/
134/*---------------------------------------------------------------------------*/
135
136#endif
137
Déclarations des types utilisés dans Arcane.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-