GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-535c39c9fc
AMI_STREAM< T > Class Template Reference

#include <ami_stream.h>

Inheritance diagram for AMI_STREAM< T >:
Collaboration diagram for AMI_STREAM< T >:

Public Member Functions

 AMI_STREAM ()
 
 AMI_STREAM (const char *path_name, AMI_stream_type st=AMI_READ_WRITE_STREAM)
 
AMI_err new_substream (AMI_stream_type st, off_t sub_begin, off_t sub_end, AMI_STREAM< T > **sub_stream)
 
 ~AMI_STREAM (void)
 
AMI_err read_item (T **elt)
 
AMI_err write_item (const T &elt)
 
AMI_err read_array (T *data, off_t len, off_t *lenp=NULL)
 
AMI_err write_array (const T *data, off_t len)
 
off_t stream_len (void)
 
AMI_err name (char **stream_name)
 
const char * name () const
 
AMI_err seek (off_t offset)
 
void persist (persistence p)
 
char * sprint ()
 
int eof ()
 

Static Public Member Functions

static AMI_err main_memory_usage (size_t *usage, MM_stream_usage usage_type=MM_STREAM_USAGE_OVERHEAD)
 
- Static Public Member Functions inherited from UntypedStream
static unsigned int get_block_length ()
 

Protected Attributes

read_tmp
 
- Protected Attributes inherited from UntypedStream
FILE * fp
 
int fildes
 
AMI_stream_type access_mode
 
char path [BUFSIZ]
 
persistence per
 
unsigned int substream_level
 
off_t logical_bos
 
off_t logical_eos
 
char * buf
 
int eof_reached
 

Detailed Description

template<class T>
class AMI_STREAM< T >

Definition at line 153 of file ami_stream.h.

Constructor & Destructor Documentation

◆ AMI_STREAM() [1/2]

◆ AMI_STREAM() [2/2]

template<class T >
AMI_STREAM< T >::AMI_STREAM ( const char *  path_name,
AMI_stream_type  st = AMI_READ_WRITE_STREAM 
)

◆ ~AMI_STREAM()

template<class T >
AMI_STREAM< T >::~AMI_STREAM ( void  )

Definition at line 500 of file ami_stream.h.

References assert, DEBUG_ASSERT, DEBUG_DELETE, and PERSIST_PERSISTENT.

Member Function Documentation

◆ eof()

template<class T >
int AMI_STREAM< T >::eof

Definition at line 662 of file ami_stream.h.

◆ main_memory_usage()

template<class T >
AMI_err AMI_STREAM< T >::main_memory_usage ( size_t *  usage,
MM_stream_usage  usage_type = MM_STREAM_USAGE_OVERHEAD 
)
static

Definition at line 477 of file ami_stream.h.

◆ name() [1/2]

template<class T >
const char * AMI_STREAM< T >::name

Definition at line 437 of file ami_stream.h.

◆ name() [2/2]

template<class T >
AMI_err AMI_STREAM< T >::name ( char **  stream_name)

Definition at line 426 of file ami_stream.h.

References AMI_ERROR_NO_ERROR, and strcpy.

◆ new_substream()

template<class T >
AMI_err AMI_STREAM< T >::new_substream ( AMI_stream_type  st,
off_t  sub_begin,
off_t  sub_end,
AMI_STREAM< T > **  sub_stream 
)

◆ persist()

template<class T >
void AMI_STREAM< T >::persist ( persistence  p)

Definition at line 639 of file ami_stream.h.

◆ read_array()

template<class T >
AMI_err AMI_STREAM< T >::read_array ( T *  data,
off_t  len,
off_t *  lenp = NULL 
)

Definition at line 554 of file ami_stream.h.

◆ read_item()

◆ seek()

◆ sprint()

template<class T >
char * AMI_STREAM< T >::sprint

Definition at line 652 of file ami_stream.h.

◆ stream_len()

template<class T >
off_t AMI_STREAM< T >::stream_len ( void  )

◆ write_array()

template<class T >
AMI_err AMI_STREAM< T >::write_array ( const T *  data,
off_t  len 
)

Definition at line 613 of file ami_stream.h.

◆ write_item()

template<class T >
AMI_err AMI_STREAM< T >::write_item ( const T &  elt)

Field Documentation

◆ read_tmp

template<class T >
T AMI_STREAM< T >::read_tmp
protected

Definition at line 156 of file ami_stream.h.


The documentation for this class was generated from the following file: