Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / ACEXML / parser / debug_validator / Element_Tree.h
blob71fae9b6a77420ed971bec77defa2fb6fb866f23
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Element_Tree.h
7 * @author Nanbor Wang <nanbor@cs.wustl.edu>
8 */
9 //=============================================================================
10 #ifndef _ACEXML_ELEMENT_TREE_H_
11 #define _ACEXML_ELEMENT_TREE_H_
13 #include /**/ "ace/pre.h"
14 #include "ACEXML/parser/debug_validator/Debug_DTD_Manager_Export.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 #pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "ACEXML/common/XML_Types.h"
22 /**
23 * @class ACEXML_Element_Tree_Node Element_Tree.h "parser/debug_validator/Element_Tree.h"
25 * @brief An abstract base class for describing DTD child element definition.
27 * @sa ACEXML_Element_Tree_Name_Node, ACEXML_Element_Tree_List_Node
29 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_Node
31 public:
32 /// Default constructor.
33 ACEXML_Element_Tree_Node ();
35 /// Destructor
36 virtual ~ACEXML_Element_Tree_Node ();
38 /// Accessor for next element in chain
39 ACEXML_Element_Tree_Node *next ();
40 void next (ACEXML_Element_Tree_Node *n);
42 /// Displaying the content.
43 virtual void dump () = 0;
45 ACE_ALLOC_HOOK_DECLARE;
47 protected:
48 ACEXML_Element_Tree_Node *next_;
51 /**
52 * @class ACEXML_Element_Tree_Name_Node Element_Tree.h "parser/debug_validator/Element_Tree.h"
54 * @brief An abstract base class for describing a name node in a DTD child
55 * element definition.
57 * @sa ACEXML_Element_Tree_Node, ACEXML_Element_Tree_List_Node
59 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_Name_Node
60 : public ACEXML_Element_Tree_Node
62 public:
63 /// Constructor.
64 ACEXML_Element_Tree_Name_Node (const ACEXML_Char *name,
65 int release = 1);
67 /// Change the name of this node.
68 void set (const ACEXML_Char *name,
69 int release = 1);
71 virtual void dump ();
73 ACE_ALLOC_HOOK_DECLARE;
74 protected:
75 ACEXML_String name_;
78 class ACEXML_Element_Tree_List_Stack;
80 /**
81 * @class ACEXML_Element_Tree_List_Node Element_Tree.h "parser/debug_validator/Element_Tree.h"
83 * @brief An abstract base class for describing a node list in a DTD child
84 * element definition.
86 * @sa ACEXML_Element_Tree_Node, ACEXML_Element_Tree_Name_Node
88 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_List_Node
89 : public ACEXML_Element_Tree_Node
91 public:
92 friend class ACEXML_Element_Tree_List_Stack;
94 typedef enum {
95 SEQUENCE,
96 CHOICE
97 } LIST_TYPE;
99 /// Default constructor.
100 ACEXML_Element_Tree_List_Node ();
102 /// Destructor.
103 virtual ~ACEXML_Element_Tree_List_Node ();
105 /// Insert a new ACEXML_Element_Tree_Node into the list.
106 int insert (ACEXML_Element_Tree_Node *node);
108 /// Get/set the type of list.
109 LIST_TYPE get ();
110 int set (LIST_TYPE type);
112 virtual void dump ();
114 ACE_ALLOC_HOOK_DECLARE;
115 protected:
116 LIST_TYPE type_;
118 ACEXML_Element_Tree_Node *head_;
120 ACEXML_Element_Tree_Node *tail_;
122 ACEXML_Element_Tree_List_Node *pop_next_;
126 * @class ACEXML_Element_Tree_List_Stack Element_Tree.h "parser/debug_validator/Element_Tree.h"
128 * @brief A class for managing a stack of ACEXML_Element_Tree_List_Node's.
130 * @sa ACEXML_Element_Tree_List_Node
132 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_List_Stack
134 public:
135 ACEXML_Element_Tree_List_Stack ();
137 void push (ACEXML_Element_Tree_List_Node *n);
139 ACEXML_Element_Tree_List_Node *pop ();
141 ACEXML_Element_Tree_List_Node *top ();
143 int empty ();
145 ACE_ALLOC_HOOK_DECLARE;
147 protected:
148 ACEXML_Element_Tree_List_Node *top_;
151 #if defined (__ACEXML_INLINE__)
152 # include "ACEXML/parser/debug_validator/Element_Tree.inl"
153 #endif /* __ACEXML_INLINE__ */
155 #include /**/ "ace/post.h"
157 #endif /* _ACEXML_ELEMENT_TREE_H_ */