Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

fileext.h

00001 //  Copyright (c) 1996-2001 by Autodesk, Inc.
00002 //
00003 //  By using this code, you are agreeing to the terms and conditions of
00004 //  the License Agreement included in the documentation for this code.
00005 //
00006 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00007 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00008 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00009 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00010 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00011 //
00012 //  Use, duplication, or disclosure by the U.S. Government is subject to
00013 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00014 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00015 //  Data and Computer Software), as applicable.
00016 //
00017 
00018 #if !defined FILEEXT_HEADER
00019 #define FILEEXT_HEADER
00020 
00021 #include "whiptk/whip_toolkit.h"
00022 #include "whiptk/compdata.h"
00023 #include "whiptk/gouraud_polyline.h"
00024 #include "whiptk/gouraud_polytri.h"
00025 #include "whiptk/unknown.h"
00026 
00031 
00032 
00038 class WHIPTK_API WT_FileExt : public WT_File
00039 {
00040 private:
00041     // Class action methods
00042     #define CALLBACK_MACRO(Upper, Lower)\
00043     static WT_Result process_##Lower (WT_##Upper & Lower, WT_File& file)\
00044         { return ((WT_FileExt&)file).process_##Lower(Lower); }
00045     CALLBACK_LIST
00046     #undef CALLBACK_MACRO
00047 
00048     // Class stream methods
00049     static WT_Result process_stream_open (WT_File& file)
00050         { return ((WT_FileExt&)file).process_stream_open(); }
00051     static WT_Result process_stream_close (WT_File& file)
00052         { return ((WT_FileExt&)file).process_stream_close(); }
00053     static WT_Result process_stream_read (WT_File& file, int desired_bytes, int& bytes_read, void* buffer)
00054         { return ((WT_FileExt&)file).process_stream_read(desired_bytes, bytes_read, buffer); }
00055     static WT_Result process_stream_write(WT_File& file, int size, void const* buffer)
00056         { return ((WT_FileExt&)file).process_stream_write(size, buffer); }
00057     static WT_Result process_stream_seek (WT_File& file, int distance, int& amount_seeked)
00058         { return ((WT_FileExt&)file).process_stream_seek(distance, amount_seeked); }
00059 
00060     static WT_Result process_stream_end_seek (WT_File& file)
00061         { return ((WT_FileExt&)file).process_stream_end_seek(); }
00062     static WT_Result process_stream_tell (WT_File& file, unsigned long *current_file_pointer_position)
00063         { return ((WT_FileExt&)file).process_stream_tell(current_file_pointer_position); }
00064 
00065 
00066 protected:
00067     // Instance action methods
00068 #ifndef DOXYGEN_EXCLUDE
00069     #define CALLBACK_MACRO(Upper, Lower)\
00070     virtual WT_Result process_##Lower (WT_##Upper & Lower)\
00071         { return WT_##Upper::default_process(Lower, *this); }
00072     CALLBACK_LIST
00073     #undef CALLBACK_MACRO
00074 #endif
00075 
00081     virtual WT_Result process_stream_close (void) { return default_close(*this); }
00082     virtual WT_Result process_stream_end_seek () { return default_end_seek(*this); }
00083     virtual WT_Result process_stream_open (void)  { return default_open(*this); }
00084     virtual WT_Result process_stream_read (int desired_bytes, int& bytes_read, void* buffer) { return default_read(*this, desired_bytes, bytes_read, buffer); }
00085     virtual WT_Result process_stream_seek (int distance, int& amount_seeked) { return default_seek(*this, distance, amount_seeked); }
00086     virtual WT_Result process_stream_tell (unsigned long *current_file_pointer_position) { return default_tell(*this, current_file_pointer_position); }
00087     virtual WT_Result process_stream_write(int size, void const* buffer) { return default_write(*this, size, buffer); }
00089 
00090 public:
00092     WT_FileExt (void)
00093     {
00094         // set the action methods
00095         #define CALLBACK_MACRO(Upper, Lower)\
00096         m_##Lower##_action = process_##Lower;
00097         CALLBACK_LIST
00098         #undef CALLBACK_MACRO
00099 
00100         // set the stream methods
00101         m_stream_open_action  = process_stream_open;
00102         m_stream_close_action = process_stream_close;
00103         m_stream_read_action  = process_stream_read;
00104         m_stream_write_action = process_stream_write;
00105         m_stream_seek_action  = process_stream_seek;
00106         m_stream_end_seek_action    = process_stream_end_seek;
00107         m_stream_tell_action        = process_stream_tell;
00108     }
00109 };
00110 
00112 
00113 #endif // FILEEXT_HEADER

Generated on Tue May 17 12:07:44 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1