TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
TRUST_Deriv.cpp
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#include <TRUST_Deriv.h>
17
18Implemente_instanciable_sans_constructeur_ni_destructeur(TRUST_Deriv_Objet_U, "TRUST_Deriv_Objet_U", Objet_U_ptr);
19
21
23
24TRUST_Deriv_Objet_U::~TRUST_Deriv_Objet_U() { detach(); }
25
27
29{
30 if (t) recopie(t.valeur());
31}
32
34{
35 recopie(t);
36}
37
39{
40 detach();
41 recopie(t);
42 return *this;
43}
44
46{
47 detach();
48 if (t) recopie(t.valeur());
49 else set_Objet_U_ptr(nullptr);
50 return *this;
51}
52
54{
55 const Type_info *type_info = Objet_U::info();
56 return *type_info; /* base type accepted by the reference */
57}
58
60{
62 if (objet) pointeur_ = (Objet_U*) objet;
63 else pointeur_ = nullptr;
64}
65
67{
68 detach();
69 Objet_U& objet = deriv_obj.valeur();
70 set_Objet_U_ptr(&objet);
71 deriv_obj.set_Objet_U_ptr(nullptr);
72}
73
75{
76 return valeur().reprendre(is);
77}
78
80{
81 return valeur().sauvegarder(os);
82}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Pointer to an Objet_U.
Definition Objet_U_ptr.h:31
virtual void set_Objet_U_ptr(Objet_U *)
Makes *this point to the object *ptr. The address may be null (null pointer).
void recopie(const Objet_U &)
Duplicates the Objet_U obj and then changes the pointer to this copy.
Objet_U_ptr(const Objet_U_ptr &)=delete
friend class Entree
Definition Objet_U.h:71
static const Type_info * info()
Returns type information for the Objet_U (static version).
Definition Objet_U.cpp:136
friend class Sortie
Definition Objet_U.h:70
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
virtual int reprendre(Entree &)
Restores an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:336
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
virtual int sauvegarder(Sortie &) const
Saves an Objet_U to an output stream. Virtual method to override.
Definition Objet_U.cpp:350
Base class for output streams.
Definition Sortie.h:52
Class TRUST_Deriv_Objet_U is almost identical to TRUST_Deriv<Objet_U>, except that it does not contai...
int sauvegarder(Sortie &os) const override
Saves an Objet_U to an output stream. Virtual method to override.
int reprendre(Entree &is) override
Restores an Objet_U from an input stream. Virtual method to override.
const Type_info & get_info_ptr() const override
const Objet_U & valeur() const
const TRUST_Deriv_Objet_U & operator=(const Objet_U &t)
void deplace(TRUST_Deriv_Objet_U &deriv_obj)
void set_Objet_U_ptr(Objet_U *objet) override
Makes *this point to the object *ptr. The address may be null (null pointer).
Models type information for Objet_U objects.
Definition Type_info.h:30