Public Member Functions | Protected Member Functions | Private Attributes | Related Functions | List of all members
vil_stream Class Referenceabstract

Stream interface for VIL image loaders. More...

#include <vil_stream.h>

Inheritance diagram for vil_stream:
Inheritance graph
[legend]

Public Member Functions

virtual bool ok () const =0
 Return false if the stream is broken. More...
 
virtual vil_streampos write (void const *buf, vil_streampos n)=0
 Write n bytes from buf. Returns number of bytes written. More...
 
virtual vil_streampos read (void *buf, vil_streampos n)=0
 Read n bytes into buf. Returns number of bytes read. More...
 
virtual vil_streampos tell () const =0
 Return file pointer. More...
 
virtual void seek (vil_streampos position)=0
 Goto file pointer. More...
 
virtual vil_streampos file_size () const =0
 Amount of data in the stream. More...
 
void ref ()
 up/down the reference count. More...
 
void unref ()
 

Protected Member Functions

 vil_stream ()
 
virtual ~vil_stream ()
 

Private Attributes

vcl_atomic_count refcount_
 

Related Functions

(Note that these are not member functions.)

vil_streamvil_open (char const *what, char const *how="r")
 make a vil_stream from a filename, an URL, etc. More...
 
float vil_stream_read_big_endian_float (vil_stream *is)
 Reads in a 4-byte big-endian float. More...
 
void vil_stream_read_big_endian_int_16 (vil_stream *is, vxl_uint_16 *data, unsigned n)
 Reads in n 16 bit unsigned ints. More...
 
void vil_stream_write_big_endian_uint_16 (vil_stream *, vxl_uint_16)
 
void vil_stream_write_little_endian_uint_16 (vil_stream *, vxl_uint_16)
 
void vil_stream_write_big_endian_uint_32 (vil_stream *, vxl_uint_32)
 
void vil_stream_write_little_endian_uint_32 (vil_stream *, vxl_uint_32)
 
void vil_stream_write_big_endian_int_32 (vil_stream *, vxl_int_32)
 
void vil_stream_write_little_endian_int_32 (vil_stream *, vxl_int_32)
 

Detailed Description

Stream interface for VIL image loaders.

This allows the loaders to be used with any type of stream.

Definition at line 21 of file vil_stream.h.

Constructor & Destructor Documentation

◆ vil_stream()

vil_stream::vil_stream ( )
protected

Definition at line 15 of file vil_stream.cxx.

◆ ~vil_stream()

vil_stream::~vil_stream ( )
protectedvirtual

Definition at line 23 of file vil_stream.cxx.

Member Function Documentation

◆ file_size()

virtual vil_streampos vil_stream::file_size ( ) const
pure virtual

Amount of data in the stream.

Implemented in vil_stream_core, vil_stream_fstream, vil_stream_section, and vil_stream_url.

◆ ok()

virtual bool vil_stream::ok ( ) const
pure virtual

Return false if the stream is broken.

Implemented in vil_stream_core, vil_stream_fstream, vil_stream_section, and vil_stream_url.

◆ read()

virtual vil_streampos vil_stream::read ( void *  buf,
vil_streampos  n 
)
pure virtual

Read n bytes into buf. Returns number of bytes read.

The return value is less than n only at eof.

Implemented in vil_stream_core, vil_stream_fstream, vil_stream_section, and vil_stream_url.

◆ ref()

void vil_stream::ref ( )
inline

up/down the reference count.

Definition at line 45 of file vil_stream.h.

◆ seek()

virtual void vil_stream::seek ( vil_streampos  position)
pure virtual

Goto file pointer.

Implemented in vil_stream_core, vil_stream_fstream, vil_stream_section, and vil_stream_url.

◆ tell()

virtual vil_streampos vil_stream::tell ( ) const
pure virtual

Return file pointer.

Implemented in vil_stream_core, vil_stream_fstream, vil_stream_section, and vil_stream_url.

◆ unref()

void vil_stream::unref ( )

Definition at line 31 of file vil_stream.cxx.

◆ write()

virtual vil_streampos vil_stream::write ( void const *  buf,
vil_streampos  n 
)
pure virtual

Write n bytes from buf. Returns number of bytes written.

The return value is less than n only in case of device failure.

Implemented in vil_stream_core, vil_stream_fstream, vil_stream_section, and vil_stream_url.

Friends And Related Function Documentation

◆ vil_open()

vil_stream * vil_open ( char const *  what,
char const *  how = "r" 
)
related

make a vil_stream from a filename, an URL, etc.

Definition at line 18 of file vil_open.cxx.

◆ vil_stream_read_big_endian_float()

float vil_stream_read_big_endian_float ( vil_stream is)
related

Reads in a 4-byte big-endian float.

Definition at line 122 of file vil_stream_read.cxx.

◆ vil_stream_read_big_endian_int_16()

void vil_stream_read_big_endian_int_16 ( vil_stream is,
vxl_uint_16 *  data,
unsigned  n 
)
related

Reads in n 16 bit unsigned ints.

Caller is responsible for allocating enough space.

Definition at line 134 of file vil_stream_read.cxx.

◆ vil_stream_write_big_endian_int_32()

void vil_stream_write_big_endian_int_32 ( vil_stream ,
vxl_int_32   
)
related

Definition at line 50 of file vil_stream_write.cxx.

◆ vil_stream_write_big_endian_uint_16()

void vil_stream_write_big_endian_uint_16 ( vil_stream ,
vxl_uint_16   
)
related

Definition at line 14 of file vil_stream_write.cxx.

◆ vil_stream_write_big_endian_uint_32()

void vil_stream_write_big_endian_uint_32 ( vil_stream ,
vxl_uint_32   
)
related

Definition at line 30 of file vil_stream_write.cxx.

◆ vil_stream_write_little_endian_int_32()

void vil_stream_write_little_endian_int_32 ( vil_stream ,
vxl_int_32   
)
related

Definition at line 60 of file vil_stream_write.cxx.

◆ vil_stream_write_little_endian_uint_16()

void vil_stream_write_little_endian_uint_16 ( vil_stream ,
vxl_uint_16   
)
related

Definition at line 22 of file vil_stream_write.cxx.

◆ vil_stream_write_little_endian_uint_32()

void vil_stream_write_little_endian_uint_32 ( vil_stream ,
vxl_uint_32   
)
related

Definition at line 40 of file vil_stream_write.cxx.

Member Data Documentation

◆ refcount_

vcl_atomic_count vil_stream::refcount_
private

Definition at line 54 of file vil_stream.h.


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