diff options
Diffstat (limited to 'apps/JAWS/server/IO.h')
-rw-r--r-- | apps/JAWS/server/IO.h | 70 |
1 files changed, 56 insertions, 14 deletions
diff --git a/apps/JAWS/server/IO.h b/apps/JAWS/server/IO.h index 52eacf7b1dc..884783b96dd 100644 --- a/apps/JAWS/server/IO.h +++ b/apps/JAWS/server/IO.h @@ -2,7 +2,20 @@ // Hey, Emacs! This is a C++ file! // $Id$ -#ifndef JAWS_IO_H +// ============================================================================ +// +// = LIBRARY +// jaws +// +// = FILENAME +// IO.h +// +// = AUTHOR +// James Hu +// +// ============================================================================ + +#if !defined (JAWS_IO_H) #define JAWS_IO_H class ACE_Message_Block; @@ -12,7 +25,6 @@ class JAWS_IO_Handler; #include "ace/Asynch_IO.h" class JAWS_IO - // // = TITLE // // This class defines the abstract interface for an I/O class in @@ -31,17 +43,23 @@ public: void handle (ACE_HANDLE h); ACE_HANDLE handle (void); + // James, please add documentation here. + virtual void read (ACE_Message_Block& mb, int size) = 0; + virtual void transmit_file (const char *filename, const char *header, int header_size, const char *trailer, int trailer_size) = 0; + virtual void receive_file (const char *filename, void *initial_data, int initial_data_length, int entire_length) = 0; + virtual void send_confirmation_message (const char *buffer, int length) = 0; + virtual void send_error_message (const char *buffer, int length) = 0; protected: @@ -50,6 +68,7 @@ protected: }; class JAWS_IO_Handler +// James, please add documentation here. { public: virtual void read_complete (ACE_Message_Block &data) = 0; @@ -91,47 +110,66 @@ public: }; class JAWS_Synch_IO : public JAWS_IO +// James, please add documentation here. { public: JAWS_Synch_IO (void); + ~JAWS_Synch_IO (void); + void read (ACE_Message_Block& mb, int size); + void transmit_file (const char *filename, const char *header, int header_size, const char *trailer, int trailer_size); + void receive_file (const char *filename, void *initial_data, int initial_data_length, int entire_length); - void send_confirmation_message (const char *buffer, int length); - void send_error_message (const char *buffer, int length); + + void send_confirmation_message (const char *buffer, + int length); + + void send_error_message (const char *buffer, + int length); protected: - virtual void send_message (const char *buffer, int length); + virtual void send_message (const char *buffer, + int length); }; // This only works on Win32 #if defined (ACE_WIN32) class JAWS_Asynch_IO : public JAWS_IO, public ACE_Handler +// James, please add documentation here. { public: JAWS_Asynch_IO (void); + ~JAWS_Asynch_IO (void); - void read (ACE_Message_Block& mb, int size); + + void read (ACE_Message_Block& mb, int size); + void transmit_file (const char *filename, const char *header, int header_size, const char *trailer, int trailer_size); + void receive_file (const char *filename, void *initial_data, int initial_data_length, int entire_length); - void send_confirmation_message (const char *buffer, int length); - void send_error_message (const char *buffer, int length); + + void send_confirmation_message (const char *buffer, + int length); + + void send_error_message (const char *buffer, + int length); protected: enum Message_Types @@ -140,19 +178,23 @@ protected: ERROR_MESSAGE }; - virtual void send_message (const char *buffer, int length, int act); + virtual void send_message (const char *buffer, + int length, + int act); virtual void handle_read_stream (const ACE_Asynch_Read_Stream::Result &result); - // This method will be called when an asynchronous read completes on a stream. + // This method will be called when an asynchronous read completes on + // a stream. virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result); - // This method will be called when an asynchronous write completes on a stream. + // This method will be called when an asynchronous write completes + // on a stream. virtual void handle_transmit_file (const ACE_Asynch_Transmit_File::Result &result); - // This method will be called when an asynchronous transmit file completes. - + // This method will be called when an asynchronous transmit file + // completes. }; -#endif /* ACE_WIN32 */ +#endif /* ACE_WIN32 */ #endif /* JAWS_IO_H */ |