|
TrioCFD 1.9.9_beta
TrioCFD documentation
|
Class defining operators and methods for all reading operation in an input flow (file, keyboard communication buffer, etc.). More...
#include <Entree.h>
Public Types | |
| enum | Error_Action { ERROR_EXIT , ERROR_CONTINUE , ERROR_EXCEPTION } |
Public Member Functions | |
| Entree () | |
| Entree (istream &is) | |
| Entree (const Entree &is) | |
| virtual | ~Entree () |
| void | set_bin (bool bin) override |
| Changes the file write mode. | |
| Entree & | operator= (istream &is) |
| Entree & | operator= (Entree &is) |
| virtual istream & | get_istream () |
| virtual const istream & | get_istream () const |
| void | set_istream (istream *is) |
| Entree & | operator>> (Entree &(*f)(Entree &)) |
| Entree & | operator>> (istream &(*f)(istream &)) |
| Entree & | operator>> (ios &(*f)(ios &)) |
| template<typename T> | |
| Entree & | operator>> (const TRUST_Ref< T > &) |
| Entree & | operator>> (const TRUST_Ref_Objet_U &) |
| virtual Entree & | operator>> (int &ob) |
| virtual Entree & | operator>> (long &ob) |
| virtual Entree & | operator>> (long long &ob) |
| virtual Entree & | operator>> (float &ob) |
| virtual Entree & | operator>> (double &ob) |
| virtual Entree & | operator>> (std::string &ob) |
| virtual Entree & | operator>> (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) |
| virtual int | get (char *buf, std::streamsize bufsize) |
| Reads a string from ostream_. bufsize is the size of the buffer allocated for ob (including. | |
| virtual int | eof () |
| virtual int | jumpOfLines () |
| virtual int | fail () |
| virtual int | good () |
| virtual void | set_check_types (bool flag) |
| Indicates whether the stream should verify the types of read objects (ints and floating-point numbers). | |
| bool | check_types () const |
| virtual void | set_error_action (Error_Action) |
| Changes the error behaviour of the input; see error_handle_() and get_error_action(). | |
| Error_Action | get_error_action () |
| Returns error_action_ for this input (allows modifying it and restoring the previous value afterwards). | |
| operator istream & () | |
| istream & | putback (char ch) |
| bool | get_diffuse () |
| virtual void | set_diffuse (bool diffuse) |
| Sets the diffuse flag for this input stream. | |
| 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 () |
Protected Member Functions | |
| int | error_handle (int fail_flag) |
| virtual int | error_handle_ (int fail_flag) |
| This function is called by operator>>, 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 | |
| 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 |
Class defining operators and methods for all reading operation in an input flow (file, keyboard communication buffer, etc.).
| enum Entree::Error_Action |
| Entree::Entree | ( | ) |
Definition at line 24 of file Entree.cpp.
| Entree::Entree | ( | istream & | is | ) |
Definition at line 31 of file Entree.cpp.
| Entree::Entree | ( | const Entree & | is | ) |
Definition at line 36 of file Entree.cpp.
|
virtual |
Definition at line 277 of file Entree.cpp.
|
virtual |
Reimplemented in Entree_complete, Entree_Fichier_base, and Lec_Diffuse_base.
Definition at line 256 of file Entree.cpp.
|
protectedvirtual |
This function is called by operator>>, get, get_nom, ouvrir, fermer, lire, etc.
.. on failure (when fail() is set). It returns 0 if an error occurred (go through error_handle() which handles inline the case where there is no error), and 1 if there is no error. (for coding convenience, one writes "return error_handle(fail());" It can be configured to:
Definition at line 339 of file Entree.cpp.
|
virtual |
Reimplemented in Entree_complete, Entree_Fichier_base, and Lec_Diffuse_base.
Definition at line 263 of file Entree.cpp.
|
virtual |
Reads a string from ostream_. bufsize is the size of the buffer allocated for ob (including.
the final null character). The string always contains a null character even on failure. The method returns 1 if reading is successful, 0 otherwise. If the buffer is too small, we currently call exit(), but in the future we could test: if strlen(ob)==bufsize-1, then call lire() again until the end is reached. If the next lire() returns a string of length zero, it means the string length was exactly bufsize-1. Warning: the behaviour differs between binary and ASCII mode. In binary mode, the string is read until the next '\0'. In ASCII mode, the string is read until the next separator (space, tab, newline).
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 103 of file Entree.cpp.
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 219 of file Entree.cpp.
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 225 of file Entree.cpp.
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 222 of file Entree.cpp.
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 228 of file Entree.cpp.
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 231 of file Entree.cpp.
| Entree::Error_Action Entree::get_error_action | ( | ) |
Returns error_action_ for this input (allows modifying it and restoring the previous value afterwards).
Definition at line 371 of file Entree.cpp.
|
virtual |
Reimplemented in LecFicDiffuse.
Definition at line 41 of file Entree.cpp.
|
virtual |
Reimplemented in LecFicDiffuse.
Definition at line 46 of file Entree.cpp.
|
virtual |
Reimplemented in Entree_complete, Entree_Fichier_base, and Lec_Diffuse_base.
Definition at line 270 of file Entree.cpp.
|
virtual |
Definition at line 238 of file Entree.cpp.
Definition at line 80 of file Entree.cpp.
| Entree & Entree::operator= | ( | istream & | is | ) |
Definition at line 72 of file Entree.cpp.
|
inline |
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 216 of file Entree.cpp.
Definition at line 55 of file Entree.cpp.
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 224 of file Entree.cpp.
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 221 of file Entree.cpp.
| Entree & Entree::operator>> | ( | ios &(* | f )(ios &) | ) |
Definition at line 65 of file Entree.cpp.
| Entree & Entree::operator>> | ( | istream &(* | f )(istream &) | ) |
Definition at line 60 of file Entree.cpp.
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 227 of file Entree.cpp.
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 230 of file Entree.cpp.
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 236 of file Entree.cpp.
|
virtual |
Reimplemented in EChaineJDD, Entree_complete, and Lec_Diffuse_base.
Definition at line 234 of file Entree.cpp.
|
overridevirtual |
Changes the file write mode.
This method can be called at any time.
Reimplemented from AbstractIO.
Reimplemented in Entree_Brute, Entree_complete, and Lec_Diffuse_base.
Definition at line 291 of file Entree.cpp.
|
virtual |
Indicates whether the stream should verify the types of read objects (ints and floating-point numbers).
Example: the input contains 123.456 123.456 int i; check_types(0); is >> i; // i contains 123 check_types(1); is >> i; // Error: reads the string 123.456 and tries to convert it to int See operator>>(int &)
Reimplemented in Entree_complete, and Lec_Diffuse_base.
Definition at line 313 of file Entree.cpp.
|
virtual |
Sets the diffuse flag for this input stream.
This virtual method does nothing in the base class; see override in Lec_Diffuse_base.
| diffuse | Whether to diffuse data to other processes. |
Reimplemented in Lec_Diffuse_base.
Definition at line 409 of file Entree.cpp.
|
virtual |
Changes the error behaviour of the input; see error_handle_() and get_error_action().
Reimplemented in Entree_complete.
Definition at line 379 of file Entree.cpp.
| void Entree::set_istream | ( | istream * | is | ) |
Definition at line 50 of file Entree.cpp.
|
protected |