Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

Impala::Util::IOBuffer Class Reference

Base class for I/O buffers. More...

#include <IOBuffer.h>

Inheritance diagram for Impala::Util::IOBuffer:

Inheritance graph
[legend]
Collaboration diagram for Impala::Util::IOBuffer:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Int64 PositionType

Public Member Functions

 IOBuffer ()
 create an empty buffer where you can write in
 IOBuffer (PositionType length)
 create a buffer of given size
 IOBuffer (PositionType length, unsigned char *buffer)
 after this call the IOBuffer owns the memory pointed to by buffer, no copy is made.
virtual ~IOBuffer ()
virtual bool Valid ()
virtual PositionType Available ()
 Number of bytes til end of controlled entity.
virtual int AvailableInt32 ()
virtual PositionType Size ()
 total number of bytes in controlled entity
virtual void SetSize (PositionType size)
template<class BackInsertIterator>
void ReadStrings (BackInsertIterator bi, bool skipEC, int count)
template<class Iterator>
bool WriteStrings (Iterator begin, Iterator end, int count=-1)
unsigned char * GetBuffer ()
 this function reads everything to enable MPI_Broadcast and returns the buffer
void SetBuffer (unsigned char *buf, PositionType size)
 after this call the IOBuffer owns the memory pointed to by buffer, no copy is made Sander and I (Michiel) already talked about how this should probably be only a constructor but I need it now, and we'll redisign later ;-)
void SetUseChannel (Channel *channel, String channelFile, String tmpFile)
 Indicate that data should be sent across given channel on destruction.
I/O
These functions read from the memory buffer, not necessarily the controlled entity

virtual Int64 Read (void *buf, Int64 bytesToRead)
 returns number of bytes read
virtual String ReadLine ()
 only for ascii (not binary) entities
virtual Int64 Gets (char *buf, Int64 bytesToRead)
virtual void NativeTypeRead (Int8 *ptr)
virtual void NativeTypeRead (UInt8 *ptr)
virtual void NativeTypeRead (Int16 *ptr)
virtual void NativeTypeRead (UInt16 *ptr)
virtual void NativeTypeRead (Int32 *ptr)
virtual void NativeTypeRead (UInt32 *ptr)
virtual void NativeTypeRead (Int64 *ptr)
virtual void NativeTypeRead (UInt64 *ptr)
virtual void NativeTypeRead (Real32 *ptr)
virtual void NativeTypeRead (Real64 *ptr)
virtual void Write (const void *buf, Int64 bytesToWrite)
virtual Int64 Puts (const char *buf)
virtual Int64 Puts (const String &str)
virtual void NativeTypeWrite (Int8 val)
virtual void NativeTypeWrite (UInt8 val)
virtual void NativeTypeWrite (Int16 val)
virtual void NativeTypeWrite (UInt16 val)
virtual void NativeTypeWrite (Int32 val)
virtual void NativeTypeWrite (UInt32 val)
virtual void NativeTypeWrite (Int64 val)
virtual void NativeTypeWrite (UInt64 val)
virtual void NativeTypeWrite (Real32 val)
virtual void NativeTypeWrite (Real64 val)
Positions
The hiding of positions enables us to implement complex behaviour like caching or asynchronous writing

virtual void SetPosition (PositionType position)
virtual void SetPositionAndSize (PositionType position)
virtual PositionType GetPosition ()
virtual void Rewind ()
virtual void FastForward ()
 strange name perhaps? this function goes to the end of the controlled entity
virtual PositionType Seek (PositionType offset, int whence)

Protected Member Functions

template<class NativeType>
void DoNativeTypeRead (NativeType *ptr)
template<class NativeType>
void DoNativeTypeWrite (NativeType val)
bool WriteIOBufferToChannel ()
void CheckDataChannelWrite ()

Private Attributes

unsigned char * mBuffer
PositionType mSize
PositionType mPosition
ChannelmDataChannel
String mDataChannelFile
String mDataChannelTmp
 ILOG_VAR_DEC

Detailed Description

Base class for I/O buffers.

Derived classes interact with file, socket, DB blob, etc.

terminology:

purpose:

notes:

Definition at line 41 of file IOBuffer.h.


The documentation for this class was generated from the following file:
Generated on Fri Mar 19 11:40:03 2010 for ImpalaSrc by  doxygen 1.5.1