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