object_node.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 
00022 
00023 #if !defined OBJECT_NODE_HEADER
00024 #define OBJECT_NODE_HEADER
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/list.h"
00028 #include "whiptk/attribute.h"
00029 
00030 
00031 class WT_File;
00032 
00037 
00038 
00059 class WHIPTK_API WT_Object_Node : public WT_Item, public WT_Attribute
00060 {
00061         friend class WT_Rendition;
00062         friend class WT_Class_Factory;
00063         friend class WT_W2D_Class_Factory;
00064         friend class WT_Opcode;
00065         friend class WT_Group_End;
00066         friend class WT_Group_Begin;
00067         friend class WT_Object_Node_List;
00068 
00069 private:
00070     WT_String               m_object_node_name;
00071     WT_Integer32            m_object_node_num;
00072     WT_Integer32            m_previous_object_node_num;
00073     int                     m_incarnation;
00074     enum WT_Materialize_Stage
00075     {
00076         Gathering_Object_Node_Number,
00077         Gathering_Object_Node_Name,
00078         Eating_End_Whitespace
00079     }                       m_stage;
00080 
00081     void _deleteObject(void *object)
00082     {
00083         delete (WT_Object_Node*)object;
00084     }
00085 
00086 public:
00087 
00089     WT_Object_Node()
00090         : m_object_node_num(0)
00091         , m_previous_object_node_num(-1)
00092         , m_incarnation(-1)
00093         , m_stage(Gathering_Object_Node_Number)
00094     { }
00095 
00097     WT_Object_Node(
00098         WT_File &file, 
00099         WT_Integer32 object_node_num,  
00100         char const * object_node_name=WD_Null 
00101         );
00103     WT_Object_Node(
00104         WT_File &file, 
00105         WT_Integer32 object_node_num,  
00106         WT_Unsigned_Integer16 const * object_node_name 
00107         );
00108 
00110     WT_Object_Node (WT_Object_Node const & object_node);
00111 
00112         virtual ~WT_Object_Node()
00113         {}
00114 public:
00115     
00116 
00118     WT_ID            object_id() const;
00119     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00120     WT_Result        process(WT_File & file);
00121     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00122     WT_Result        serialize (WT_File & file) const;
00123     WT_Result        sync (WT_File & file) const;
00124     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00126 
00128     WT_Object_Node const & operator=(WT_Object_Node const & object_node);
00129 
00131     WT_String const & object_node_name()
00132     {    return m_object_node_name;    }
00133 
00135     WT_Integer32 object_node_num()
00136     {    return m_object_node_num; }
00137 
00139     void set(
00140         WT_File &file, 
00141         WT_Integer32 object_node_num,  
00142         char const * object_node_name 
00143         );
00145     void set(
00146         WT_File &file, 
00147         WT_Integer32 object_node_num,  
00148         WT_Unsigned_Integer16 const * object_node_name 
00149         );
00151     void set(
00152         WT_File &file, 
00153         WT_Integer32 object_node_num  
00154         );
00155 
00157     void set(WT_Object_Node const &object_node);
00158 
00160 
00162     static WT_Result default_process(
00163         WT_Object_Node & item, 
00164         WT_File & file 
00165         );
00166 };
00167 
00169 
00170 #endif // OBJECT_NODE_HEADER

Generated on Tue Jan 6 22:41:13 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5