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

Debug_Attributes_Builder.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Debug_Attributes_Builder.h
00006  *
00007  *  $Id: Debug_Attributes_Builder.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_DEBUG_ATTRIBUTES_BUILDER_H_
00013 #define _ACEXML_DEBUG_ATTRIBUTES_BUILDER_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/Attributes_Def_Builder.h"
00023 #include "ace/Hash_Map_Manager.h"
00024 #include "ace/Unbounded_Queue.h"
00025 
00026 typedef ACE_Unbounded_Queue<ACEXML_String> ACEXML_STRING_QUEUE;
00027 typedef ACE_Unbounded_Queue_Iterator<ACEXML_String> ACEXML_STRING_QUEUE_ITERATOR;
00028 
00029 /**
00030  * @class ACEXML_Debug_Attribute_Builder Debug_Attributes_Builder.h "parser/debug_validator/Debug_Attributes_Builder.h"
00031  *
00032  * This class prints out the Attribute definition for debugging purpose.
00033  */
00034 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Debug_Attribute_Builder
00035   : public ACEXML_Attribute_Def_Builder
00036 {
00037 public:
00038   ACEXML_Debug_Attribute_Builder ();
00039 
00040   ACEXML_Debug_Attribute_Builder (const ACEXML_Debug_Attribute_Builder &rhs);
00041 
00042   virtual ~ACEXML_Debug_Attribute_Builder ();
00043 
00044   /**
00045    * Specify the name of the attribute.
00046    */
00047   virtual int setName (const ACEXML_Char *n);
00048   virtual const ACEXML_Char *getName (void);
00049 
00050   /**
00051    * Set the attribute type.
00052    */
00053   virtual int setAttType (const ATT_TYPE type ACEXML_ENV_ARG_DECL)
00054      ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00055 
00056   /**
00057    * Insert an element for NOTATION or ENUMERATION type attribute.
00058    */
00059   virtual int insertList (const ACEXML_Char *Name ACEXML_ENV_ARG_DECL)
00060     ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00061 
00062   /**
00063    * Set default attribute declaration.
00064    */
00065   virtual int setDefault (const DEFAULT_DECL def,
00066                           const ACEXML_Char *value ACEXML_ENV_ARG_DECL)
00067     ACE_THROW_SPEC ((ACEXML_SAXException))
00068     ;
00069 
00070   /**
00071    * Check validity of the current attribute definition being built.
00072    *
00073    * @retval 0 if the attribute is not a valid combo.
00074    */
00075   virtual int validAttr (void);
00076 
00077 
00078   /**
00079    * Dump the content of the attribute definition.
00080    */
00081   virtual void dump (void);
00082 private:
00083   /// Attribute name.
00084   ACEXML_String name_;
00085 
00086   /// Type of attribute.
00087   ATT_TYPE type_;
00088 
00089   /// Default value type.
00090   DEFAULT_DECL default_decl_;
00091 
00092   /// Default attribute value.
00093   ACEXML_String default_value_;
00094 
00095   /// Holds a queue of enumerated attribute values.
00096   ACEXML_STRING_QUEUE att_value_queue_;
00097 };
00098 
00099 typedef ACE_Hash_Map_Entry<ACEXML_String,
00100                            ACEXML_Debug_Attribute_Builder> ACEXML_ATT_MAP_ENTRY;
00101 
00102 typedef ACE_Hash_Map_Manager_Ex <ACEXML_String,
00103                                  ACEXML_Debug_Attribute_Builder,
00104                                  ACE_Hash<ACEXML_String>,
00105                                  ACE_Equal_To<ACEXML_String>,
00106                                  ACE_Null_Mutex> ACEXML_ATT_MAP;
00107 
00108 typedef ACE_Hash_Map_Iterator_Ex<ACEXML_String,
00109                                  ACEXML_Debug_Attribute_Builder,
00110                                  ACE_Hash<ACEXML_String>,
00111                                  ACE_Equal_To<ACEXML_String>,
00112                                  ACE_Null_Mutex> ACEXML_ATT_MAP_ITER;
00113 
00114 typedef ACE_Hash_Map_Reverse_Iterator_Ex<ACEXML_String,
00115                                          ACEXML_Debug_Attribute_Builder,
00116                                          ACE_Hash<ACEXML_String>,
00117                                          ACE_Equal_To<ACEXML_String>,
00118                                          ACE_Null_Mutex> ACEXML_ATT_MAP_REVERSE_ITER;
00119 
00120 /**
00121  * @class ACEXML_Debug_Attributes_Builder Debug_Attributes_Builder.h "parser/debug_validator/Debug_Attributes_Builder.h"
00122  *
00123  * This class prints out Attribute definitions for debugging purpose.
00124  */
00125 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Debug_Attributes_Builder
00126   : public ACEXML_Attributes_Def_Builder
00127 {
00128 public:
00129   ACEXML_Debug_Attributes_Builder ();
00130 
00131   virtual ~ACEXML_Debug_Attributes_Builder ();
00132 
00133   /**
00134    * Set the element name that the attribute builder applies.
00135    *
00136    * @retval 0 if valid, -1 otherwise.
00137    */
00138   virtual int setElement (const ACEXML_Char *namespaceURI,
00139                           const ACEXML_Char *localName,
00140                           const ACEXML_Char *qName ACEXML_ENV_ARG_DECL)
00141         ACE_THROW_SPEC ((ACEXML_SAXException))
00142     ;
00143 
00144   /**
00145    * Acquire an Attribute_Builder.
00146    */
00147   virtual ACEXML_Attribute_Def_Builder *getAttribute_Def_Builder ();
00148 
00149   /**
00150    * Add a definition for one attribute.
00151    */
00152   virtual int insertAttribute (ACEXML_Attribute_Def_Builder *def ACEXML_ENV_ARG_DECL);
00153 
00154 
00155   /**
00156    * Dump the content of the attribute definition.
00157    */
00158   virtual void dump (void);
00159 protected:
00160   /// The name of the element type these attributes applied.
00161   ACEXML_String element_name_;
00162 
00163   /// Collection of attributes.
00164   ACEXML_ATT_MAP attributes_;
00165 };
00166 
00167 
00168 #include "ace/post.h"
00169 
00170 #endif /* _ACEXML_DEBUG_ATTRIBUTES_BUILDER_H_ */

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