rasdaman complete source
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
akg::FileDescriptor Class Reference

#include <akgnet_fdescr.hh>

Inheritance diagram for akg::FileDescriptor:
akg::File akg::Socket akg::ClientSocket akg::ListenSocket akg::ServerSocket

Public Member Functions

 ~FileDescriptor () throw ()
 Destructor, if open, closes the file descriptor. More...
 
int operator() () throw ()
 Returns the OS file descriptor. More...
 
bool isOpen () throw ()
 
void close () throw ()
 Closes the descriptor. More...
 
int getErrno () throw ()
 Returns the error number of the last operation. More...
 
int write (const void *buffer, int count) throw ()
 
int read (void *buffer, int count) throw ()
 
bool setNonBlocking (bool nonBlocking) throw ()
 
bool isNonBlocking () throw ()
 Returns true if the descriptors is in non-blocking mode. More...
 

Protected Member Functions

 FileDescriptor () throw ()
 Protected constructor. More...
 
void saveErrno () throw ()
 Saves the errno. More...
 

Protected Attributes

int fileDescriptor
 
int savedErrno
 

Detailed Description

This class the base class for a hierarchie, which are envelopes for the usual OS file descriptors. They offer only that much functionallity as needed for our library The objects of this hierarchie can't be copied!

Constructor & Destructor Documentation

akg::FileDescriptor::~FileDescriptor ( )
throw (
)

Destructor, if open, closes the file descriptor.

akg::FileDescriptor::FileDescriptor ( )
throw (
)
protected

Protected constructor.

Member Function Documentation

void akg::FileDescriptor::close ( )
throw (
)

Closes the descriptor.

int akg::FileDescriptor::getErrno ( )
throw (
)

Returns the error number of the last operation.

bool akg::FileDescriptor::isNonBlocking ( )
throw (
)

Returns true if the descriptors is in non-blocking mode.

bool akg::FileDescriptor::isOpen ( )
throw (
)

Returns true if the descriptor is open. Be aware that closing the file descriptor by using SO specific functions instead of the methods of this class can lead to incorrect results

int akg::FileDescriptor::operator() ( )
throw (
)

Returns the OS file descriptor.

int akg::FileDescriptor::read ( void *  buffer,
int  count 
)
throw (
)

Reads the specified number of bytes into the specified buffer. Returns the number of bytes actually read

void akg::FileDescriptor::saveErrno ( )
throw (
)
protected

Saves the errno.

bool akg::FileDescriptor::setNonBlocking ( bool  nonBlocking)
throw (
)

Sets the non-blocking mode on or off Returns true o succes

int akg::FileDescriptor::write ( const void *  buffer,
int  count 
)
throw (
)

Writes the specified number of bytes from the specified buffer. Returns the number of bytes actually written

Member Data Documentation

int akg::FileDescriptor::fileDescriptor
protected
int akg::FileDescriptor::savedErrno
protected

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