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

Parse_Node.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Parse_Node.h
00006  *
00007  *  $Id: Parse_Node.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Doug Schmidt
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_PARSE_NODE_H
00015 #define ACE_PARSE_NODE_H
00016 
00017 #include "ace/pre.h"
00018 
00019 #include "ace/DLL.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #if (ACE_USES_CLASSIC_SVC_CONF == 1)
00026 
00027 #include "ace/Service_Types.h"
00028 
00029 
00030 
00031 /// Forward declarations.
00032 class ACE_Service_Config;
00033 
00034 
00035 /**
00036  * @class ACE_Parse_Node
00037  *
00038  * @brief Provide the base of the object hierarchy that defines the parse
00039  * tree of Service Nodes.
00040  *
00041  * @note This class is only meant for INTERNAL use by ACE.
00042  */
00043 class ACE_Parse_Node
00044 {
00045 public:
00046   ACE_Parse_Node (void);
00047   ACE_EXPLICIT ACE_Parse_Node (const ACE_TCHAR *name);
00048   virtual ~ACE_Parse_Node (void);
00049 
00050   ACE_Parse_Node *link (void) const;
00051   void link (ACE_Parse_Node *);
00052   virtual void apply (int & yyerrno) = 0;
00053 
00054   const ACE_TCHAR *name (void) const;
00055   void print (void) const;
00056 
00057   /// Dump the state of an object.
00058   void dump (void) const;
00059 
00060   /// Declare the dynamic allocation hooks.
00061   ACE_ALLOC_HOOK_DECLARE;
00062 
00063 private:
00064   const ACE_TCHAR *name_;
00065   ACE_Parse_Node *next_;
00066 };
00067 
00068 /**
00069  * @class ACE_Suspend_Node
00070  *
00071  * @brief Suspend a Service Node.
00072  *
00073  * @note This class is only meant for INTERNAL use by ACE.
00074  */
00075 class ACE_Suspend_Node : public ACE_Parse_Node
00076 {
00077 public:
00078   ACE_Suspend_Node (const ACE_TCHAR *name);
00079   ~ACE_Suspend_Node (void);
00080 
00081   virtual void apply (int & yyerrno);
00082 
00083   /// Dump the state of an object.
00084   void dump (void) const;
00085 
00086   /// Declare the dynamic allocation hooks.
00087   ACE_ALLOC_HOOK_DECLARE;
00088 };
00089 
00090 /**
00091  * @class ACE_Resume_Node
00092  *
00093  * @brief Resume a Service Node.
00094  *
00095  * @note This class is only meant for INTERNAL use by ACE.
00096  */
00097 class ACE_Resume_Node : public ACE_Parse_Node
00098 {
00099 public:
00100   ACE_Resume_Node (const ACE_TCHAR *name);
00101   ~ACE_Resume_Node (void);
00102 
00103   virtual void apply (int & yyerrno);
00104 
00105   /// Dump the state of an object.
00106   void dump (void) const;
00107 
00108   /// Declare the dynamic allocation hooks.
00109   ACE_ALLOC_HOOK_DECLARE;
00110 };
00111 
00112 /**
00113  * @class ACE_Remove_Node
00114  *
00115  * @brief Remove a Service Node.
00116  *
00117  * @note This class is only meant for INTERNAL use by ACE.
00118  */
00119 class ACE_Remove_Node : public ACE_Parse_Node
00120 {
00121 public:
00122   ACE_Remove_Node (const ACE_TCHAR *name);
00123   ~ACE_Remove_Node (void);
00124 
00125   virtual void apply (int & yyerrno);
00126 
00127   /// Dump the state of an object.
00128   void dump (void) const;
00129 
00130   /// Declare the dynamic allocation hooks.
00131   ACE_ALLOC_HOOK_DECLARE;
00132 };
00133 
00134 /**
00135  * @class ACE_Static_Node
00136  *
00137  * @brief Handle a statically linked node.
00138  *
00139  * @note This class is only meant for INTERNAL use by ACE.
00140  */
00141 class ACE_Static_Node : public ACE_Parse_Node
00142 {
00143 public:
00144   ACE_Static_Node (const ACE_TCHAR *name, ACE_TCHAR *params = 0);
00145   virtual ~ACE_Static_Node (void);
00146 
00147   virtual void apply (int & yyerrno);
00148   virtual const ACE_Service_Type *record (void) const;
00149   ACE_TCHAR *parameters (void) const;
00150 
00151   /// Dump the state of an object.
00152   void dump (void) const;
00153 
00154   /// Declare the dynamic allocation hooks.
00155   ACE_ALLOC_HOOK_DECLARE;
00156 
00157 private:
00158   /// "Command-line" parameters.
00159   ACE_TCHAR *parameters_;
00160 };
00161 
00162 /**
00163  * @class ACE_Dynamic_Node
00164  *
00165  * @brief Handle a dynamically linked node.
00166  *
00167  * @note This class is only meant for INTERNAL use by ACE.
00168  */
00169 class ACE_Dynamic_Node : public ACE_Static_Node
00170 {
00171 public:
00172   ACE_Dynamic_Node (const ACE_Service_Type *, ACE_TCHAR *params);
00173   virtual ~ACE_Dynamic_Node (void);
00174 
00175   virtual const ACE_Service_Type *record (void) const;
00176   virtual void apply (int & yyerrno);
00177 
00178   /// Dump the state of an object.
00179   void dump (void) const;
00180 
00181   /// Declare the dynamic allocation hooks.
00182   ACE_ALLOC_HOOK_DECLARE;
00183 
00184 private:
00185   /// Pointer to a descriptor that describes this node.
00186   const ACE_Service_Type *record_;
00187 };
00188 
00189 /**
00190  * @class ACE_Stream_Node
00191  *
00192  * @brief Handle a Stream.
00193  *
00194  * @note This class is only meant for INTERNAL use by ACE.
00195  */
00196 class ACE_Stream_Node : public ACE_Parse_Node
00197 {
00198 public:
00199   ACE_Stream_Node (const ACE_Static_Node *, const ACE_Parse_Node *);
00200   virtual ~ACE_Stream_Node (void);
00201 
00202   virtual void apply (int & yyerrno);
00203 
00204   /// Dump the state of an object.
00205   void dump (void) const;
00206 
00207   /// Declare the dynamic allocation hooks.
00208   ACE_ALLOC_HOOK_DECLARE;
00209 
00210 private:
00211   /// Linked list of modules that are part of the stream.
00212   const ACE_Static_Node *node_;
00213   const ACE_Parse_Node *mods_;
00214 };
00215 
00216 /**
00217  * @class ACE_Location_Node
00218  *
00219  * @brief Keep track of where a shared library is located.
00220  *
00221  * @note This class is only meant for INTERNAL use by ACE.
00222  */
00223 class ACE_Location_Node
00224 {
00225 public:
00226   ACE_Location_Node (void);
00227   virtual void *symbol (int & yyerrno,
00228                         ACE_Service_Object_Exterminator * = 0) = 0;
00229   virtual void set_symbol (void *h);
00230   const ACE_DLL &dll (void);
00231   const ACE_TCHAR *pathname (void) const;
00232   void pathname (const ACE_TCHAR *h);
00233   int dispose (void) const;
00234 
00235   virtual ~ACE_Location_Node (void);
00236 
00237   /// Dump the state of an object.
00238   void dump (void) const;
00239 
00240   /// Declare the dynamic allocation hooks.
00241   ACE_ALLOC_HOOK_DECLARE;
00242 
00243 protected:
00244   int open_dll (int & yyerrno);
00245 
00246   /// Pathname to the shared library we are working on.
00247   const ACE_TCHAR *pathname_;
00248 
00249   /**
00250    * Flag indicating whether the Service_Object generated by this
00251    * Location Node should be deleted or not
00252    * (ACE_Service_Type::DELETE_OBJ.)
00253    */
00254   int must_delete_;
00255 
00256   /// The open shared library.
00257   ACE_DLL dll_;
00258 
00259   /// Symbol that we've obtained from the shared library.
00260   void *symbol_;
00261 };
00262 
00263 /**
00264  * @class ACE_Object_Node
00265  *
00266  * @brief Keeps track of the symbol name for a shared object.
00267  *
00268  * @note This class is only meant for INTERNAL use by ACE.
00269  */
00270 class ACE_Object_Node : public ACE_Location_Node
00271 {
00272 public:
00273   ACE_Object_Node (const ACE_TCHAR *pathname, const ACE_TCHAR *obj_name);
00274   virtual void *symbol (int & yyerrno,
00275                         ACE_Service_Object_Exterminator * = 0);
00276   virtual ~ACE_Object_Node (void);
00277 
00278   /// Dump the state of an object.
00279   void dump (void) const;
00280 
00281   /// Declare the dynamic allocation hooks.
00282   ACE_ALLOC_HOOK_DECLARE;
00283 
00284 private:
00285   /// Name of the object that we're parsing.
00286   const ACE_TCHAR *object_name_;
00287 };
00288 
00289 /**
00290  * @class ACE_Function_Node
00291  *
00292  * @brief Keeps track of the symbol name of for a shared function.
00293  *
00294  * @note This class is only meant for INTERNAL use by ACE.
00295  */
00296 class ACE_Function_Node : public ACE_Location_Node
00297 {
00298 public:
00299   ACE_Function_Node (const ACE_TCHAR *pathname, const ACE_TCHAR *func_name);
00300   virtual void *symbol (int & yyerrno,
00301                         ACE_Service_Object_Exterminator *gobbler = 0);
00302   virtual ~ACE_Function_Node (void);
00303 
00304   /// Dump the state of an object.
00305   void dump (void) const;
00306 
00307   /// Declare the dynamic allocation hooks.
00308   ACE_ALLOC_HOOK_DECLARE;
00309 
00310 private:
00311   /// Name of the function that we're parsing.
00312   const ACE_TCHAR *function_name_;
00313 };
00314 
00315 /**
00316  * @class ACE_Dummy_Node
00317  *
00318  * @brief I forget why this is here... ;-)
00319  *
00320  * @note This class is only meant for INTERNAL use by ACE.
00321  */
00322 class ACE_Dummy_Node : public ACE_Parse_Node
00323 {
00324 public:
00325   ACE_Dummy_Node (const ACE_Static_Node *, const ACE_Parse_Node *);
00326   ~ACE_Dummy_Node (void);
00327   virtual void apply (int & yyerrno);
00328 
00329   /// Dump the state of an object.
00330   void dump (void) const;
00331 
00332   /// Declare the dynamic allocation hooks.
00333   ACE_ALLOC_HOOK_DECLARE;
00334 
00335 private:
00336   /// Linked list of modules that we're dealing with.
00337   const ACE_Static_Node *node_;
00338   const ACE_Parse_Node *mods_;
00339 };
00340 
00341 /**
00342  * @class ACE_Static_Function_Node
00343  *
00344  * @brief Keeps track of the symbol name for a function that is not
00345  * linked in from a DLL, but is statically linked with the
00346  * application.
00347  *
00348  * @note This class is only meant for INTERNAL use by ACE.
00349  */
00350 class ACE_Static_Function_Node : public ACE_Location_Node
00351 {
00352 public:
00353   ACE_EXPLICIT ACE_Static_Function_Node (const ACE_TCHAR *func_name);
00354   virtual void *symbol (int & yyerrno,
00355                         ACE_Service_Object_Exterminator * = 0);
00356   virtual ~ACE_Static_Function_Node (void);
00357 
00358   /// Dump the state of an object.
00359   void dump (void) const;
00360 
00361   /// Declare the dynamic allocation hooks.
00362   ACE_ALLOC_HOOK_DECLARE;
00363 
00364 private:
00365   /// Name of the function that we're parsing.
00366   const ACE_TCHAR *function_name_;
00367 };
00368 
00369 
00370 #if defined (__ACE_INLINE__)
00371 #include "ace/Parse_Node.i"
00372 #endif /* __ACE_INLINE__ */
00373 
00374 /// Global variable used to communicate between the parser and the main
00375 /// program.
00376 extern ACE_Service_Config *ace_this_svc;
00377 
00378 #endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */
00379 
00380 #include "ace/post.h"
00381 
00382 #endif  /* ACE_PARSE_NODE_H */

Generated on Mon Jun 16 11:20:48 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002