TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
EChaineJDD Class Reference

Same as EChaine except here the input string comes from a datafile. Keeps a track of the lines that have been read in the datafile so far, so in case of a TRUST crash, we can get the line in the datafile where the error occured. More...

#include <EChaineJDD.h>

Inheritance diagram for EChaineJDD:
[legend]
Collaboration diagram for EChaineJDD:
[legend]

Public Member Functions

 EChaineJDD ()
 EChaineJDD (const char *str)
 ~EChaineJDD () override
void init (const char *str)
Entreeoperator>> (int &ob) override
Entreeoperator>> (double &ob) override
int get (char *ob, std::streamsize bufsize) override
 Lecture d'une chaine dans ostream_ bufsize est la taille du buffer alloue pour ob (y compris.
void set_track_lines (bool b)
Entreeoperator>> (Entree &(*f)(Entree &))
Entreeoperator>> (istream &(*f)(istream &))
Entreeoperator>> (ios &(*f)(ios &))
template<typename T>
Entreeoperator>> (const TRUST_Ref< T > &)
Entreeoperator>> (const TRUST_Ref_Objet_U &)
virtual Entreeoperator>> (long &ob)
virtual Entreeoperator>> (long long &ob)
virtual Entreeoperator>> (float &ob)
virtual Entreeoperator>> (std::string &ob)
virtual Entreeoperator>> (Objet_U &ob) final
virtual int get (int *ob, std::streamsize n)
virtual int get (long *ob, std::streamsize n)
virtual int get (long long *ob, std::streamsize n)
virtual int get (float *ob, std::streamsize n)
virtual int get (double *ob, std::streamsize n)
Public Member Functions inherited from Entree
 Entree ()
 Entree (istream &is)
 Entree (const Entree &is)
virtual ~Entree ()
void set_bin (bool bin) override
 Change le mode d'ecriture du fichier.
Entreeoperator= (istream &is)
Entreeoperator= (Entree &is)
virtual istream & get_istream ()
virtual const istream & get_istream () const
void set_istream (istream *is)
Entreeoperator>> (Entree &(*f)(Entree &))
Entreeoperator>> (istream &(*f)(istream &))
Entreeoperator>> (ios &(*f)(ios &))
template<typename T>
Entreeoperator>> (const TRUST_Ref< T > &)
Entreeoperator>> (const TRUST_Ref_Objet_U &)
virtual int eof ()
virtual int jumpOfLines ()
virtual int fail ()
virtual int good ()
virtual void set_check_types (bool flag)
 indique si le stream doit verifier les types des objets lus (ints et nombres flottants).
bool check_types () const
virtual void set_error_action (Error_Action)
 Change le comportement en cas d'erreur de l'entree, voir error_handle_() et get_error_action().
Error_Action get_error_action ()
 renvoie error_action_ pour cette entree (permet de la modifier et de restaurer ensuite la valeur anterieure)
 operator istream & ()
istream & putback (char ch)
bool get_diffuse ()
virtual void set_diffuse (bool diffuse)
 ToDo TMA : commenter.
Public Member Functions inherited from AbstractIO
bool is_64b () const
virtual void set_64b (bool is_64b)
bool is_bin ()
void set_avoid_conversion (bool avoid)
bool avoid_conversion ()

Static Public Attributes

static int file_cur_line_ = 1

Protected Member Functions

template<typename _TYPE_>
Entreeoperator_template (_TYPE_ &ob)
Protected Member Functions inherited from Entree
int error_handle (int fail_flag)
virtual int error_handle_ (int fail_flag)
 Cette fonction est appellee par operateur>>, get, get_nom ouvrir, fermer, lire, etc.
Protected Member Functions inherited from AbstractIO
 AbstractIO ()
virtual ~AbstractIO ()
template<typename _TYPE_>
bool must_convert () const
 Whether to convert an int into a long when reading/writing out data.

Protected Attributes

istringstream * istrstream_
bool track_lines_ = true
Protected Attributes inherited from Entree
bool check_types_ = false
Error_Action error_action_
bool diffuse_
Protected Attributes inherited from AbstractIO
bool bin_ = false
 Is this a binary flux?
bool is_64b_
 Will we be reading/writing in 64b? (Init in ctor to avoid including arch.h probably).
bool avoid_conversion_ = false

Additional Inherited Members

Public Types inherited from Entree
enum  Error_Action { ERROR_EXIT , ERROR_CONTINUE , ERROR_EXCEPTION }

Detailed Description

Same as EChaine except here the input string comes from a datafile. Keeps a track of the lines that have been read in the datafile so far, so in case of a TRUST crash, we can get the line in the datafile where the error occured.

Definition at line 28 of file EChaineJDD.h.

Constructor & Destructor Documentation

◆ EChaineJDD() [1/2]

EChaineJDD::EChaineJDD ( )

Definition at line 20 of file EChaineJDD.cpp.

◆ EChaineJDD() [2/2]

EChaineJDD::EChaineJDD ( const char * str)

Definition at line 26 of file EChaineJDD.cpp.

◆ ~EChaineJDD()

EChaineJDD::~EChaineJDD ( )
override

Definition at line 33 of file EChaineJDD.cpp.

Member Function Documentation

