Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Element_Tree.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Element_Tree.h
00006  *
00007  *  $Id: Element_Tree.h,v 1.1.1.1 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Nanbor Wang <nanbor@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 #ifndef _ACEXML_ELEMENT_TREE_H_
00013 #define _ACEXML_ELEMENT_TREE_H_
00014 
00015 #include "ace/pre.h"
00016 #include "ACEXML/parser/debug_validator/Debug_DTD_Manager_Export.h"
00017 
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 #pragma once
00020 #endif /* ACE_LACKS_PRAGMA_ONCE */
00021 
00022 #include "ACEXML/common/XML_Types.h"
00023 
00024 /**
00025  * @class ACEXML_Element_Tree_Node Element_Tree.h "parser/debug_validator/Element_Tree.h"
00026  *
00027  * @brief An abstract base class for describing DTD child element definition.
00028  *
00029  * @sa ACEXML_Element_Tree_Name_Node, ACEXML_Element_Tree_List_Node
00030  */
00031 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_Node
00032 {
00033 public:
00034 
00035   /// Default constructor.
00036   ACEXML_Element_Tree_Node ();
00037 
00038   /// Destructor
00039   virtual ~ACEXML_Element_Tree_Node ();
00040 
00041   /// Accessor for next element in chain
00042   ACEXML_Element_Tree_Node *next ();
00043   void next (ACEXML_Element_Tree_Node *n);
00044 
00045   /// Displaying the content.
00046   virtual void dump () = 0;
00047 
00048   ACE_ALLOC_HOOK_DECLARE;
00049 
00050 protected:
00051   ACEXML_Element_Tree_Node *next_;
00052 };
00053 
00054 /**
00055  * @class ACEXML_Element_Tree_Name_Node Element_Tree.h "parser/debug_validator/Element_Tree.h"
00056  *
00057  * @brief An abstract base class for describing a name node in a DTD child
00058  * element definition.
00059  *
00060  * @sa ACEXML_Element_Tree_Node, ACEXML_Element_Tree_List_Node
00061  */
00062 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_Name_Node
00063   : public ACEXML_Element_Tree_Node
00064 {
00065 public:
00066   /// Constructor.
00067   ACEXML_Element_Tree_Name_Node (const ACEXML_Char *name,
00068                                  int release = 1);
00069 
00070   /// Change the name of this node.
00071   void set (const ACEXML_Char *name,
00072             int release = 1);
00073 
00074   virtual void dump ();
00075 
00076   ACE_ALLOC_HOOK_DECLARE;
00077 protected:
00078   ACEXML_String name_;
00079 };
00080 
00081 class ACEXML_Element_Tree_List_Stack;
00082 
00083 /**
00084  * @class ACEXML_Element_Tree_List_Node Element_Tree.h "parser/debug_validator/Element_Tree.h"
00085  *
00086  * @brief An abstract base class for describing a node list in a DTD child
00087  * element definition.
00088  *
00089  * @sa ACEXML_Element_Tree_Node, ACEXML_Element_Tree_Name_Node
00090  */
00091 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_List_Node
00092   : public ACEXML_Element_Tree_Node
00093 {
00094 public:
00095   friend class ACEXML_Element_Tree_List_Stack;
00096 
00097   typedef enum {
00098     SEQUENCE,
00099     CHOICE
00100   } LIST_TYPE;
00101 
00102   /// Default constructor.
00103   ACEXML_Element_Tree_List_Node (void);
00104 
00105   /// Destructor.
00106   virtual ~ACEXML_Element_Tree_List_Node (void);
00107 
00108   /// Insert a new ACEXML_Element_Tree_Node into the list.
00109   int insert (ACEXML_Element_Tree_Node *node);
00110 
00111   /// Get/set the type of list.
00112   LIST_TYPE get (void);
00113   int set (LIST_TYPE type);
00114 
00115   virtual void dump ();
00116 
00117   ACE_ALLOC_HOOK_DECLARE;
00118 protected:
00119   LIST_TYPE type_;
00120 
00121   ACEXML_Element_Tree_Node *head_;
00122 
00123   ACEXML_Element_Tree_Node *tail_;
00124 
00125   ACEXML_Element_Tree_List_Node *pop_next_;
00126 };
00127 
00128 /**
00129  * @class ACEXML_Element_Tree_List_Stack Element_Tree.h "parser/debug_validator/Element_Tree.h"
00130  *
00131  * @brief A class for managing a stack of ACEXML_Element_Tree_List_Node's.
00132  *
00133  * @sa ACEXML_Element_Tree_List_Node
00134  */
00135 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_List_Stack
00136 {
00137 public:
00138   ACEXML_Element_Tree_List_Stack ();
00139 
00140   void push (ACEXML_Element_Tree_List_Node *n);
00141 
00142   ACEXML_Element_Tree_List_Node *pop (void);
00143 
00144   ACEXML_Element_Tree_List_Node *top (void);
00145 
00146   int empty (void);
00147 
00148   ACE_ALLOC_HOOK_DECLARE;
00149 
00150 protected:
00151   ACEXML_Element_Tree_List_Node *top_;
00152 };
00153 
00154 #if defined (__ACEXML_INLINE__)
00155 # include "ACEXML/parser/debug_validator/Element_Tree.i"
00156 #endif /* __ACEXML_INLINE__ */
00157 
00158 #include "ace/post.h"
00159 
00160 #endif /* _ACEXML_ELEMENT_TREE_H_ */

Generated on Mon Jun 16 13:23:21 2003 for ACEXML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002