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

signdata.h

00001 //  Copyright (c) 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 
00019 #if !defined SIGNDATA_HEADER
00020 #define SIGNDATA_HEADER
00021 
00022 #include "whiptk/whipcore.h"
00023 #include "whiptk/file.h"
00024 #include "whiptk/drawable.h"
00025 #include "whiptk/guid_list.h"
00026 
00032 
00033 
00040 class WHIPTK_API WT_SignData : public WT_Object
00041 {
00042 private:
00043 
00044     WT_Guid_List            m_block_guid_list;
00045     WT_Integer32            m_data_size;
00046     WT_Byte *               m_data;
00047     WT_Boolean              m_local_data_copy;
00048 
00049     enum
00050     {
00051         Starting,
00052         Getting_Block_List_Flag,
00053         Getting_Block_List,
00054         Getting_Data_Size,
00055         Getting_Data,
00056         Getting_Close
00057     }   m_stage;
00058 
00059 public:
00060 
00061     WT_SignData ()
00062     : m_block_guid_list()
00063     , m_data_size(0)
00064     , m_data(WD_Null)
00065     , m_local_data_copy(WD_False)
00066     , m_stage(Starting)
00067     { }
00068 
00069     WT_SignData (
00070         WT_Guid_List block_guid_list
00071         )
00072     : m_data_size(0)
00073     , m_data(WD_Null)
00074     , m_local_data_copy(WD_False)
00075     , m_stage(Starting)
00076     {
00077         m_block_guid_list = block_guid_list;
00078     }
00079 
00080     WT_SignData(
00081             WT_Guid_List                block_guid_list,
00082             WT_Integer32                data_size,
00083             WT_Byte *                   data,
00084             WT_Boolean                  copy);
00085 
00086     WT_SignData(const WT_SignData & signdata)
00087     : WT_Object()
00088     {
00089         *this = signdata;
00090     }
00091 
00092     ~WT_SignData()
00093     {
00094         if (m_local_data_copy)
00095             delete [] m_data;
00096     }
00097 
00098     WT_BlockRef_List get_blockref_list(
00099         WT_Guid_List & guid_list, WT_File & file);
00100 
00101     WT_Integer32 data_size() const
00102     {   return m_data_size; }
00103 
00104     WT_Byte const * data() const
00105     {   return m_data;  }
00106 
00107     WT_Guid_List const block_guid_list() const
00108     {   return m_block_guid_list;  }
00109 
00110     WT_SignData const & operator=(WT_SignData const & signdata) {
00111         m_block_guid_list = signdata.block_guid_list();
00112         m_data_size = signdata.data_size();
00113         m_data = WD_Null;
00114         if(m_data_size) {
00115             m_local_data_copy = WD_True;
00116             m_data = new WT_Byte[m_data_size];
00117             if(!m_data)
00118                 throw WT_Result::Out_Of_Memory_Error;
00119             memcpy((void *) &m_data, signdata.m_data,
00120                 sizeof(WT_Byte) * m_data_size);
00121         }
00122 
00123         return *this;
00124     }
00125 
00126     WT_ID            object_id() const;
00127     WT_Type          object_type() const;
00128     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00129     WT_Result        process(WT_File & file);
00130     WT_Result        serialize(WT_File & file) const;
00131     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00132 
00133     static WT_Result default_process( WT_SignData & item, WT_File & file );
00134 
00135 };
00136 
00138 
00139 #endif // SIGNDATA_HEADER

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