◆ get() [1/6]

int EChaineJDD::get ( char * ob,
std::streamsize bufsize )
overridevirtual

Lecture d'une chaine dans ostream_ bufsize est la taille du buffer alloue pour ob (y compris.

le caractere 0 final). La chaine contient toujours un 0 meme en cas d'echec. La methode renvoie 1 si la lecture est bonne, 0 sinon. Si le buffer est trop petit, pour l'instant on fait exit() mais par la suite on pourra tester: si strlen(ob)==bufsize-1, alors refaire lire() jusqu'a arriver au bout. Si le lire() suivant renvoie une chaine de longueur nulle, cela signifie que la taille de la chaine etait exactement bufsize-1. Attention: le comportement est different en binaire et en ascii. En binaire, on lit la chaine jusqu'au prochain '\0'. En ascii, on lit la chaine jusqu'au prochain separateur (espace, tab, fin ligne)

Reimplemented from Entree.

Definition at line 46 of file EChaineJDD.cpp.

◆ get() [2/6]

int Entree::get ( double * ob,
std::streamsize n )
virtual

Reimplemented from Entree.

Definition at line 83 of file Entree.cpp.

◆ get() [3/6]

int Entree::get ( float * ob,
std::streamsize n )
virtual

Reimplemented from Entree.

Definition at line 82 of file Entree.cpp.

◆ get() [4/6]

int Entree::get ( int * ob,
std::streamsize n )
virtual

Reimplemented from Entree.

Definition at line 79 of file Entree.cpp.

◆ get() [5/6]

int Entree::get ( long * ob,
std::streamsize n )
virtual

Reimplemented from Entree.

Definition at line 80 of file Entree.cpp.

◆ get() [6/6]

int Entree::get ( long long * ob,
std::streamsize n )
virtual

Reimplemented from Entree.

Definition at line 81 of file Entree.cpp.

◆ init()

void EChaineJDD::init ( const char * str)

Definition at line 35 of file EChaineJDD.cpp.

◆ operator>>() [1/12]

template<typename T>
Entree & Entree::operator>> ( const TRUST_Ref< T > & )
inline

Definition at line 65 of file Entree.h.

◆ operator>>() [2/12]

Entree & Entree::operator>> ( const TRUST_Ref_Objet_U & )
inline

Definition at line 67 of file Entree.h.

◆ operator>>() [3/12]

Entree & EChaineJDD::operator>> ( double & ob)
overridevirtual

Reimplemented from Entree.

Definition at line 44 of file EChaineJDD.cpp.

◆ operator>>() [4/12]

Entree & Entree::operator>> ( Entree &(* )(Entree &))

Definition at line 60 of file Entree.cpp.

◆ operator>>() [5/12]

Entree & Entree::operator>> ( float & ob)
virtual

Reimplemented from Entree.

Definition at line 72 of file Entree.cpp.

◆ operator>>() [6/12]

Entree & EChaineJDD::operator>> ( int & ob)
overridevirtual

Reimplemented from Entree.

Definition at line 43 of file EChaineJDD.cpp.

◆ operator>>() [7/12]

Entree & Entree::operator>> ( ios &(* )(ios &))

Definition at line 62 of file Entree.cpp.

◆ operator>>() [8/12]

Entree & Entree::operator>> ( istream &(* )(istream &))

Definition at line 61 of file Entree.cpp.

◆ operator>>() [9/12]

Entree & Entree::operator>> ( long & ob)
virtual

Reimplemented from Entree.

Definition at line 70 of file Entree.cpp.

◆ operator>>() [10/12]

Entree & Entree::operator>> ( long long & ob)
virtual

Reimplemented from Entree.

Definition at line 71 of file Entree.cpp.

◆ operator>>() [11/12]

Entree & Entree::operator>> ( Objet_U & ob)
finalvirtual

Reimplemented from Entree.

Definition at line 77 of file Entree.cpp.

◆ operator>>() [12/12]

Entree & Entree::operator>> ( std::string & ob)
virtual

Reimplemented from Entree.

Definition at line 74 of file Entree.cpp.

◆ operator_template()

template<typename _TYPE_>
Entree & EChaineJDD::operator_template ( _TYPE_ & ob)
protected

Definition at line 57 of file EChaineJDD.h.

◆ set_track_lines()

void EChaineJDD::set_track_lines ( bool b)
inline

Definition at line 43 of file EChaineJDD.h.

Member Data Documentation

◆ file_cur_line_

int EChaineJDD::file_cur_line_ = 1
static

Definition at line 45 of file EChaineJDD.h.

◆ istrstream_

istringstream* EChaineJDD::istrstream_
protected

Definition at line 48 of file EChaineJDD.h.

◆ track_lines_

bool EChaineJDD::track_lines_ = true
protected

Definition at line 49 of file EChaineJDD.h.


The documentation for this class was generated from the following files:
  • /home/docs/checkouts/readthedocs.org/user_builds/cea-trust-platform/checkouts/v1.9.8/src/Kernel/Utilitaires/EChaineJDD.h
  • /home/docs/checkouts/readthedocs.org/user_builds/cea-trust-platform/checkouts/v1.9.8/src/Kernel/Utilitaires/EChaineJDD.cpp