DLMemoryBasedIO.h

Go to the documentation of this file.
00001 #ifndef DLMEMORYBASEDIO_H
00002 #define DLMEMORYBASEDIO_H
00003 
00004 #include "DLIOStream.h"
00005 
00020 class DLMemoryBasedIO  : public DLIOStream
00021 {
00022 
00023    public:
00032    DLMemoryBasedIO(void *ptr, int size, const char *mode);
00036    virtual ~DLMemoryBasedIO(void);
00048    int dlRead(void* buff, int size);
00060    int dlGets(void* buff, int size);
00061 
00070    string dlGetLine();
00071 
00085    int dlGetInt(DLEndian endian);
00099    short dlGetShort(DLEndian endian);
00100 
00114    void dlWriteInt(int intVal, DLEndian endian);
00129    void dlWriteShort(short shortVal, DLEndian endian);
00137    int dlWrite(void* buff, int size);  
00142    int dlClose ();
00143      
00149    int dlFlush();
00150 
00156    void* dlGetMemBlock();
00162    int dlGetMemSize();
00163 
00164    private:
00165 
00166    /*
00167     * File descriptor into the memory block.
00168     * This descriptor is used to identify the different memory 
00169     * block for different instance of DLMemoryBasedIO.
00170     */
00171    int fd;
00172 };
00173 
00174 #endif // DLMEMORYBASEDIO_H

DOCLIB is being developed under contract by a collaboration between:
The Laboratory for Language and Media Processing
Unviersity of Maryland, College Park
and
Booz | Allen | Hamilton

All Rights Reserved, 2003-2007