Arcane  v4.1.2.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-2025 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-2025 */
9/* */
10/* Déclaration des types et macros pour la gestion des propriétés. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COMMON_INTERNAL_PROPERTYDECLARATIONS_H
13#define ARCCORE_COMMON_INTERNAL_PROPERTYDECLARATIONS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/base/String.h"
18#include "arccore/common/CommonGlobal.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane::properties
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
30template<typename T>
31class PropertyVisitor;
32template<typename T>
34template<typename T>
36{
37};
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
55#define ARCANE_DECLARE_PROPERTY_CLASS(class_name) \
56 public:\
57 using PropertyInstanceType = class_name; \
58 static const char* propertyClassName() { return #class_name; }\
59 template<typename V> static void _applyPropertyVisitor(V& visitor);\
60 static void applyPropertyVisitor(Arcane::properties::PropertyVisitor<class_name>& p); \
61 static void applyPropertyVisitor(Arcane::properties::IPropertyVisitor* p)
62
63/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
88#define ARCANE_REGISTER_PROPERTY_CLASS(aclass,a_build_args) \
89namespace\
90{\
91 Arcane::properties::IPropertySettingsInfo* \
92 ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsInfo##aclass) (const Arcane::properties::PropertySettingsBuildInfo& sbi) \
93 {\
94 auto* si = Arcane::properties::PropertySettingsInfo<aclass>::create(sbi,__FILE__,__LINE__); \
95 return si;\
96 }\
97 Arcane::properties::PropertySettingsBuildInfo \
98 ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsBuildInfo##aclass) () \
99 {\
100 return Arcane::properties::PropertySettingsBuildInfo a_build_args;\
101 }\
102}\
103void aclass :: \
104 applyPropertyVisitor(Arcane::properties::PropertyVisitor<typename aclass :: PropertyInstanceType >& p) \
105{\
106 aclass :: _applyPropertyVisitor(p);\
107}\
108void aclass :: \
109applyPropertyVisitor(Arcane::properties::IPropertyVisitor* p) \
110{\
111 Arcane::properties::GenericPropertyVisitorWrapper<aclass> xp(p);\
112 aclass :: _applyPropertyVisitor(xp); \
113}\
114Arcane::properties::PropertySettingsRegisterer ARCANE_EXPORT \
115 ARCANE_JOIN_WITH_LINE(globalPropertySettingsRegisterer##aclass)\
116 (& ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsInfo##aclass),\
117 & ARCANE_JOIN_WITH_LINE(arcaneCreatePropertySettingsBuildInfo##aclass),\
118 #aclass)
119
120/*---------------------------------------------------------------------------*/
121/*---------------------------------------------------------------------------*/
122
123} // End namespace Arcane::properties
124
125/*---------------------------------------------------------------------------*/
126/*---------------------------------------------------------------------------*/
127
128#endif
129
Interface d'un visiteur sur une propriété.
Definition Property.h:187
Classe de base d'un visiteur typé sur une propriété.
Definition Property.h:201