mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-01-03 10:06:01 +01:00
Move the polymorphism description
This commit is contained in:
parent
c6b628e583
commit
bc89fdebb0
@ -600,7 +600,7 @@ def string_of_error(return_code: int) -> str:
|
||||
Then the corresponding back-end ~has/read/write~ functions has to be implemented. For example, see the commented
|
||||
lines that correspond to the ~TREXIO_JSON~ back end (not implemented yet).
|
||||
|
||||
_Note_: It is important to increment the value of ~TREXIO_INVALID_BACK_END~ when a new back end is added. Otherwise, it will not be available.
|
||||
_Note_: It is important to increment the value of ~TREXIO_INVALID_BACK_END~ when a new back end is implemented. Otherwise, it will not be available.
|
||||
|
||||
*** C
|
||||
|
||||
@ -852,20 +852,6 @@ class File:
|
||||
pass
|
||||
#+end_src
|
||||
|
||||
** TODO (Remove) : Polymorphism of the file handle
|
||||
|
||||
Polymorphism of the ~trexio_t~ type is handled by ensuring that the
|
||||
corresponding types for all back ends can be safely casted to
|
||||
~trexio_t~. This is done by making the back-end structs start with
|
||||
~struct trexio_s~:
|
||||
|
||||
#+begin_src c
|
||||
struct trexio_back_end_s {
|
||||
trexio_t parent ;
|
||||
/* add below specific back-end data */
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** File opening
|
||||
|
||||
~trexio_open~ creates a new TREXIO file or opens the existing one.
|
||||
|
@ -60,6 +60,11 @@
|
||||
|
||||
* Template for HDF5 structures
|
||||
|
||||
Polymorphism of the ~trexio_t~ type is handled by ensuring that the
|
||||
corresponding types for all back ends can be safely casted to
|
||||
~trexio_t~. This is done by making the back-end structs start with
|
||||
~trexio_t parent~ attribute:
|
||||
|
||||
#+begin_src c :tangle struct_hdf5.h
|
||||
typedef struct trexio_hdf5_s {
|
||||
trexio_t parent ;
|
||||
|
Loading…
Reference in New Issue
Block a user