TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Cast.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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 <Cast.h>
17//#include <assert.h>
18#include <Type_info.h>
19#include <Process.h>
20#include <Nom.h>
21
22#include <iostream>
23using std::cerr;
24using std::endl;
25using std::flush;
26
27int* bad_ref_cast(const Type_info* t1, const Type_info* t2)
28{
29 cerr << "Type error during a ref_cast instruction !" << endl;
30 cerr << "The class " << t2->name() << " is not a subclass of " << t1->name() << endl;
31 if ((Nom)t2->name()=="Deriv")
32 {
33 cerr << "It seems somewhere in the code ref_cast(" << t1->name() << ",object)" << endl;
34 cerr << "is used with object being an instance of a generic class (Deriv)." << endl;
35 cerr << "It should be written ref_cast(" << t1->name() << ",object.valeur())" << endl;
36 cerr << "Check your code, or contact TRUST support." << endl;
37 }
38 cerr << flush;
40 return 0;
41}
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
modelise une information de type pour les Objet_U
Definition Type_info.h:30
const Nom & name() const
Definition Type_info.h:36