Parse_Node.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Parse_Node.h
00006  *
00007  *  Parse_Node.h,v 4.36 2006/04/28 14:05:43 jeliazkov_i 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/config-all.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/DLL.h"
00028 #include "ace/Svc_Conf.h"
00029 
00030 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00031 
00032 /// Forward declarations.
00033 class ACE_Service_Config;
00034 class ACE_Service_Type;
00035 
00036 /**
00037  * @class ACE_Parse_Node
00038  *
00039  * @brief Provide the base of the object hierarchy that defines the parse
00040  * tree of Service Nodes.
00041  *
00042  * @note This class is only meant for INTERNAL use by ACE.
00043  *
00044  * @internal
00045  */
00046 class ACE_Parse_Node
00047 {
00048 public:
00049   ACE_Parse_Node (void);
00050   explicit ACE_Parse_Node (const ACE_TCHAR *name);
00051   virtual ~ACE_Parse_Node (void);
00052 
00053   ACE_Parse_Node *link (void) const;
00054   void link (ACE_Parse_Node *);
00055 
00056   /// Will update the yyereno member and/or the corresponding configuration
00057   virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno) = 0;
00058 
00059   const ACE_TCHAR *name (void) const;
00060   void print (void) const;
00061 
00062   /// Dump the state of an object.
00063   void dump (void) const;
00064 
00065   /// Declare the dynamic allocation hooks.
00066   ACE_ALLOC_HOOK_DECLARE;
00067 
00068 private:
00069   const ACE_TCHAR *name_;
00070   ACE_Parse_Node *next_;
00071 
00072 private:
00073   ACE_UNIMPLEMENTED_FUNC (ACE_Parse_Node (const ACE_Parse_Node&))
00074   ACE_UNIMPLEMENTED_FUNC (ACE_Parse_Node& operator= (const ACE_Parse_Node&))
00075 };
00076 
00077 /**
00078  * @class ACE_Suspend_Node
00079  *
00080  * @brief Suspend a Service Node.
00081  *
00082  * @note This class is only meant for INTERNAL use by ACE.
00083  *
00084  * @internal
00085  */
00086 class ACE_Suspend_Node : public ACE_Parse_Node
00087 {
00088 public:
00089   ACE_Suspend_Node (const ACE_TCHAR *name);
00090   ~ACE_Suspend_Node (void);
00091 
00092   virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00093 
00094   /// Dump the state of an object.
00095   void dump (void) const;
00096 
00097   /// Declare the dynamic allocation hooks.
00098   ACE_ALLOC_HOOK_DECLARE;
00099 
00100 private:
00101   ACE_UNIMPLEMENTED_FUNC (ACE_Suspend_Node (const ACE_Suspend_Node&))
00102   ACE_UNIMPLEMENTED_FUNC (ACE_Suspend_Node& operator= (const ACE_Suspend_Node&))
00103 };
00104 
00105 /**
00106  * @class ACE_Resume_Node
00107  *
00108  * @brief Resume a Service Node.
00109  *
00110  * @note This class is only meant for INTERNAL use by ACE.
00111  *
00112  * @internal
00113  */
00114 class ACE_Resume_Node : public ACE_Parse_Node
00115 {
00116 public:
00117   ACE_Resume_Node (const ACE_TCHAR *name);
00118   ~ACE_Resume_Node (void);
00119 
00120   virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00121 
00122   /// Dump the state of an object.
00123   void dump (void) const;
00124 
00125   /// Declare the dynamic allocation hooks.
00126   ACE_ALLOC_HOOK_DECLARE;
00127 
00128 private:
00129   ACE_UNIMPLEMENTED_FUNC (ACE_Resume_Node (const ACE_Resume_Node&))
00130   ACE_UNIMPLEMENTED_FUNC (ACE_Resume_Node& operator= (const ACE_Resume_Node&))
00131 };
00132 
00133 /**
00134  * @class ACE_Remove_Node
00135  *
00136  * @brief Remove a Service Node.
00137  *
00138  * @note This class is only meant for INTERNAL use by ACE.
00139  *
00140  * @internal
00141  */
00142 class ACE_Remove_Node : public ACE_Parse_Node
00143 {
00144 public:
00145   ACE_Remove_Node (const ACE_TCHAR *name);
00146   ~ACE_Remove_Node (void);
00147 
00148   virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00149 
00150   /// Dump the state of an object.
00151   void dump (void) const;
00152 
00153   /// Declare the dynamic allocation hooks.
00154   ACE_ALLOC_HOOK_DECLARE;
00155 
00156 private:
00157   ACE_UNIMPLEMENTED_FUNC (ACE_Remove_Node (const ACE_Remove_Node&))
00158   ACE_UNIMPLEMENTED_FUNC (ACE_Remove_Node& operator= (const ACE_Remove_Node&))
00159 };
00160 
00161 /**
00162  * @class ACE_Static_Node
00163  *
00164  * @brief Handle a statically linked node.
00165  *
00166  * @note This class is only meant for INTERNAL use by ACE.
00167  *
00168  * @internal
00169  */
00170 class ACE_Static_Node : public ACE_Parse_Node
00171 {
00172 public:
00173   ACE_Static_Node (const ACE_TCHAR *name, ACE_TCHAR *params = 0);
00174   virtual ~ACE_Static_Node (void);
00175 
00176   virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00177   virtual const ACE_Service_Type *record (const ACE_Service_Gestalt *g) const;
00178 
00179   ACE_TCHAR *parameters (void) const;
00180 
00181   /// Dump the state of an object.
00182   void dump (void) const;
00183 
00184   /// Declare the dynamic allocation hooks.
00185   ACE_ALLOC_HOOK_DECLARE;
00186 
00187 private:
00188   /// "Command-line" parameters.
00189   ACE_TCHAR *parameters_;
00190 
00191 private:
00192   ACE_UNIMPLEMENTED_FUNC (ACE_Static_Node (const ACE_Static_Node&))
00193   ACE_UNIMPLEMENTED_FUNC (ACE_Static_Node& operator= (const ACE_Static_Node&))
00194 };
00195 
00196 
00197 class ACE_Service_Type_Factory;
00198 
00199 /**
00200  * @class ACE_Dynamic_Node
00201  *
00202  * @brief Handle a dynamically linked node.
00203  *
00204  * @note This class is only meant for INTERNAL use by ACE.
00205  *
00206  * @internal
00207  */
00208 class ACE_Dynamic_Node : public ACE_Static_Node
00209 {
00210 public:
00211   ACE_Dynamic_Node (ACE_Service_Type_Factory const *, ACE_TCHAR *params);
00212 
00213   //  ACE_Dynamic_Node (const ACE_Service_Type *, ACE_TCHAR *params);
00214   virtual ~ACE_Dynamic_Node (void);
00215 
00216   //  virtual const ACE_Service_Type *record (void) const;
00217   virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00218 
00219   /// Dump the state of an object.
00220   void dump (void) const;
00221 
00222   /// Declare the dynamic allocation hooks.
00223   ACE_ALLOC_HOOK_DECLARE;
00224 
00225 private:
00226   /// Pointer to a descriptor that describes this node.
00227   ACE_Auto_Ptr<const ACE_Service_Type_Factory> factory_;
00228 
00229 private:
00230   ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Node (const ACE_Dynamic_Node&))
00231   ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Node& operator= (const ACE_Dynamic_Node&))
00232 };
00233 
00234 /**
00235  * @class ACE_Stream_Node
00236  *
00237  * @brief Handle a Stream.
00238  *
00239  * @note This class is only meant for INTERNAL use by ACE.
00240  *
00241  * @internal
00242  */
00243 class ACE_Stream_Node : public ACE_Parse_Node
00244 {
00245 public:
00246   ACE_Stream_Node (const ACE_Static_Node *, const ACE_Parse_Node *);
00247   virtual ~ACE_Stream_Node (void);
00248 
00249   virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00250 
00251   /// Dump the state of an object.
00252   void dump (void) const;
00253 
00254   /// Declare the dynamic allocation hooks.
00255   ACE_ALLOC_HOOK_DECLARE;
00256 
00257 private:
00258   /// Linked list of modules that are part of the stream.
00259   const ACE_Static_Node *node_;
00260   const ACE_Parse_Node *mods_;
00261 
00262 private:
00263   ACE_UNIMPLEMENTED_FUNC (ACE_Stream_Node (const ACE_Stream_Node&))
00264   ACE_UNIMPLEMENTED_FUNC (ACE_Stream_Node& operator= (const ACE_Stream_Node&))
00265 };
00266 
00267 /**
00268  * @class ACE_Dummy_Node
00269  *
00270  * @brief I forget why this is here... ;-)
00271  * @brief Used in a special case of static STREAM definintion
00272  *
00273  * @note This class is only meant for INTERNAL use by ACE.
00274  */
00275 class ACE_Dummy_Node : public ACE_Parse_Node
00276 {
00277 public:
00278   ACE_Dummy_Node (const ACE_Static_Node *, const ACE_Parse_Node *);
00279   ~ACE_Dummy_Node (void);
00280 
00281   virtual void apply (ACE_Service_Gestalt *cfg, int &yyerrno);
00282 
00283   /// Dump the state of an object.
00284   void dump (void) const;
00285 
00286   /// Declare the dynamic allocation hooks.
00287   ACE_ALLOC_HOOK_DECLARE;
00288 
00289 private:
00290   /// Linked list of modules that we're dealing with.
00291   const ACE_Static_Node *node_;
00292   const ACE_Parse_Node *mods_;
00293 
00294 private:
00295   ACE_UNIMPLEMENTED_FUNC (ACE_Dummy_Node (const ACE_Dummy_Node&))
00296   ACE_UNIMPLEMENTED_FUNC (ACE_Dummy_Node& operator= (const ACE_Dummy_Node&))
00297 };
00298 
00299 /**
00300  * @class ACE_Location_Node
00301  *
00302  * @brief Keep track of where a shared library is located.
00303  *
00304  * @note This class is only meant for INTERNAL use by ACE.
00305  *
00306  * @internal
00307  */
00308 class ACE_Location_Node
00309 {
00310 public:
00311   ACE_Location_Node (void);
00312   const ACE_DLL &dll (void);
00313   const ACE_TCHAR *pathname (void) const;
00314   void pathname (const ACE_TCHAR *h);
00315   int dispose (void) const;
00316 
00317   virtual ~ACE_Location_Node (void);
00318   virtual void set_symbol (void *h);
00319 
00320   /// Will update the yyerrno member and/or corresponding configuration
00321   /// repository
00322   virtual void *symbol (ACE_Service_Gestalt *cfgptr,
00323                         int &yyerrno,
00324                         ACE_Service_Object_Exterminator * = 0) = 0;
00325 
00326   /// Dump the state of an object.
00327   void dump (void) const;
00328 
00329   /// Declare the dynamic allocation hooks.
00330   ACE_ALLOC_HOOK_DECLARE;
00331 
00332 protected:
00333   int open_dll (int & yyerrno);
00334 
00335   /// Pathname to the shared library we are working on.
00336   const ACE_TCHAR *pathname_;
00337 
00338   /**
00339    * Flag indicating whether the Service_Object generated by this
00340    * Location Node should be deleted or not
00341    * (ACE_Service_Type::DELETE_OBJ.)
00342    */
00343   int must_delete_;
00344 
00345   /// The open shared library.
00346   ACE_DLL dll_;
00347 
00348   /// Symbol that we've obtained from the shared library.
00349   void *symbol_;
00350 
00351 private:
00352   ACE_UNIMPLEMENTED_FUNC (ACE_Location_Node (const ACE_Location_Node&))
00353   ACE_UNIMPLEMENTED_FUNC (ACE_Location_Node& operator= (const ACE_Location_Node&))
00354 };
00355 
00356 /**
00357  * @class ACE_Object_Node
00358  *
00359  * @brief Keeps track of the symbol name for a shared object.
00360  *
00361  * @note This class is only meant for INTERNAL use by ACE.
00362  *
00363  * @internal
00364  */
00365 class ACE_Object_Node : public ACE_Location_Node
00366 {
00367 public:
00368   ACE_Object_Node (const ACE_TCHAR *pathname, const ACE_TCHAR *obj_name);
00369   virtual void *symbol (ACE_Service_Gestalt *config,
00370                         int &yyerrno,
00371                         ACE_Service_Object_Exterminator * = 0);
00372   virtual ~ACE_Object_Node (void);
00373 
00374   /// Dump the state of an object.
00375   void dump (void) const;
00376 
00377   /// Declare the dynamic allocation hooks.
00378   ACE_ALLOC_HOOK_DECLARE;
00379 
00380 private:
00381   /// Name of the object that we're parsing.
00382   const ACE_TCHAR *object_name_;
00383 
00384 private:
00385   ACE_UNIMPLEMENTED_FUNC (ACE_Object_Node (const ACE_Object_Node&))
00386   ACE_UNIMPLEMENTED_FUNC (ACE_Object_Node& operator= (const ACE_Object_Node&))
00387 };
00388 
00389 /**
00390  * @class ACE_Function_Node
00391  *
00392  * @brief Keeps track of the symbol name of for a shared function.
00393  *
00394  * @note This class is only meant for INTERNAL use by ACE.
00395  *
00396  * @internal
00397  */
00398 class ACE_Function_Node : public ACE_Location_Node
00399 {
00400 public:
00401   ACE_Function_Node (const ACE_TCHAR *pathname, const ACE_TCHAR *func_name);
00402   virtual void *symbol (ACE_Service_Gestalt *config,
00403                         int &yyerrno,
00404                         ACE_Service_Object_Exterminator *gobbler = 0);
00405   virtual ~ACE_Function_Node (void);
00406 
00407   /// Dump the state of an object.
00408   void dump (void) const;
00409 
00410   /// Declare the dynamic allocation hooks.
00411   ACE_ALLOC_HOOK_DECLARE;
00412 
00413 private:
00414 
00415   /// Return mangled function name that takes into account ACE
00416   /// versioned namespace.
00417   /**
00418    * This function embeds the ACE versioned namespace name into the
00419    * original function name if versioned namespace support has been
00420    * enabled and the original function name conforms to the ACE
00421    * Service Object factory function naming conventions.  For example
00422    * "@c _make_Foo" becomes "@c make_ACE_5_4_7_Foo".
00423    * @par
00424    * If versioned namespace support is disabled or the factory
00425    * function name does conform to ACE conventions, no mangling will
00426    * occur and the verbatim function name is returned.
00427    *
00428    * @return Function name that takes into account versioned namespace
00429    *         name.  Caller is responsible for calling operator
00430    *         delete[] or ACE::strdelete() on the returned string.
00431    */
00432   ACE_TCHAR * make_func_name (ACE_TCHAR const * func_name);
00433 
00434 private:
00435 
00436   /// Name of the function that we're parsing.
00437   const ACE_TCHAR *function_name_;
00438 
00439 private:
00440   ACE_UNIMPLEMENTED_FUNC (ACE_Function_Node (const ACE_Function_Node&))
00441   ACE_UNIMPLEMENTED_FUNC (ACE_Function_Node& operator= (const ACE_Function_Node&))
00442 };
00443 
00444 /**
00445  * @class ACE_Static_Function_Node
00446  *
00447  * @brief Keeps track of the symbol name for a function that is not
00448  * linked in from a DLL, but is statically linked with the
00449  * application.
00450  *
00451  * @note This class is only meant for INTERNAL use by ACE.
00452  *
00453  * @internal
00454  */
00455 class ACE_Static_Function_Node : public ACE_Location_Node
00456 {
00457 public:
00458   explicit ACE_Static_Function_Node (const ACE_TCHAR *func_name);
00459   virtual void *symbol (ACE_Service_Gestalt *config,
00460                         int &yyerrno,
00461                         ACE_Service_Object_Exterminator * = 0);
00462   virtual ~ACE_Static_Function_Node (void);
00463 
00464   /// Dump the state of an object.
00465   void dump (void) const;
00466 
00467   /// Declare the dynamic allocation hooks.
00468   ACE_ALLOC_HOOK_DECLARE;
00469 
00470 private:
00471   /// Name of the function that we're parsing.
00472   const ACE_TCHAR *function_name_;
00473 
00474 private:
00475   ACE_UNIMPLEMENTED_FUNC (ACE_Static_Function_Node (const ACE_Static_Function_Node&))
00476   ACE_UNIMPLEMENTED_FUNC (ACE_Static_Function_Node& operator= (const ACE_Static_Function_Node&))
00477 };
00478 
00479 ACE_END_VERSIONED_NAMESPACE_DECL
00480 
00481 #endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */
00482 
00483 #include /**/ "ace/post.h"
00484 
00485 #endif  /* ACE_PARSE_NODE_H */

Generated on Thu Nov 9 09:41:59 2006 for ACE by doxygen 1.3.6