GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ami_stream.h File Reference
#include <grass/config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <cstring>
#include <iostream>
#include <grass/gis.h>
#include "mm.h"
Include dependency graph for ami_stream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  UntypedStream
 
class  AMI_STREAM< T >
 

Macros

#define MAX_STREAMS_OPEN   200
 
#define DEBUG_DELETE   if(0)
 
#define DEBUG_STREAM_LEN   if(0)
 
#define DEBUG_ASSERT   if(0)
 
#define STREAM_TMPDIR   "STREAM_DIR"
 
#define BASE_NAME   "STREAM"
 
#define STREAM_BUFFER_SIZE   (1<<18)
 

Enumerations

enum  AMI_err {
  AMI_ERROR_NO_ERROR = 0, AMI_ERROR_IO_ERROR, AMI_ERROR_END_OF_STREAM, AMI_ERROR_OUT_OF_RANGE,
  AMI_ERROR_READ_ONLY, AMI_ERROR_OS_ERROR, AMI_ERROR_MM_ERROR, AMI_ERROR_OBJECT_INITIALIZATION,
  AMI_ERROR_PERMISSION_DENIED, AMI_ERROR_INSUFFICIENT_MAIN_MEMORY, AMI_ERROR_INSUFFICIENT_AVAILABLE_STREAMS, AMI_ERROR_ENV_UNDEFINED,
  AMI_ERROR_NO_MAIN_MEMORY_OPERATION
}
 
enum  AMI_stream_type {
  AMI_READ_STREAM = 1, AMI_WRITE_STREAM, AMI_APPEND_STREAM, AMI_READ_WRITE_STREAM,
  AMI_APPEND_WRITE_STREAM
}
 
enum  persistence { PERSIST_DELETE = 0, PERSIST_PERSISTENT, PERSIST_READ_ONCE }
 

Functions

int ami_single_temp_name (const std::string &base, char *tmp_path)
 
FILE * open_stream (int fd, AMI_stream_type st)
 
FILE * open_stream (char *pathname, AMI_stream_type st)
 

Variables

const char * ami_str_error []
 

Macro Definition Documentation

#define BASE_NAME   "STREAM"

Definition at line 78 of file ami_stream.h.

Referenced by AMI_STREAM< T >::AMI_STREAM().

#define DEBUG_DELETE   if(0)

Definition at line 69 of file ami_stream.h.

Referenced by AMI_STREAM< T >::~AMI_STREAM().

#define DEBUG_STREAM_LEN   if(0)

Definition at line 70 of file ami_stream.h.

Referenced by AMI_STREAM< T >::stream_len().

#define MAX_STREAMS_OPEN   200

Definition at line 65 of file ami_stream.h.

Referenced by em_pqueue< T, Key >::em_pqueue(), and singleMerge().

#define STREAM_BUFFER_SIZE   (1<<18)
#define STREAM_TMPDIR   "STREAM_DIR"

Definition at line 75 of file ami_stream.h.

Referenced by ami_single_temp_name().

Enumeration Type Documentation

enum AMI_err
Enumerator
AMI_ERROR_NO_ERROR 
AMI_ERROR_IO_ERROR 
AMI_ERROR_END_OF_STREAM 
AMI_ERROR_OUT_OF_RANGE 
AMI_ERROR_READ_ONLY 
AMI_ERROR_OS_ERROR 
AMI_ERROR_MM_ERROR 
AMI_ERROR_OBJECT_INITIALIZATION 
AMI_ERROR_PERMISSION_DENIED 
AMI_ERROR_INSUFFICIENT_MAIN_MEMORY 
AMI_ERROR_INSUFFICIENT_AVAILABLE_STREAMS 
AMI_ERROR_ENV_UNDEFINED 
AMI_ERROR_NO_MAIN_MEMORY_OPERATION 

Definition at line 86 of file ami_stream.h.

Enumerator
AMI_READ_STREAM 
AMI_WRITE_STREAM 
AMI_APPEND_STREAM 
AMI_READ_WRITE_STREAM 
AMI_APPEND_WRITE_STREAM 

Definition at line 107 of file ami_stream.h.

Enumerator
PERSIST_DELETE 
PERSIST_PERSISTENT 
PERSIST_READ_ONCE 

Definition at line 118 of file ami_stream.h.

Function Documentation

int ami_single_temp_name ( const std::string &  base,
char *  tmp_path 
)

Definition at line 74 of file ami_stream.cpp.

References fd, G_mkstemp(), getenv(), and STREAM_TMPDIR.

Referenced by AMI_STREAM< T >::AMI_STREAM().

FILE* open_stream ( int  fd,
AMI_stream_type  st 
)
FILE* open_stream ( char *  pathname,
AMI_stream_type  st 
)

Variable Documentation

const char* ami_str_error[]

Definition at line 54 of file ami_stream.cpp.