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

unknown.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 UNKNOWN_HEADER
00019 #define UNKNOWN_HEADER
00020 
00021 #include "whiptk/whipcore.h"
00022 #include "whiptk/object.h"
00023 
00024 class WT_File;
00025 
00027 
00028 class WHIPTK_API WT_Unknown : public WT_Object
00029 {
00030 
00031 private:
00032     WT_Byte *pass_thru_bytes;
00033     WT_Unsigned_Integer16 total_opcode_size;
00034 
00035     WT_Unknown (WT_Unknown const &)
00036       : WT_Object()
00037       , pass_thru_bytes()
00038       , total_opcode_size()
00039     {
00040         WD_Complain ("cannot copy WT_Unknown");
00041     }  // prohibited
00042 
00043 public:
00044 
00046 
00047     WT_Unknown()
00048     {
00049         pass_thru_bytes = WD_Null;
00050         total_opcode_size = 0;
00051     }
00053     ~WT_Unknown()
00054     {
00055         if(pass_thru_bytes != WD_Null)
00056             delete []pass_thru_bytes;
00057         pass_thru_bytes = WD_Null;
00058         total_opcode_size = 0;
00059     }
00060 
00062 
00063     WT_Unsigned_Integer16 & get_pass_thru_byte_length() { return total_opcode_size; }
00064     WT_Byte* get_pass_thru_bytes(void) { return pass_thru_bytes; }
00065 
00067     void release_pass_thru_bytes() {
00068         if(pass_thru_bytes != WD_Null)
00069             delete []pass_thru_bytes;
00070         pass_thru_bytes = WD_Null;
00071         total_opcode_size = 0;
00072     }
00073 
00075     inline WT_Unknown const & operator= (WT_Unknown const & unknown_object)
00076     {
00077         WT_Unknown *punknown;
00078         punknown = (WT_Unknown *) &unknown_object;
00079         pass_thru_bytes = new WT_Byte[punknown->get_pass_thru_byte_length()];
00080         if(!pass_thru_bytes)
00081             throw WT_Result::Out_Of_Memory_Error;
00082         memcpy(pass_thru_bytes, punknown->get_pass_thru_bytes(),
00083             punknown->get_pass_thru_byte_length());
00084 
00085         return *this;
00086     }
00088 
00090     WT_ID            object_id() const;
00091     WT_Type          object_type() const;
00092     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00093     WT_Result        process(WT_File & file);
00094     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00095     WT_Result        serialize (WT_File & file) const;
00097 
00099 
00101     static WT_Result default_process(
00102         WT_Unknown & item, 
00103         WT_File & file 
00104         );
00105 
00106 };
00107 
00108 #endif // UNKNOWN_HEADER

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