Arcane  v3.15.0.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-2024 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-2024 */
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 using PropertyInstanceType = class_name; \
67 static const char* propertyClassName() { return #class_name; }\
68 template<typename V> static void _applyPropertyVisitor(V& visitor);\
69 static void applyPropertyVisitor(Arcane::properties::PropertyVisitor<class_name>& p); \
70 static void applyPropertyVisitor(Arcane::properties::IPropertyVisitor* p)
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
97#define ARCANE_REGISTER_PROPERTY_CLASS(aclass,a_build_args) \
98namespace\
99{\
100 Arcane::properties::IPropertySettingsInfo* \
101 ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsInfo##aclass) (const Arcane::properties::PropertySettingsBuildInfo& sbi) \
102 {\
103 auto* si = Arcane::properties::PropertySettingsInfo<aclass>::create(sbi,__FILE__,__LINE__); \
104 return si;\
105 }\
106 Arcane::properties::PropertySettingsBuildInfo \
107 ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsBuildInfo##aclass) () \
108 {\
109 return Arcane::properties::PropertySettingsBuildInfo a_build_args;\
110 }\
111}\
112void aclass :: \
113 applyPropertyVisitor(Arcane::properties::PropertyVisitor<typename aclass :: PropertyInstanceType >& p) \
114{\
115 aclass :: _applyPropertyVisitor(p);\
116}\
117void aclass :: \
118applyPropertyVisitor(Arcane::properties::IPropertyVisitor* p) \
119{\
120 Arcane::properties::GenericPropertyVisitorWrapper<aclass> xp(p);\
121 aclass :: _applyPropertyVisitor(xp); \
122}\
123Arcane::properties::PropertySettingsRegisterer ARCANE_EXPORT \
124 ARCANE_JOIN_WITH_LINE(globalPropertySettingsRegisterer##aclass)\
125 (& ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsInfo##aclass),\
126 & ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsBuildInfo##aclass),\
127 #aclass)
128
129/*---------------------------------------------------------------------------*/
130/*---------------------------------------------------------------------------*/
131
132} // End namespace Arcane::properties
133
134/*---------------------------------------------------------------------------*/
135/*---------------------------------------------------------------------------*/
136
137#endif
138
Déclarations des types utilisés dans Arcane.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-