SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Data Fields
SprDT_ET Class Reference

A base type. More...

+ Inheritance diagram for SprDT_ET:
+ Collaboration diagram for SprDT_ET:

Public Member Functions

virtual int read1 (const SprDT *restrict dt, SprStream *restrict fd, void *restrict dst)
 
virtual ssize_t readN (const SprDT *restrict dt, SprStream *restrict fd, void *restrict dst, size_t Nel)
 
virtual ssize_t readNi (const SprDT *restrict dt, SprStream *restrict fd, void *restrict dst, size_t Nel, size_t offs_next)
 
virtual int write1 (const SprDT *restrict dt, SprStream *restrict fd, const void *restrict src)
 
virtual int writeN (const SprDT *restrict dt, SprStream *restrict fd, const void *restrict src, size_t Nel)
 
virtual int writeNi (const SprDT *restrict dt, SprStream *restrict fd, const void *restrict src, size_t Nel, size_t offs_next)
 
virtual ssize_t skipN (const SprDT *restrict dt, SprStream *restrict fd, size_t Nel)
 
virtual SprDTRead1Func get_read1_func (const SprDT *dt, const SprStream *fd)
 
virtual SprDTReadNFunc get_readN_func (const SprDT *dt, const SprStream *fd)
 
virtual SprDTReadNiFunc get_readNi_func (const SprDT *dt, const SprStream *fd)
 
virtual SprDTWrite1Func get_write1_func (const SprDT *dt, const SprStream *fd)
 
virtual SprDTWriteNFunc get_writeN_func (const SprDT *dt, const SprStream *fd)
 
virtual SprDTWriteNiFunc get_writeNi_func (const SprDT *dt, const SprStream *fd)
 
virtual SprDTSkipNFunc get_skipN_func (const SprDT *dt, const SprStream *fd)
 
- Public Member Functions inherited from SprDT
virtual char * str_cvt (const SprDT *restrict dt, void *restrict dst, const char *restrict str)
 
virtual void * cpy (const SprDT *dt, void *dst, const void *src)
 
virtual void free (const SprDT *restrict dt, void *restrict ptr)
 
virtual SprDynStr str (const SprDT *restrict dt, const void *restrict src)
 
virtual ssize_t print (const SprDT *restrict dt, SprStream *restrict fd, const void *restrict src)
 
virtual void * cvt1 (const SprDT *dt_dst, void *restrict dst, const SprDT *dt_src, const void *restrict src)
 
virtual void * cvtN (const SprDT *dt_dst, void *restrict dst, const SprDT *dt_src, const void *restrict src, size_t Nel)
 
virtual void * cvtNsi (const SprDT *dt_dst, void *restrict dst, const SprDT *dt_src, const void *restrict src, size_t Nel, size_t offs_src_next)
 
virtual void * cvtNdi (const SprDT *dt_dst, void *restrict dst, const SprDT *dt_src, const void *restrict src, size_t Nel, size_t offs_dst_next)
 
virtual void * cvtNsdi (const SprDT *dt_dst, void *restrict dst, const SprDT *dt_src, const void *restrict src, size_t Nel, size_t offs_src_next, size_t offs_dst_next)
 
virtual SprDTCvt1Func get_cvt1_func (const SprDT *dt_dst, const SprDT *dt_src, SprDTCvtAux **aux_data)
 
virtual SprDTCvtNFunc get_cvtN_func (const SprDT *dt_dst, const SprDT *dt_src, SprDTCvtAux **aux_data)
 
virtual SprDTCvtNsiFunc get_cvtNsi_func (const SprDT *dt_dst, const SprDT *dt_src, SprDTCvtAux **aux_data)
 
virtual SprDTCvtNsiFunc get_cvtNdi_func (const SprDT *dt_dst, const SprDT *dt_src, SprDTCvtAux **aux_data)
 
virtual SprDTCvtNsdiFunc get_cvtNsdi_func (const SprDT *dt_dst, const SprDT *dt_src, SprDTCvtAux **aux_data)
 
virtual void reserve_dt (SprDT *restrict dt)
 
virtual void release_dt (SprDT *restrict dt)
 

Data Fields

base::< SprDTinterface_
 
- Data Fields inherited from SprDT
base::< SprObjectinterface_
 
int dsize
 
unsigned int dalign
 
int dsize_packed
 

Additional Inherited Members

- Protected Attributes inherited from SprDT
unsigned int flags
 
const char * desc_str
 

Detailed Description

A base type.

Member Function Documentation

virtual int SprDT_ET::read1 ( const SprDT *restrict  dt,
SprStream *restrict  fd,
void *restrict  dst 
)
virtual

Read a single data element from the given stream fd. The binary data is written to dst. It is the callers responsability to assure that dst is large enough to contain the whole data element.

Returns
(-1) on error and 0 on success.
Note
When the read fails, a simple check of fd->eof allows the caller to distinguish between read errors and an end-of-file condition. An additional check if fd->buf_rptr equals fd->buf_end allows the caller to check for partial data when encountering an error or an end-of-file condition.

Reimplemented from SprDT.

virtual ssize_t SprDT_ET::readN ( const SprDT *restrict  dt,
SprStream *restrict  fd,
void *restrict  dst,
size_t  Nel 
)
virtual

Read Nel data elements from the given stream fd. The binary data is written to dst. It is the callers responsability to assure that dst is large enough to contain all Nel data elements.

