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

Svcconf_Handler.h

Go to the documentation of this file.
00001 // $Id: Svcconf_Handler.h,v 1.1.1.1 2003/02/21 18:36:32 chad Exp $
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Svcconf_Handler.h
00006  *
00007  *  $Id: Svcconf_Handler.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 
00013 #ifndef ACEXML_SVCCONF_HANDLER_H
00014 #define ACEXML_SVCCONF_HANDLER_H
00015 
00016 #include "ACEXML/common/DefaultHandler.h"
00017 
00018 class ACE_Parsed_Info
00019 {
00020 public:
00021   typedef enum {
00022     MODULE_TYPE,
00023     SERVICE_OBJECT_TYPE,
00024     STREAM_TYPE,
00025     INVALID_TYPE
00026   } Service_Type;
00027 
00028   ACE_Parsed_Info ();
00029   ~ACE_Parsed_Info ();
00030 
00031   /**
00032    * Set/get name of a parsed entity.
00033    */
00034   int name (const ACEXML_Char *n);
00035   const ACEXML_Char *name (void);
00036 
00037   /**
00038    * Set/get type of a dynamic node.
00039    */
00040   int service_type (Service_Type type);
00041   Service_Type service_type (void);
00042 
00043   /**
00044    * Set/Get active status.
00045    */
00046   int active (int a);
00047   int active (void);
00048 
00049   /**
00050    * Set/get initializer path.
00051    */
00052   int path (const ACEXML_Char *n);
00053   const ACEXML_Char *path (void);
00054 
00055   /**
00056    * Set/get initializer init function.
00057    */
00058   int init_func (const ACEXML_Char *n);
00059   const ACEXML_Char *init_func (void);
00060 
00061   /**
00062    * Set/get initializer init parameter.
00063    */
00064   int init_params (const ACEXML_Char *n);
00065   const ACEXML_Char *init_params (void);
00066 
00067   /**
00068    * Reset Parsed_Info.
00069    */
00070   void reset (void);
00071 
00072 protected:
00073   ACEXML_Char *name_;
00074   Service_Type service_type_;
00075   int active_;
00076   ACEXML_Char *path_;
00077   ACEXML_Char *init_func_;
00078   ACEXML_Char *init_params_;
00079 };
00080 
00081 /**
00082  * @class ACEXML_Svcconf_Handler
00083  *
00084  * @brief ACEXML_Svcconf_Handler is an example SAX event handler.
00085  *
00086  * This SAX event handler try to regenerate the XML document it
00087  * reads with correct indentation.
00088  */
00089 class ACEXML_Svcconf_Handler : public ACEXML_DefaultHandler
00090 {
00091 public:
00092   /*
00093    * Default constructor.
00094    */
00095   ACEXML_Svcconf_Handler (void);
00096 
00097   /*
00098    * Default destructor.
00099    */
00100   virtual ~ACEXML_Svcconf_Handler (void);
00101 
00102   // Methods inherit from ACEXML_ContentHandler.
00103 
00104   /*
00105    * Receive notification of character data.
00106    */
00107   virtual void characters (const ACEXML_Char *ch,
00108                            int start,
00109                            int length ACEXML_ENV_ARG_DECL)
00110         ACE_THROW_SPEC ((ACEXML_SAXException))
00111     ;
00112 
00113   /*
00114    * Receive notification of the end of a document.
00115    */
00116   virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL)
00117         ACE_THROW_SPEC ((ACEXML_SAXException))
00118     ;
00119 
00120   /*
00121    * Receive notification of the end of an element.
00122    */
00123   virtual void endElement (const ACEXML_Char *namespaceURI,
00124                            const ACEXML_Char *localName,
00125                            const ACEXML_Char *qName ACEXML_ENV_ARG_DECL)
00126         ACE_THROW_SPEC ((ACEXML_SAXException))
00127     ;
00128 
00129   /*
00130    * End the scope of a prefix-URI mapping.
00131    */
00132   virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL)
00133         ACE_THROW_SPEC ((ACEXML_SAXException))
00134     ;
00135 
00136   /*
00137    * Receive notification of ignorable whitespace in element content.
00138    */
00139   virtual void ignorableWhitespace (const ACEXML_Char *ch,
00140                                     int start,
00141                                     int length ACEXML_ENV_ARG_DECL)
00142         ACE_THROW_SPEC ((ACEXML_SAXException))
00143     ;
00144 
00145   /*
00146    * Receive notification of a processing instruction.
00147    */
00148   virtual void processingInstruction (const ACEXML_Char *target,
00149                                       const ACEXML_Char *data ACEXML_ENV_ARG_DECL)
00150         ACE_THROW_SPEC ((ACEXML_SAXException))
00151     ;
00152 
00153   /*
00154    * Receive an object for locating the origin of SAX document events.
00155    */
00156   virtual void setDocumentLocator (ACEXML_Locator *) ;
00157 
00158   /*
00159    * Receive notification of a skipped entity.
00160    */
00161   virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL)
00162         ACE_THROW_SPEC ((ACEXML_SAXException))
00163     ;
00164 
00165   /*
00166    * Receive notification of the beginning of a document.
00167    */
00168   virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL)
00169         ACE_THROW_SPEC ((ACEXML_SAXException))
00170     ;
00171 
00172   /*
00173    * Receive notification of the beginning of an element.
00174    */
00175   virtual void startElement (const ACEXML_Char *namespaceURI,
00176                              const ACEXML_Char *localName,
00177                              const ACEXML_Char *qName,
00178                              ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL)
00179         ACE_THROW_SPEC ((ACEXML_SAXException))
00180     ;
00181 
00182   /*
00183    * Begin the scope of a prefix-URI Namespace mapping.
00184    */
00185   virtual void startPrefixMapping (const ACEXML_Char *prefix,
00186                                    const ACEXML_Char *uri ACEXML_ENV_ARG_DECL)
00187         ACE_THROW_SPEC ((ACEXML_SAXException))
00188     ;
00189 
00190   // *** Methods inherit from ACEXML_DTDHandler.
00191 
00192   /*
00193    * Receive notification of a notation declaration event.
00194    */
00195   virtual void notationDecl (const ACEXML_Char *name,
00196                              const ACEXML_Char *publicId,
00197                              const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL)
00198         ACE_THROW_SPEC ((ACEXML_SAXException))
00199     ;
00200 
00201   /*
00202    * Receive notification of an unparsed entity declaration event.
00203    */
00204   virtual void unparsedEntityDecl (const ACEXML_Char *name,
00205                                    const ACEXML_Char *publicId,
00206                                    const ACEXML_Char *systemId,
00207                                    const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL)
00208         ACE_THROW_SPEC ((ACEXML_SAXException))
00209     ;
00210 
00211   // Methods inherit from ACEXML_EnitityResolver.
00212 
00213   /*
00214    * Allow the application to resolve external entities.
00215    */
00216   virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId,
00217                                              const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL)
00218         ACE_THROW_SPEC ((ACEXML_SAXException))
00219     ;
00220 
00221   // Methods inherit from ACEXML_ErrorHandler.
00222 
00223   /*
00224    * Receive notification of a recoverable error.
00225    */
00226   virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL)
00227         ACE_THROW_SPEC ((ACEXML_SAXException))
00228     ;
00229 
00230   /*
00231    * Receive notification of a non-recoverable error.
00232    */
00233   virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL)
00234         ACE_THROW_SPEC ((ACEXML_SAXException))
00235     ;
00236 
00237   /*
00238    * Receive notification of a warning.
00239    */
00240   virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL)
00241         ACE_THROW_SPEC ((ACEXML_SAXException))
00242     ;
00243 
00244 protected:
00245   /**
00246    * Get the only attribute in <stream> or <streamdef>.
00247    */
00248   int get_stream_id (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL);
00249 
00250   /**
00251    * Get the only attribute in <resume>, <suspend>, <remove>
00252    */
00253   int get_id (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL);
00254 
00255   /**
00256    * Get the dynamic tag attributes.
00257    */
00258   int get_dynamic_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL);
00259 
00260   /**
00261    * Get the initializer tag attributes.
00262    */
00263   int get_initializer_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL);
00264 
00265   /**
00266    * Get the static tag attributes.
00267    */
00268   int get_static_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL);
00269 
00270 private:
00271   /// We are parsing a stream definition
00272   int in_stream_def_;
00273 
00274   /// We are defining a steam module
00275   int in_module_;
00276 
00277   ACE_Parsed_Info parsed_info_;
00278 
00279   ACE_Parsed_Info stream_info_;
00280 };
00281 
00282 #if defined (__ACEXML_INLINE__)
00283 # include "Svcconf_Handler.i"
00284 #endif /* __ACEXML_INLINE__ */
00285 #endif /* ACEXML_SVCCONF_HANDLER_H */

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