NAME

ACE_Overlapped_File - A wrapper for overlapped file I/O.

SYNOPSIS


#include <ace/Proactor.h>


class ACE_Overlapped_File
{
  public:
    ACE_Overlapped_File (void);
    ACE_Overlapped_File (const ACE_Overlapped_File &file);
    ACE_Overlapped_File (
        const char *file_name,
        int mode,
        int perms = 0
        );
    ~ACE_Overlapped_File (void);
    int open (
        const char *file_name,
        int access = GENERIC_READ,
        int share = FILE_SHARE_READ,
        LPSECURITY_ATTRIBUTES security = 0,
        int creation = OPEN_EXISTING,
        int flags = FILE_ATTRIBUTE_NORMAL,
        ACE_HANDLE template_file = ACE_INVALID_HANDLE
        );
    int open (ACE_HANDLE handle);
    void close (void);
    off_t offset (void) const;
    off_t size (void) const;
    off_t lseek (off_t offset, int whence);
    ACE_HANDLE get_handle (void) const;
  protected:
    off_t offset_;
    off_t file_size_;
    ACE_HANDLE handle_;
    int delete_handle_;
};

DESCRIPTION

ACE_Overlapped_File is place-holder for file I/O. When performing overlapped I/O in win32, a file pointer is not managed by the kernel. Instead, the user is responsible for maintaining file pointers for all open files. This wrapper provides an abstraction for a file pointer. The Proactor updates Overlapped_File objects when overlapped I/O operations complete. Eventually, this class may be integrated with ACE_FILE_IO.

Initialization and termination methods.

ACE_Overlapped_File (void);
ACE_Overlapped_File (const ACE_Overlapped_File &file);
ACE_Overlapped_File (const char *file_name, int mode, int perms = 0);
~ACE_Overlapped_File (void);
int open (
    const char *file_name,
    int access = GENERIC_READ,
    int share = FILE_SHARE_READ,
    LPSECURITY_ATTRIBUTES security = 0,
    int creation = OPEN_EXISTING,
    int flags = FILE_ATTRIBUTE_NORMAL,
    ACE_HANDLE template_file = ACE_INVALID_HANDLE
    );
int open (ACE_HANDLE handle);
void close (void);
off_t offset (void) const;
off_t size (void) const;
off_t lseek (off_t offset, int whence);
ACE_HANDLE get_handle (void) const;

AUTHOR

Doug Schmidt (schmidt@cs.wustl.edu), Tim Harrison (harrison@cs.wustl.edu), and Irfan Pyarali (ip1@cs.wustl.edu).

LIBRARY

ace