Entity_Manager.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Entity_Manager.h
00006  *
00007  *  Entity_Manager.h,v 1.10 2004/01/09 00:50:35 kitty Exp
00008  *
00009  *  @author Nanbor Wang <nanbor@cs.wustl.edu>
00010  *  @author Krishnakumar B <kitty@cs.wustl.edu>
00011  */
00012 //=============================================================================
00013 
00014 #ifndef ACEXML_ENTITY_MANAGER_H
00015 #define ACEXML_ENTITY_MANAGER_H
00016 
00017 #include /**/ "ace/pre.h"
00018 #include "ACEXML/parser/parser/Parser_export.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 #pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "ACEXML/common/XML_Types.h"
00025 #include "ace/Hash_Map_Manager.h"
00026 #include "ace/Null_Mutex.h"
00027 
00028 typedef ACE_Hash_Map_Entry<ACEXML_String,
00029                            ACEXML_String> ACEXML_ENTITY_ENTRY;
00030 
00031 typedef ACE_Hash_Map_Manager_Ex<ACEXML_String,
00032                                 ACEXML_String,
00033                                 ACE_Hash<ACEXML_String>,
00034                                 ACE_Equal_To<ACEXML_String>,
00035                                 ACE_Null_Mutex> ACEXML_ENTITIES_MANAGER;
00036 
00037 typedef ACE_Hash_Map_Iterator_Ex<ACEXML_String,
00038                                  ACEXML_String,
00039                                  ACE_Hash<ACEXML_String>,
00040                                  ACE_Equal_To<ACEXML_String>,
00041                                  ACE_Null_Mutex> ACEXML_ENTITIES_MANAGER_ITER;
00042 
00043 typedef ACE_Hash_Map_Reverse_Iterator_Ex<ACEXML_String,
00044                                          ACEXML_String,
00045                                          ACE_Hash<ACEXML_String>,
00046                                          ACE_Equal_To<ACEXML_String>,
00047                                          ACE_Null_Mutex> ACEXML_ENTITIES_MANAGER_REVERSE_ITER;
00048 
00049 typedef ACE_Hash_Map_Bucket_Iterator<ACEXML_String,
00050                                      ACEXML_String,
00051                                      ACE_Hash<ACEXML_String>,
00052                                      ACE_Equal_To<ACEXML_String>,
00053                                      ACE_Null_Mutex> ACEXML_ENTITY_ENTRY_ITERATOR;
00054 
00055 /**
00056  * @class ACEXML_Entity_Manager Entity_Manager.h "ACEXML/parser/parser/Entity_Manager.h"
00057  *
00058  * @brief Class to manage and resolve entity references.
00059  *
00060  * @todo Fill in details for this class.
00061  */
00062 class ACEXML_PARSER_Export ACEXML_Entity_Manager
00063 {
00064 public:
00065   /// Default constructor.
00066   ACEXML_Entity_Manager (void);
00067 
00068   /// Destructor.
00069   ~ACEXML_Entity_Manager (void);
00070 
00071   /// Add a new entity declaration.
00072   int add_entity (const ACEXML_Char *ref, const ACEXML_Char *value);
00073 
00074   /// Resolve an entity reference.
00075   const ACEXML_Char* resolve_entity (const ACEXML_Char *ref);
00076 
00077   /// Resolve an entity reference and return the tuple of @c systemId and
00078   /// @c publicId
00079   int resolve_entity (const ACEXML_Char* ref, ACEXML_Char*& systemId,
00080                       ACEXML_Char*& publicId);
00081 
00082   /// Number of items in the Entity Manager
00083   size_t size(void) const;
00084 
00085   /// Reset the state
00086   int reset (void);
00087 
00088 private:
00089   ACEXML_ENTITIES_MANAGER* entities_;
00090   bool init_;
00091 
00092 };
00093 
00094 #if defined (__ACEXML_INLINE__)
00095 # include "ACEXML/parser/parser/Entity_Manager.i"
00096 #endif /* __ACEXML_INLINE__ */
00097 
00098 #include /**/ "ace/post.h"
00099 
00100 #endif /* ACEXML_ENTITY_MANAGER_H */

Generated on Thu Nov 9 11:45:36 2006 for ACEXML by doxygen 1.3.6