1 #include "ace/Parse_Node.h"
3 #if (ACE_USES_CLASSIC_SVC_CONF == 1)
5 #include "ace/Service_Config.h"
6 #include "ace/Service_Repository.h"
7 #include "ace/Service_Types.h"
11 #include "ace/OS_NS_string.h"
17 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
19 ACE_ALLOC_HOOK_DEFINE (ACE_Stream_Node
)
21 // Provide the class hierarchy that defines the parse tree of Service
25 ACE_Stream_Node::dump () const
27 #if defined (ACE_HAS_DUMP)
28 ACE_TRACE ("ACE_Stream_Node::dump");
29 #endif /* ACE_HAS_DUMP */
33 ACE_Stream_Node::apply (ACE_Service_Gestalt
*config
, int &yyerrno
)
35 ACE_TRACE ("ACE_Stream_Node::apply");
37 const ACE_Service_Type
*sst
= this->node_
->record (config
);
39 const_cast<ACE_Static_Node
*> (this->node_
)->apply (config
, yyerrno
);
41 if (yyerrno
!= 0) return;
43 sst
= this->node_
->record (config
);
45 dynamic_cast<ACE_Stream_Type
*> (const_cast<ACE_Service_Type_Impl
*> (sst
->type ()));
47 // The modules were linked as popped off the yacc stack, so they're in
48 // reverse order from the way they should be pushed onto the stream.
49 // So traverse mods_ and and reverse the list, then iterate over it to push
50 // the modules in the stream in the correct order.
51 #if defined (ACE_HAS_ALLOC_HOOKS)
52 typedef std::list
<const ACE_Static_Node
*,
53 ACE_Allocator_Std_Adapter
<const ACE_Static_Node
*> > list_t
;
55 using list_t
= std::list
<const ACE_Static_Node
*>;
56 #endif /* ACE_HAS_ALLOC_HOOKS */
58 const ACE_Static_Node
*module
;
59 for (module
= dynamic_cast<const ACE_Static_Node
*> (this->mods_
);
61 module
= dynamic_cast<ACE_Static_Node
*> (module
->link()))
62 mod_list
.push_front (module
);
64 list_t::const_iterator iter
;
65 for (iter
= mod_list
.begin (); iter
!= mod_list
.end (); ++iter
)
68 ACE_ARGV
args (module
->parameters ());
70 const ACE_Service_Type
*mst
= module
->record (config
);
72 const_cast<ACE_Static_Node
*> (module
)->apply (config
, yyerrno
);
78 ACELIB_ERROR ((LM_ERROR
,
79 ACE_TEXT ("dynamic initialization failed for Module %s\n"),
83 continue; // Don't try anything else with this one
86 ACE_Module_Type
const * const mt1
=
87 static_cast <ACE_Module_Type
const *> (module
->record (config
)->type());
89 ACE_Module_Type
*mt
= const_cast<ACE_Module_Type
*>(mt1
);
91 if (st
->push (mt
) == -1)
95 ACELIB_ERROR ((LM_ERROR
,
96 ACE_TEXT ("dynamic initialization failed for Stream %s\n"),
97 this->node_
->name ()));
106 ACELIB_DEBUG ((LM_DEBUG
,
107 ACE_TEXT ("(%P|%t) Did stream on %s, error = %d\n"),
108 this->node_
->name (),
110 #endif /* ACE_NLOGGING */
113 ACE_ALLOC_HOOK_DEFINE (ACE_Parse_Node
)
116 ACE_Parse_Node::dump () const
118 #if defined (ACE_HAS_DUMP)
119 ACE_TRACE ("ACE_Parse_Node::dump");
120 #endif /* ACE_HAS_DUMP */
124 ACE_Parse_Node::name () const
126 ACE_TRACE ("ACE_Parse_Node::name");
131 ACE_Parse_Node::link () const
133 ACE_TRACE ("ACE_Parse_Node::link");
138 ACE_Parse_Node::link (ACE_Parse_Node
*n
)
140 ACE_TRACE ("ACE_Parse_Node::link");
142 // Find the last list entry (if any) ...
143 ACE_Parse_Node
*t
= this;
144 while (t
->next_
!= 0)
147 // ... and insert n there.
151 ACE_Stream_Node::ACE_Stream_Node (const ACE_Static_Node
*str_ops
,
152 const ACE_Parse_Node
*str_mods
)
153 : ACE_Parse_Node ((str_ops
== 0 ? ACE_TEXT ("<unknown>") : str_ops
->name ())),
157 ACE_TRACE ("ACE_Stream_Node::ACE_Stream_Node");
161 ACE_Stream_Node::~ACE_Stream_Node ()
163 ACE_TRACE ("ACE_Stream_Node::~ACE_Stream_Node");
164 ACE_Static_Node
*n
= const_cast<ACE_Static_Node
*> (this->node_
);
166 ACE_Parse_Node
*m
= const_cast<ACE_Parse_Node
*> (this->mods_
);
170 ACE_Parse_Node::ACE_Parse_Node ()
174 ACE_TRACE ("ACE_Parse_Node::ACE_Parse_Node");
178 ACE_Parse_Node::ACE_Parse_Node (const ACE_TCHAR
*nm
)
179 : name_ (ACE::strnew (nm
)),
182 ACE_TRACE ("ACE_Parse_Node::ACE_Parse_Node");
186 ACE_Parse_Node::print () const
188 ACE_TRACE ("ACE_Parse_Node::print");
190 ACELIB_DEBUG ((LM_DEBUG
,
191 ACE_TEXT ("svc = %s\n"),
195 this->next_
->print ();
199 ACE_Parse_Node::~ACE_Parse_Node ()
201 ACE_TRACE ("ACE_Parse_Node::~ACE_Parse_Node");
202 #if defined (ACE_HAS_ALLOC_HOOKS)
203 ACE_Allocator::instance()->free(const_cast<ACE_TCHAR
*> (this->name_
));
205 delete[] const_cast<ACE_TCHAR
*> (this->name_
);
206 #endif /* ACE_HAS_ALLOC_HOOKS */
210 ACE_ALLOC_HOOK_DEFINE (ACE_Suspend_Node
)
213 ACE_Suspend_Node::dump () const
215 #if defined (ACE_HAS_DUMP)
216 ACE_TRACE ("ACE_Suspend_Node::dump");
217 #endif /* ACE_HAS_DUMP */
220 ACE_Suspend_Node::ACE_Suspend_Node (const ACE_TCHAR
*name
)
221 : ACE_Parse_Node (name
)
223 ACE_TRACE ("ACE_Suspend_Node::ACE_Suspend_Node");
226 ACE_Suspend_Node::~ACE_Suspend_Node ()
230 ACE_ALLOC_HOOK_DEFINE (ACE_Resume_Node
)
233 ACE_Resume_Node::dump () const
235 #if defined (ACE_HAS_DUMP)
236 ACE_TRACE ("ACE_Resume_Node::dump");
237 #endif /* ACE_HAS_DUMP */
240 ACE_Resume_Node::ACE_Resume_Node (const ACE_TCHAR
*name
)
241 : ACE_Parse_Node (name
)
243 ACE_TRACE ("ACE_Resume_Node::ACE_Resume_Node");
246 ACE_Resume_Node::~ACE_Resume_Node ()
251 ACE_Suspend_Node::apply (ACE_Service_Gestalt
*config
, int &yyerrno
)
253 ACE_TRACE ("ACE_Suspend_Node::apply");
255 if (config
->suspend (this->name ()) == -1)
260 ACELIB_DEBUG ((LM_DEBUG
,
261 ACE_TEXT ("did suspend on %s, error = %d\n"),
264 #endif /* ACE_NLOGGING */
268 ACE_Resume_Node::apply (ACE_Service_Gestalt
*config
, int &yyerrno
)
270 ACE_TRACE ("ACE_Resume_Node::apply");
272 if (config
->resume (this->name ()) == -1)
277 ACELIB_DEBUG ((LM_DEBUG
,
278 ACE_TEXT ("did resume on %s, error = %d\n"),
281 #endif /* ACE_NLOGGING */
284 ACE_ALLOC_HOOK_DEFINE (ACE_Remove_Node
)
287 ACE_Remove_Node::dump () const
289 #if defined (ACE_HAS_DUMP)
290 ACE_TRACE ("ACE_Remove_Node::dump");
291 #endif /* ACE_HAS_DUMP */
294 ACE_Remove_Node::ACE_Remove_Node (const ACE_TCHAR
*name
)
295 : ACE_Parse_Node (name
)
297 ACE_TRACE ("ACE_Remove_Node::ACE_Remove_Node");
300 ACE_Remove_Node::~ACE_Remove_Node ()
305 ACE_Remove_Node::apply (ACE_Service_Gestalt
*config
, int &yyerrno
)
307 ACE_TRACE ("ACE_Remove_Node::apply");
309 if (config
->remove (this->name ()) == -1)
314 ACELIB_DEBUG ((LM_DEBUG
,
315 ACE_TEXT ("ACE (%P|%t) Remove_Node::apply")
316 ACE_TEXT (" - did remove on %s, error = %d\n"),
319 #endif /* ACE_NLOGGING */
323 ACE_Dynamic_Node::ACE_Dynamic_Node (ACE_Service_Type_Factory
const *stf
,
325 : ACE_Static_Node (stf
->name (), parms
)
328 ACE_TRACE ("ACE_Dynamic_Node::ACE_Dynamic_Node");
332 ACE_Dynamic_Node::apply (ACE_Service_Gestalt
*config
, int &yyerrno
)
334 ACE_TRACE ("ACE_Dynamic_Node::apply");
336 if (config
->initialize (this->factory_
.get (),
337 this->parameters ()) == -1)
342 ACELIB_DEBUG ((LM_DEBUG
,
343 ACE_TEXT ("ACE (%P|%t) Dynamic_Node::apply")
344 ACE_TEXT (" - Did dynamic on %s (yyerrno=%d)\n"),
347 #endif /* ACE_NLOGGING */
350 ACE_ALLOC_HOOK_DEFINE (ACE_Dynamic_Node
)
353 ACE_Dynamic_Node::dump () const
355 #if defined (ACE_HAS_DUMP)
356 ACE_TRACE ("ACE_Dynamic_Node::dump");
357 #endif /* ACE_HAS_DUMP */
360 ACE_Dynamic_Node::~ACE_Dynamic_Node ()
362 ACE_TRACE ("ACE_Dynamic_Node::~ACE_Dynamic_Node");
365 ACE_ALLOC_HOOK_DEFINE (ACE_Static_Node
)
368 ACE_Static_Node::dump () const
370 #if defined (ACE_HAS_DUMP)
371 ACE_TRACE ("ACE_Static_Node::dump");
372 #endif /* ACE_HAS_DUMP */
375 ACE_Static_Node::ACE_Static_Node (const ACE_TCHAR
*nm
,
377 : ACE_Parse_Node (nm
),
378 parameters_ (ACE::strnew (params
))
380 ACE_TRACE ("ACE_Static_Node::ACE_Static_Node");
383 const ACE_Service_Type
*
384 ACE_Static_Node::record (const ACE_Service_Gestalt
*config
) const
386 ACE_TRACE ("ACE_Static_Node::record");
387 ACE_Service_Type
*sr
= 0;
389 if (config
->find (this->name (), (const ACE_Service_Type
**) &sr
) == -1)
396 ACE_Static_Node::parameters () const
398 ACE_TRACE ("ACE_Static_Node::parameters");
399 return this->parameters_
;
403 ACE_Static_Node::apply (ACE_Service_Gestalt
*config
, int &yyerrno
)
405 ACE_TRACE ("ACE_Static_Node::apply");
406 if (config
->initialize (this->name (),
407 this->parameters ()) == -1)
412 ACELIB_DEBUG ((LM_DEBUG
,
413 ACE_TEXT ("ACE (%P|%t) Static_Node::apply -")
414 ACE_TEXT (" Did static on %s (yyerrno=%d)\n"),
417 #endif /* ACE_NLOGGING */
420 ACE_Static_Node::~ACE_Static_Node ()
422 ACE_TRACE ("ACE_Static_Node::~ACE_Static_Node");
423 #if defined (ACE_HAS_ALLOC_HOOKS)
424 ACE_Allocator::instance()->free(this->parameters_
);
426 delete[] this->parameters_
;
427 #endif /* ACE_HAS_ALLOC_HOOKS */
431 ACE_ALLOC_HOOK_DEFINE (ACE_Location_Node
)
434 ACE_Location_Node::dump () const
436 #if defined (ACE_HAS_DUMP)
437 ACE_TRACE ("ACE_Location_Node::dump");
438 #endif /* ACE_HAS_DUMP */
441 ACE_Location_Node::ACE_Location_Node ()
447 ACE_TRACE ("ACE_Location_Node::ACE_Location_Node");
450 ACE_Location_Node::~ACE_Location_Node ()
452 ACE_TRACE ("ACE_Location_Node::~ACE_Location_Node");
456 ACE_Location_Node::dll ()
462 ACE_Location_Node::pathname () const
464 ACE_TRACE ("ACE_Location_Node::pathname");
465 return this->pathname_
;
469 ACE_Location_Node::pathname (const ACE_TCHAR
*p
)
471 ACE_TRACE ("ACE_Location_Node::pathname");
476 ACE_Location_Node::dispose () const
478 ACE_TRACE ("ACE_Location_Node::dispose");
479 return this->must_delete_
;
483 ACE_Location_Node::open_dll (int & yyerrno
)
485 ACE_TRACE ("ACE_Location_Node::open_dll");
489 ACELIB_DEBUG ((LM_DEBUG
,
490 ACE_TEXT ("ACE (%P|%t) LN::open_dll - path=%s\n"),
492 #endif /* ACE_NLOGGING */
494 if (-1 == this->dll_
.open (this->pathname ()))
501 ACE_TCHAR
*errmsg
= this->dll_
.error ();
502 ACELIB_ERROR ((LM_ERROR
,
503 ACE_TEXT ("ACE (%P|%t) LN::open_dll - Failed to open %s: %s\n"),
505 errmsg
? errmsg
: ACE_TEXT ("no error reported")));
507 #endif /* ACE_NLOGGING */
516 ACE_Location_Node::set_symbol (void *s
)
518 ACE_TRACE ("ACE_Location_Node::set_symbol");
522 ACE_ALLOC_HOOK_DEFINE (ACE_Object_Node
)
525 ACE_Object_Node::dump () const
527 #if defined (ACE_HAS_DUMP)
528 ACE_TRACE ("ACE_Object_Node::dump");
529 #endif /* ACE_HAS_DUMP */
532 ACE_Object_Node::ACE_Object_Node (const ACE_TCHAR
*path
,
533 const ACE_TCHAR
*obj_name
)
534 : object_name_ (ACE::strnew (obj_name
))
536 ACE_TRACE ("ACE_Object_Node::ACE_Object_Node");
537 this->pathname (ACE::strnew (path
));
538 this->must_delete_
= 0;
542 ACE_Object_Node::symbol (ACE_Service_Gestalt
*,
544 ACE_Service_Object_Exterminator
*)
546 ACE_TRACE ("ACE_Object_Node::symbol");
547 if (this->open_dll (yyerrno
) == 0)
549 ACE_TCHAR
*object_name
= const_cast<ACE_TCHAR
*> (this->object_name_
);
551 this->symbol_
= this->dll_
.symbol (object_name
);
552 if (this->symbol_
== 0)
559 ACE_TCHAR
*errmsg
= this->dll_
.error ();
560 ACELIB_ERROR ((LM_ERROR
,
561 ACE_TEXT ("ACE (%P|%t) DLL::symbol -")
562 ACE_TEXT (" Failed for object %s: %s\n"),
564 errmsg
? errmsg
: ACE_TEXT ("no error reported")));
566 #endif /* ACE_NLOGGING */
571 return this->symbol_
;
577 ACE_Object_Node::~ACE_Object_Node ()
579 ACE_TRACE ("ACE_Object_Node::~ACE_Object_Node");
580 #if defined (ACE_HAS_ALLOC_HOOKS)
581 ACE_Allocator::instance()->free(const_cast<ACE_TCHAR
*> (this->object_name_
));
583 delete[] const_cast<ACE_TCHAR
*> (this->object_name_
);
584 #endif /* ACE_HAS_ALLOC_HOOKS */
587 ACE_ALLOC_HOOK_DEFINE (ACE_Function_Node
)
590 ACE_Function_Node::dump () const
592 #if defined (ACE_HAS_DUMP)
593 ACE_TRACE ("ACE_Function_Node::dump");
594 #endif /* ACE_HAS_DUMP */
597 ACE_Function_Node::ACE_Function_Node (const ACE_TCHAR
*path
,
598 const ACE_TCHAR
*func_name
)
599 : function_name_ (make_func_name (func_name
))
601 ACE_TRACE ("ACE_Function_Node::ACE_Function_Node");
602 this->pathname (ACE::strnew (path
));
603 this->must_delete_
= 1;
607 ACE_Function_Node::make_func_name (ACE_TCHAR
const * func_name
)
609 // Preprocessor symbols will not be expanded if they are
610 // stringified. Force the preprocessor to expand them during the
611 // argument prescan by calling a macro that itself calls another
612 // that performs the actual stringification.
613 #if defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1
614 # define ACE_MAKE_VERSIONED_NAMESPACE_NAME_STRING_IMPL(NAME) #NAME
615 # define ACE_MAKE_VERSIONED_NAMESPACE_NAME_STRING(NAME) ACE_MAKE_VERSIONED_NAMESPACE_NAME_STRING_IMPL(NAME)
616 # define ACE_VERSIONED_NAMESPACE_NAME_STRING ACE_MAKE_VERSIONED_NAMESPACE_NAME_STRING(ACE_VERSIONED_NAMESPACE_NAME)
618 // Check if function is using the ACE naming convention. If so,
619 // it is likely that the ACE factory function macros
620 // (e.g. ACE_FACTORY_DECLARE) were used to declare and define it, so
621 // mangle the function name to include the ACE versioned namespace
622 // name as is done in the ACE macros. Otherwise, leave the function
625 static ACE_TCHAR
const make_prefix
[] = ACE_TEXT ("_make_");
626 static size_t const make_prefix_len
=
627 sizeof (make_prefix
) / sizeof (make_prefix
[0]) - 1;
629 if (ACE_OS::strncmp (make_prefix
, func_name
, make_prefix_len
) == 0)
631 static ACE_TCHAR
const versioned_namespace_name
[] =
632 ACE_TEXT (ACE_VERSIONED_NAMESPACE_NAME_STRING
) ACE_TEXT("_") ;
634 // Null terminator included in versioned_namespace_name_len since
635 // it is static constant.
636 static size_t const versioned_namespace_name_len
=
637 sizeof (versioned_namespace_name
)
638 / sizeof (versioned_namespace_name
[0]); // - 1;
641 ACE_OS::strlen (func_name
)
642 + versioned_namespace_name_len
;
643 // + 1; // Null terminator.
645 ACE_TCHAR
* mangled_func_name
;
646 ACE_NEW_RETURN (mangled_func_name
,
650 std::unique_ptr
<ACE_TCHAR
[]> safe (mangled_func_name
);
652 ACE_OS::snprintf (mangled_func_name
,
656 versioned_namespace_name
,
657 func_name
+ make_prefix_len
);
659 return safe
.release ();
661 #endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */
663 return ACE::strnew (func_name
);
667 ACE_Function_Node::symbol (ACE_Service_Gestalt
*,
669 ACE_Service_Object_Exterminator
*gobbler
)
671 using ACE_Service_Factory_Ptr
= ACE_Service_Object
*(*)(ACE_Service_Object_Exterminator
*);
673 ACE_TRACE ("ACE_Function_Node::symbol");
674 if (this->open_dll (yyerrno
) == 0)
678 // Locate the factory function <function_name> in the shared
680 ACE_TCHAR
* const function_name
=
681 const_cast<ACE_TCHAR
*> (this->function_name_
);
683 void * const func_p
= this->dll_
.symbol (function_name
);
691 ACE_TCHAR
* const errmsg
= this->dll_
.error ();
692 ACELIB_ERROR ((LM_ERROR
,
693 ACE_TEXT ("DLL::symbol failed for function %s: ")
696 errmsg
? errmsg
: ACE_TEXT ("no error reported")));
698 #endif /* ACE_NLOGGING */
703 intptr_t const temp_p
= reinterpret_cast<intptr_t> (func_p
);
705 ACE_Service_Factory_Ptr func
= reinterpret_cast<ACE_Service_Factory_Ptr
> (temp_p
);
707 // Invoke the factory function and record it's return value.
708 this->symbol_
= (*func
) (gobbler
);
710 if (this->symbol_
== 0)
715 ACELIB_ERROR ((LM_ERROR
,
717 this->function_name_
));
722 return this->symbol_
;
725 ACE_Function_Node::~ACE_Function_Node ()
727 ACE_TRACE ("ACE_Function_Node::~ACE_Function_Node");
728 #if defined (ACE_HAS_ALLOC_HOOKS)
729 ACE_Allocator::instance()->free(const_cast<ACE_TCHAR
*> (function_name_
));
730 ACE_Allocator::instance()->free(const_cast<ACE_TCHAR
*> (pathname_
));
732 delete[] const_cast<ACE_TCHAR
*> (function_name_
);
733 delete[] const_cast<ACE_TCHAR
*> (pathname_
);
734 #endif /* ACE_HAS_ALLOC_HOOKS */
737 ACE_ALLOC_HOOK_DEFINE (ACE_Dummy_Node
)
740 ACE_Dummy_Node::dump () const
742 #if defined (ACE_HAS_DUMP)
743 ACE_TRACE ("ACE_Dummy_Node::dump");
744 #endif /* ACE_HAS_DUMP */
747 ACE_Dummy_Node::ACE_Dummy_Node (const ACE_Static_Node
*static_node
,
748 const ACE_Parse_Node
*str_mods
)
749 : ACE_Parse_Node (static_node
->name ()),
753 ACE_TRACE ("ACE_Dummy_Node::ACE_Dummy_Node");
757 ACE_Dummy_Node::apply (ACE_Service_Gestalt
*, int &yyerrno
)
759 ACE_TRACE ("ACE_Dummy_Node::apply");
763 ACELIB_DEBUG ((LM_DEBUG
,
764 ACE_TEXT ("did operations on stream %s, error = %d\n"),
768 ACE_UNUSED_ARG (yyerrno
);
769 #endif /* ACE_NLOGGING */
772 ACE_Dummy_Node::~ACE_Dummy_Node ()
774 ACE_TRACE ("ACE_Dummy_Node::~ACE_Dummy_Node");
775 ACE_Static_Node
*n
= const_cast<ACE_Static_Node
*> (this->node_
);
777 ACE_Parse_Node
*m
= const_cast<ACE_Parse_Node
*> (this->mods_
);
781 ACE_ALLOC_HOOK_DEFINE (ACE_Static_Function_Node
)
784 ACE_Static_Function_Node::dump () const
786 #if defined (ACE_HAS_DUMP)
787 ACE_TRACE ("ACE_Static_Function_Node::dump");
788 #endif /* ACE_HAS_DUMP */
791 ACE_Static_Function_Node::ACE_Static_Function_Node (const ACE_TCHAR
*func_name
)
792 : function_name_ (ACE::strnew (func_name
))
794 ACE_TRACE ("ACE_Static_Function_Node::ACE_Static_Function_Node");
795 this->must_delete_
= 1;
799 ACE_Static_Function_Node::symbol (ACE_Service_Gestalt
*config
,
801 ACE_Service_Object_Exterminator
*gobbler
)
803 ACE_TRACE ("ACE_Static_Function_Node::symbol");
807 // Locate the factory function <function_name> in the statically
810 ACE_Static_Svc_Descriptor
*ssd
= 0;
811 if (config
->find_static_svc_descriptor (this->function_name_
, &ssd
) == -1)
816 ACELIB_ERROR ((LM_ERROR
,
817 ACE_TEXT ("(%P|%t) No static service ")
818 ACE_TEXT ("registered for function %s\n"),
819 this->function_name_
));
824 if (ssd
->alloc_
== 0)
828 if (this->symbol_
== 0)
834 ACELIB_ERROR ((LM_ERROR
,
835 ACE_TEXT ("(%P|%t) No static service factory ")
836 ACE_TEXT ("function registered for function %s\n"),
837 this->function_name_
));
843 // Invoke the factory function and record it's return value.
844 this->symbol_
= (*ssd
->alloc_
) (gobbler
);
846 if (this->symbol_
== 0)
851 ACELIB_ERROR ((LM_ERROR
,
853 this->function_name_
));
858 return this->symbol_
;
861 ACE_Static_Function_Node::~ACE_Static_Function_Node ()
863 ACE_TRACE ("ACE_Static_Function_Node::~ACE_Static_Function_Node");
864 #if defined (ACE_HAS_ALLOC_HOOKS)
865 ACE_Allocator::instance()->free(const_cast<ACE_TCHAR
*> (function_name_
));
867 delete[] const_cast<ACE_TCHAR
*> (this->function_name_
);
868 #endif /* ACE_HAS_ALLOC_HOOKS */
871 ACE_ALLOC_HOOK_DEFINE (ACE_Service_Type_Factory
)
873 ACE_Service_Type_Factory::ACE_Service_Type_Factory (ACE_TCHAR
const *name
,
875 ACE_Location_Node
*location
,
879 , location_ (location
)
880 , is_active_ (active
)
885 ACE_Service_Type_Factory::~ACE_Service_Type_Factory ()
891 ACE_Service_Type_Factory::make_service_type (ACE_Service_Gestalt
*cfg
) const
893 ACE_TRACE ("ACE_Service_Type_Factory::make_service_type");
895 u_int
const flags
= ACE_Service_Type::DELETE_THIS
896 | (this->location_
->dispose () == 0 ? 0 : ACE_Service_Type::DELETE_OBJ
);
899 ACE_Service_Object_Exterminator gobbler
= 0;
901 void *sym
= this->location_
->symbol (cfg
, yyerrno
, &gobbler
);
905 ACE_Service_Type_Impl
*stp
=
906 ACE_Service_Config::create_service_type_impl (this->name (),
914 ACE_Service_Type
*tmp
= 0;
916 ACE_Service_Type (this->name (),
918 this->location_
->dll (),
927 ACELIB_ERROR ((LM_ERROR
,
928 ACE_TEXT ("ACE (%P|%t) Unable to create ")
929 ACE_TEXT ("service object for %s\n"),
938 ACE_Service_Type_Factory::name () const
940 return name_
.c_str ();
944 ACE_END_VERSIONED_NAMESPACE_DECL
946 #endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */