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

ACE_Function_Node Class Reference

Keeps track of the symbol name of for a shared function. More...

#include <Parse_Node.h>

Inheritance diagram for ACE_Function_Node:

Inheritance graph
[legend]
Collaboration diagram for ACE_Function_Node:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Function_Node (const ACE_TCHAR *pathname, const ACE_TCHAR *func_name)
virtual void * symbol (int &yyerrno, ACE_Service_Object_Exterminator *gobbler=0)
virtual ~ACE_Function_Node (void)
void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Private Attributes

const ACE_TCHARfunction_name_
 Name of the function that we're parsing. More...


Detailed Description

Keeps track of the symbol name of for a shared function.

Note:
This class is only meant for INTERNAL use by ACE.

Definition at line 296 of file Parse_Node.h.


Constructor & Destructor Documentation

ACE_Function_Node::ACE_Function_Node const ACE_TCHAR   pathname,
const ACE_TCHAR   func_name
 

Definition at line 462 of file Parse_Node.cpp.

References ACE_TCHAR, ACE_TRACE, ACE_Location_Node::must_delete_, ACE_Location_Node::pathname, and ACE::strnew.

00464   : function_name_ (ACE::strnew (func_name))
00465 {
00466   ACE_TRACE ("ACE_Function_Node::ACE_Function_Node");
00467   this->pathname (ACE::strnew (path));
00468   this->must_delete_ = 1;
00469 }

ACE_Function_Node::~ACE_Function_Node void    [virtual]
 

Definition at line 523 of file Parse_Node.cpp.

References ACE_TCHAR, ACE_TRACE, function_name_, and ACE_Location_Node::pathname_.

00524 {
00525   ACE_TRACE ("ACE_Function_Node::~ACE_Function_Node");
00526   delete[] ACE_const_cast (ACE_TCHAR *, function_name_);
00527   delete[] ACE_const_cast (ACE_TCHAR *, pathname_);
00528 }


Member Function Documentation

void ACE_Function_Node::dump void    const
 

Dump the state of an object.

Reimplemented from ACE_Location_Node.

Definition at line 457 of file Parse_Node.cpp.

References ACE_TRACE.

00458 {
00459   ACE_TRACE ("ACE_Function_Node::dump");
00460 }

void * ACE_Function_Node::symbol int &    yyerrno,
ACE_Service_Object_Exterminator   gobbler = 0
[virtual]
 

Implements ACE_Location_Node.

Definition at line 472 of file Parse_Node.cpp.

References ACE_ERROR, ACE_ERROR_RETURN, ACE_LIB_TEXT, ACE_Service_Object_Exterminator, ACE_TCHAR, ACE_TRACE, ACE_Location_Node::dll_, ACE_DLL::error, LM_ERROR, ACE_Location_Node::open_dll, ACE_DLL::symbol, and ACE_Location_Node::symbol_.

00474 {
00475   typedef ACE_Service_Object *(*ACE_Service_Factory_Ptr)
00476     (ACE_Service_Object_Exterminator *);
00477 
00478   ACE_TRACE ("ACE_Function_Node::symbol");
00479   if (this->open_dll (yyerrno) == 0)
00480     {
00481       ACE_Service_Factory_Ptr func = 0;
00482       this->symbol_ = 0;
00483 
00484       // Locate the factory function <function_name> in the shared
00485       // object.
00486       ACE_TCHAR *function_name = ACE_const_cast (ACE_TCHAR *,
00487                                                  this->function_name_);
00488       void *func_p = this->dll_.symbol (function_name);
00489       if (func_p == 0)
00490         {
00491           yyerrno++;
00492 
00493           if (this->symbol_ == 0)
00494             {
00495               yyerrno++;
00496 
00497               ACE_TCHAR *errmsg = this->dll_.error ();
00498               ACE_ERROR ((LM_ERROR,
00499                           ACE_LIB_TEXT ("ACE_DLL::symbol failed for function %s: %s\n"),
00500                           function_name,
00501                           errmsg ? errmsg :
00502                                    ACE_LIB_TEXT ("no error reported")));
00503               return 0;
00504             }
00505         }
00506       ptrdiff_t temp_p = ACE_reinterpret_cast (ptrdiff_t, func_p);
00507       func = ACE_reinterpret_cast (ACE_Service_Factory_Ptr, temp_p);
00508       // Invoke the factory function and record it's return value.
00509       this->symbol_ = (*func) (gobbler);
00510 
00511       if (this->symbol_ == 0)
00512         {
00513           yyerrno++;
00514           ACE_ERROR_RETURN ((LM_ERROR,
00515                              ACE_LIB_TEXT ("%p\n"),
00516                              this->function_name_),
00517                             0);
00518         }
00519     }
00520   return this->symbol_;
00521 }


Member Data Documentation

ACE_Function_Node::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_Location_Node.

Definition at line 308 of file Parse_Node.h.

const ACE_TCHAR* ACE_Function_Node::function_name_ [private]
 

Name of the function that we're parsing.

Definition at line 312 of file Parse_Node.h.

Referenced by ~ACE_Function_Node.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:48:09 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002