libdodo: dodo::io::memory Class Reference

dodo::io::memory Class Reference

provides memory I/O manipulations More...

#include <ioMemory.h>

Inheritance diagram for dodo::io::memory:
Collaboration diagram for dodo::io::memory:

List of all members.

Public Types

enum  flagsEnum { FLAGS_NORMAL = 1, FLAGS_EXTERN = 2, FLAGS_FIXED_LENGTH = 4 }

Public Member Functions

 memory (char *data, unsigned long size, short flags=FLAGS_NORMAL, short protection=channel::PROTECTION_PROCESS)
 constructor
 memory (short protection=channel::PROTECTION_PROCESS)
 constructor
 memory (const memory &fd)
 copy constructor
 memory (const dodoString &data, short protection=channel::PROTECTION_PROCESS)
 constructor
virtual ~memory ()
 destructor
void clone (const memory &fd)
 clone file object
virtual void erase ()
 erase node on position
virtual void flush () const
 flush output
virtual void clear ()
 clear buffer
 operator const char * ()

Protected Member Functions

virtual int inDescriptor () const
virtual int outDescriptor () const
virtual unsigned long _read (char *const data) const
virtual unsigned long _readString (char *const data) const
 read null- or newline- terminated memory
virtual unsigned long _write (const char *const data) const
virtual unsigned long _writeString (const char *const data) const
 write null- terminated memory

Protected Attributes

char * data
 data
unsigned long size
 size of data
short flags
bool nullEnd
 true if null is set up in the end

Detailed Description

provides memory I/O manipulations

Definition at line 45 of file ioMemory.h.


Member Enumeration Documentation

Enumerator:
FLAGS_NORMAL 
FLAGS_EXTERN 
FLAGS_FIXED_LENGTH 

Definition at line 51 of file ioMemory.h.

00051                            {
00052                 FLAGS_NORMAL = 1,
00053                 FLAGS_EXTERN = 2,
00054                 FLAGS_FIXED_LENGTH = 4,
00055             };


Constructor & Destructor Documentation

dodo::io::memory::memory ( char *  data,
unsigned long  size,
short  flags = FLAGS_NORMAL,
short  protection = channel::PROTECTION_PROCESS 
)

constructor

Parameters:
data defines pointer to memory region
size defines memory region size
flags defines memory region flags,
See also:
io::memory::flagsEnum
Parameters:
protection defines flags of IO protection,
See also:
io::channel::protectionEnum
dodo::io::memory::memory ( short  protection = channel::PROTECTION_PROCESS  ) 

constructor

Parameters:
protection defines flags of IO protection,
See also:
io::channel::protectionEnum
dodo::io::memory::memory ( const memory fd  ) 

copy constructor

Note:
xexec object is not copied
dodo::io::memory::memory ( const dodoString &  data,
short  protection = channel::PROTECTION_PROCESS 
)

constructor

Parameters:
data defines initial data for the interface
protection defines flags of IO protection,
See also:
io::channel::protectionEnum
virtual dodo::io::memory::~memory (  )  [virtual]

destructor


Member Function Documentation

virtual unsigned long dodo::io::memory::_read ( char *const   data  )  const [protected, virtual]
Returns:
amount in bytes of successfully read data
Parameters:
data defines buffer that will be filled
Note:
not more then bs(including null)

Implements dodo::io::channel.

virtual unsigned long dodo::io::memory::_readString ( char *const   data  )  const [protected, virtual]

read null- or newline- terminated memory

Returns:
amount in bytes of successfully read data
Parameters:
data defines buffer that will be filled
Note:
not more then bs(including null)

Implements dodo::io::channel.

virtual unsigned long dodo::io::memory::_write ( const char *const   data  )  const [protected, virtual]
Returns:
amount in bytes of successfully written data
Parameters:
data defines data that will be written

Implements dodo::io::channel.

virtual unsigned long dodo::io::memory::_writeString ( const char *const   data  )  const [protected, virtual]

write null- terminated memory

Returns:
amount in bytes of successfully written data
Parameters:
data defines data that will be written
Note:
write only to the end of the file(append)

Implements dodo::io::channel.

virtual void dodo::io::memory::clear (  )  [virtual]

clear buffer

void dodo::io::memory::clone ( const memory fd  ) 

clone file object

Parameters:
fd defines object to clone
Note:
xexec object is not copied
virtual void dodo::io::memory::erase (  )  [virtual]

erase node on position

virtual void dodo::io::memory::flush (  )  const [virtual]

flush output

Implements dodo::io::channel.

virtual int dodo::io::memory::inDescriptor (  )  const [protected, virtual]
Returns:
descriptor of the input stream

Implements dodo::io::event::descriptor.

dodo::io::memory::operator const char * (  ) 
Returns:
memory
virtual int dodo::io::memory::outDescriptor (  )  const [protected, virtual]
Returns:
descriptor of the output stream

Implements dodo::io::event::descriptor.


Member Data Documentation

char* dodo::io::memory::data [mutable, protected]

data

Definition at line 164 of file ioMemory.h.

short dodo::io::memory::flags [protected]

Definition at line 167 of file ioMemory.h.

bool dodo::io::memory::nullEnd [mutable, protected]

true if null is set up in the end

Definition at line 169 of file ioMemory.h.

unsigned long dodo::io::memory::size [mutable, protected]

size of data

Definition at line 165 of file ioMemory.h.


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

Generated on Sun Nov 8 03:44:50 2009 for libdodo by  doxygen 1.6.1