vil1_stream_core Class Reference

#include <vil1_stream_core.h>

Inheritance diagram for vil1_stream_core:

vil1_stream List of all members.

Detailed Description

An in-core vil1_stream implementation.

This is an infinite stream - reads past the last point written will succeed but will return garbage data.

Definition at line 18 of file vil1_stream_core.h.


Public Member Functions

 vil1_stream_core (unsigned block_size=16384)
unsigned size () const
 get current file size.
vil1_streampos m_transfer (char *buf, vil1_streampos pos, vil1_streampos n, bool read)
 Read or write n bytes at position pos.
bool ok () const
 Return false if the stream is broken.
vil1_streampos read (void *buf, vil1_streampos n)
 Read n bytes into buf. Returns number of bytes read.
vil1_streampos write (void const *buf, vil1_streampos n)
 Write n bytes from buf. Returns number of bytes written.
vil1_streampos tell () const
 Return file pointer.
void seek (vil1_streampos position)
 Goto file pointer.
void ref ()
 up/down the reference count.
void unref ()

Protected Member Functions

 ~vil1_stream_core ()

Private Attributes

vil1_streampos curpos_
unsigned blocksize_
vcl_vector< char * > block_
vil1_streampos tailpos_

Constructor & Destructor Documentation

vil1_stream_core::vil1_stream_core ( unsigned  block_size = 16384  )  [inline]

Definition at line 26 of file vil1_stream_core.h.

vil1_stream_core::~vil1_stream_core (  )  [protected]

Definition at line 11 of file vil1_stream_core.cxx.


Member Function Documentation

unsigned vil1_stream_core::size (  )  const [inline]

get current file size.

Definition at line 30 of file vil1_stream_core.h.

vil1_streampos vil1_stream_core::m_transfer ( char *  buf,
vil1_streampos  pos,
vil1_streampos  n,
bool  read 
)

Read or write n bytes at position pos.

This does not change the current position. When read=false, buf is actually a "char const *".

Definition at line 39 of file vil1_stream_core.cxx.

bool vil1_stream_core::ok (  )  const [inline, virtual]

Return false if the stream is broken.

Implements vil1_stream.

Definition at line 38 of file vil1_stream_core.h.

vil1_streampos vil1_stream_core::read ( void *  buf,
vil1_streampos  n 
) [virtual]

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

The return value is less than n only at eof.

Implements vil1_stream.

Definition at line 20 of file vil1_stream_core.cxx.

vil1_streampos vil1_stream_core::write ( void const *  buf,
vil1_streampos  n 
) [virtual]

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

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

Implements vil1_stream.

Definition at line 29 of file vil1_stream_core.cxx.

vil1_streampos vil1_stream_core::tell (  )  const [inline, virtual]

Return file pointer.

Implements vil1_stream.

Definition at line 41 of file vil1_stream_core.h.

void vil1_stream_core::seek ( vil1_streampos  position  )  [inline, virtual]

Goto file pointer.

Implements vil1_stream.

Definition at line 42 of file vil1_stream_core.h.

void vil1_stream::ref (  )  [inline, inherited]

up/down the reference count.

Definition at line 38 of file vil1_stream.h.

void vil1_stream::unref (  )  [inherited]

Definition at line 31 of file vil1_stream.cxx.


Member Data Documentation

vil1_streampos vil1_stream_core::curpos_ [private]

Definition at line 20 of file vil1_stream_core.h.

unsigned vil1_stream_core::blocksize_ [private]

Definition at line 21 of file vil1_stream_core.h.

vcl_vector<char*> vil1_stream_core::block_ [private]

Definition at line 22 of file vil1_stream_core.h.

vil1_streampos vil1_stream_core::tailpos_ [private]

Definition at line 23 of file vil1_stream_core.h.


The documentation for this class was generated from the following files:
Generated on Mon Mar 8 05:09:36 2010 for core/vil1 by  doxygen 1.5.1