#include <Parse_Node.h>
Inheritance diagram for ACE_Static_Function_Node:


Public Methods | |
| ACE_EXPLICIT | ACE_Static_Function_Node (const ACE_TCHAR *func_name) |
| virtual void * | symbol (int &yyerrno, ACE_Service_Object_Exterminator *=0) |
| virtual | ~ACE_Static_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_TCHAR * | function_name_ |
| Name of the function that we're parsing. More... | |
Definition at line 350 of file Parse_Node.h.
|
|
Definition at line 578 of file Parse_Node.cpp. References ACE_TCHAR, ACE_TRACE, and ACE_Location_Node::must_delete_.
00579 : function_name_ (ACE::strnew (func_name)) 00580 { 00581 ACE_TRACE ("ACE_Static_Function_Node::ACE_Static_Function_Node"); 00582 this->must_delete_ = 1; 00583 } |
|
|
Definition at line 641 of file Parse_Node.cpp. References ACE_TCHAR, and ACE_TRACE.
|
|
|
Dump the state of an object.
Reimplemented from ACE_Location_Node. Definition at line 573 of file Parse_Node.cpp. References ACE_TRACE.
00574 {
00575 ACE_TRACE ("ACE_Static_Function_Node::dump");
00576 }
|
|
||||||||||||
|
Implements ACE_Location_Node. Definition at line 586 of file Parse_Node.cpp. References ACE_ERROR_RETURN, ACE_LIB_TEXT, ACE_Service_Object_Exterminator, ACE_TCHAR, ACE_TRACE, ACE_Unbounded_Set_Iterator::advance, ACE_Static_Svc_Descriptor::alloc_, LM_ERROR, ACE_Static_Svc_Descriptor::name_, ACE_Unbounded_Set_Iterator::next, ACE_Service_Config::static_svcs, ACE_OS_String::strcmp, and ACE_Location_Node::symbol_.
00588 {
00589 ACE_TRACE ("ACE_Static_Function_Node::symbol");
00590
00591 void *(*func)(ACE_Service_Object_Exterminator *) = 0;
00592 this->symbol_ = 0;
00593
00594 // Locate the factory function <function_name> in the statically
00595 // linked svcs.
00596
00597 ACE_Static_Svc_Descriptor **ssdp = 0;
00598 ACE_STATIC_SVCS &svcs = *ACE_Service_Config::static_svcs ();
00599 ACE_TCHAR *function_name = ACE_const_cast (ACE_TCHAR *, this->function_name_);
00600
00601 for (ACE_STATIC_SVCS_ITERATOR iter (svcs);
00602 iter.next (ssdp) != 0;
00603 iter.advance ())
00604 {
00605 ACE_Static_Svc_Descriptor *ssd = *ssdp;
00606 if (ACE_OS::strcmp (ssd->name_,
00607 function_name) == 0)
00608 func = (void *(*)(ACE_Service_Object_Exterminator*)) ssd->alloc_;
00609 }
00610
00611 if (func == 0)
00612 {
00613 yyerrno++;
00614
00615 if (this->symbol_ == 0)
00616 {
00617 yyerrno++;
00618
00619 ACE_ERROR_RETURN ((LM_ERROR,
00620 ACE_LIB_TEXT ("no static service registered for function %s\n"),
00621 function_name),
00622 0);
00623 }
00624 }
00625
00626 // Invoke the factory function and record it's return value.
00627 this->symbol_ = (*func) (gobbler);
00628
00629 if (this->symbol_ == 0)
00630 {
00631 yyerrno++;
00632 ACE_ERROR_RETURN ((LM_ERROR,
00633 ACE_LIB_TEXT ("%p\n"),
00634 this->function_name_),
00635 0);
00636 }
00637
00638 return this->symbol_;
00639 }
|
|
|
Declare the dynamic allocation hooks.
Reimplemented from ACE_Location_Node. Definition at line 362 of file Parse_Node.h. |
|
|
Name of the function that we're parsing.
Definition at line 366 of file Parse_Node.h. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002