Returns
0 if all requested elements were read successfully and the number of elements short of Nel otherwise.
Note
When not all elements were read, a simple check of fd->eof allows the caller to distinguish between read errors and an end-of-file condition. An additional check if fd->buf_rptr equals fd->buf_end allows the caller to check for partial data when encountering an error or an end-of-file condition.

Reimplemented from SprDT.

virtual ssize_t SprDT_ET::readNi ( const SprDT *restrict  dt,
SprStream *restrict  fd,
void *restrict  dst,
size_t  Nel,
size_t  offs_next 
)
virtual

Read Nel data elements from the given stream fd. The binary data is written to dst in an interleaved fashion, i.e. the 2nd elements is written to (char*)dst+<offs_next) and so on. It is the callers responsability to assure that dst is large enough to contain all Nel data elements.

Returns
0 if all requested elements were read successfully and the number of elements short of Nel otherwise.
Note
When not all elements were read, a simple check of fd->eof allows the caller to distinguish between read errors and an end-of-file condition. An additional check if fd->buf_rptr equals fd->buf_end allows the caller to check for partial data when encountering an error or an end-of-file condition.

Reimplemented from SprDT.

virtual int SprDT_ET::write1 ( const SprDT *restrict  dt,
SprStream *restrict  fd,
const void *restrict  src 
)
virtual

Write a single data element of which the binary data can be found at address src to the given stream fd.

Returns
(-1) on error and 0 on success.

Reimplemented from SprDT.

virtual int SprDT_ET::writeN ( const SprDT *restrict  dt,
SprStream *restrict  fd,
const void *restrict  src,
size_t  Nel 
)
virtual

Write the Nel data elements located at address src and upwards to the given stream fd.

Returns
0 if all requested elements were written successfully and -1 otherwise.

Reimplemented from SprDT.

virtual int SprDT_ET::writeNi ( const SprDT *restrict  dt,
SprStream *restrict  fd,
const void *restrict  src,
size_t  Nel,
size_t  offs_next 
)
virtual

Write the Nel data elements located at address src and upwards to the given stream fd. The source elements are stored in an interleaved fashion in memory, i.e. the 2nd elements is located at (char*)src+<offs_next) and so on.

Returns
0 if all requested elements were written successfully and -1 otherwise.

Reimplemented from SprDT.

virtual ssize_t SprDT_ET::skipN ( const SprDT *restrict  dt,
SprStream *restrict  fd,
size_t  Nel 
)
virtual

Skip Nel elements in the input stream fd.

Returns
0 if all requested elements were skipped successfully, the number of elements short of Nel when encountering an EOF, and (-1) on encountering an error (even if some elements were skipped).

Reimplemented from SprDT.

virtual SprDTRead1Func SprDT_ET::get_read1_func ( const SprDT dt,
const SprStream fd 
)
virtual

Find a function to read a single data element of the type dt from the stream fd. This function behaves identically to the SprDT::read1() method, but is typically faster since the mode of the stream (BIN, BINSWAP, ASCII) is known in advance.

Returns
The requested function pointer.

Reimplemented from SprDT.

virtual SprDTReadNFunc SprDT_ET::get_readN_func ( const SprDT dt,
const SprStream fd 
)
virtual

Find a function to read N data element of the type dt from the stream fd. This function behaves identically to the SprDT::readN() method, but is typically faster since the mode of the stream (BIN, BINSWAP, ASCII) is known in advance.

Returns
The requested function pointer.

Reimplemented from SprDT.

virtual SprDTReadNiFunc SprDT_ET::get_readNi_func ( const SprDT dt,
const SprStream fd 
)
virtual

Find a function to read N data element of the type dt from the stream fd in an interleaved fashion. This function behaves identically to the SprDT::readNi() method, but is typically faster since the mode of the stream (BIN, BINSWAP, ASCII) is known in advance.

Returns
The requested function pointer.

Reimplemented from SprDT.

virtual SprDTWrite1Func SprDT_ET::get_write1_func ( const SprDT dt,
const SprStream fd 
)
virtual

Find a function to write a single data element of the type dt to the stream fd. This function behaves identically to the SprDT::write1() method, but is typically faster since the mode of the stream (BIN, BINSWAP, ASCII) is known in advance.

Returns
The requested function pointer.

Reimplemented from SprDT.

virtual SprDTWriteNFunc SprDT_ET::get_writeN_func ( const SprDT dt,
const SprStream fd 
)
virtual

Find a function to write N data element of the type dt to the stream fd. This function behaves identically to the SprDT::writeN() method, but is typically faster since the mode of the stream (BIN, BINSWAP, ASCII) is known in advance.

Returns
The requested function pointer.

Reimplemented from SprDT.

virtual SprDTWriteNiFunc SprDT_ET::get_writeNi_func ( const SprDT dt,
const SprStream fd 
)
virtual

Find a function to write N data element of the type dt to the stream fd in an interleaved fashion. This function behaves identically to the SprDT::writeNi() method, but is typically faster since the mode of the stream (BIN, BINSWAP, ASCII) is known in advance.

Returns
The requested function pointer.

Reimplemented from SprDT.

virtual SprDTSkipNFunc SprDT_ET::get_skipN_func ( const SprDT dt,
const SprStream fd 
)
virtual

Find a function to skip N data element of the type dt in the stream fd. This function behaves identically to the SprDT::skipN() method, but is typically faster since the mode of the stream (BIN, BINSWAP, ASCII) is known in advance.

Returns
The requested function pointer.

Reimplemented from SprDT.

Field Documentation

base::<SprDT> SprDT_ET::interface_