TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
IJK_Vector.h
1/****************************************************************************
2* Copyright (c) 2025, 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 IJK_Vector_included
17#define IJK_Vector_included
18
19#include <TRUST_Vector.h>
20#include <TRUSTTab.h>
21
22/*! @brief classe IJK_Vector
23 *
24 * - La classe template IJK_Vector derive de la classe template TRUST_Vector
25 *
26 * - Elle demande 2 template arguments
27 */
28template<template<typename, typename> class _TRUST_TABL_, typename _TYPE_, typename _TYPE_ARRAY_>
29class IJK_Vector: public TRUST_Vector<_TRUST_TABL_<_TYPE_, _TYPE_ARRAY_>>
30{
31protected:
32
33 inline unsigned taille_memoire() const override { throw; }
34
35 inline int duplique() const override
36 {
37 IJK_Vector *xxx = new IJK_Vector(*this);
38 if (!xxx) Process::exit("Not enough memory !");
39 return xxx->numero();
40 }
41
44
45public:
46 IJK_Vector() : TRUST_Vector<_TRUST_TABL_<_TYPE_, _TYPE_ARRAY_>>() { }
47 IJK_Vector(int i) : TRUST_Vector<_TRUST_TABL_<_TYPE_, _TYPE_ARRAY_>>(i) { }
48 IJK_Vector(const IJK_Vector& avect) : TRUST_Vector<_TRUST_TABL_<_TYPE_, _TYPE_ARRAY_>>(avect) { }
49
51 {
53 return *this;
54 }
55};
56
57#endif /* IJK_Vector_included */
Sortie & printOn(Sortie &s) const override
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition IJK_Vector.h:42
IJK_Vector(int i)
Definition IJK_Vector.h:47
IJK_Vector & operator=(const IJK_Vector &avect)
Definition IJK_Vector.h:50
IJK_Vector(const IJK_Vector &avect)
Definition IJK_Vector.h:48
int duplique() const override
Definition IJK_Vector.h:35
unsigned taille_memoire() const override
Definition IJK_Vector.h:33
Entree & readOn(Entree &s) override
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition IJK_Vector.h:43
friend class Entree
Definition Objet_U.h:76
int numero() const
Renvoie l'indice de l'objet dans Memoire::data.
Definition Objet_U.cpp:268
friend class Sortie
Definition Objet_U.h:75
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455