TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Objet_U_With_Params.h
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Objet_U_With_Params_included
17#define Objet_U_With_Params_included
18
19#include <Objet_U.h>
20class Param;
21
22
23/*! @brief Inherits from Objet_U, adds the very common method set_param for the Objet_U hierarchy
24 *
25 * All classes introducing new keywords/parameters must inherit from this class and not Objet_U.
26 * The goal is to promote the use of param.ajouter and move toward a more consistent grammar
27 * for TRUST datasets.
28 *
29 * readOn cannot be overriden when inheriting from this class.
30 *
31 * Method set_param can be overriden to register params with param.ajouter
32 *
33 * Method validate_params is provided for override if complex attribute validation is needed
34 * It is called right after reading the params, and should not modify the objects.
35 *
36 *
37 * Classes inheriting from Objet_U_With_Params must use one of the macros:
38 * Declare_base_with_param or Declare_instanciable_with_param.
39 * They do not declare the readOn function, which is not possible when deriving from this class.
40 *
41 *
42 */
44{
45 Declare_base_with_param(Objet_U_With_Params);
46protected:
47 Entree& readOn(Entree&) override final;
48
49 /*! @brief Called in the readOn of Objet_U_With_Params, after reading the params
50 *
51 * Should check the coherence and validity of the params, throwing/exiting accordingly
52 * At this point, we are still const.
53 *
54 */
55 virtual void validate_params() const {};
56
57private:
58 virtual Entree& __readOn_Impl_DO_NOT_OVERRIDE_UNLESS_THE_WORLD_IS_ENDING(Entree&);
59};
60
61#endif /* Objet_U_With_Params_included */
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Inherits from Objet_U, adds the very common method set_param for the Objet_U hierarchy.
virtual void validate_params() const
Called in the readOn of Objet_U_With_Params, after reading the params.
Entree & readOn(Entree &) override final
Reading of the input stream (dataset) with the helper class Param.
friend class Entree
Definition Objet_U.h:76
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112